---
title: "清除 cgroup 配置 - OceanBase 数据库 V4.6.0 | OceanBase 文档中心"
description: 清除 cgroup 配置 cgroup 目录配置后，可以手动删除原来配置的 cgroup 系统目录。 前提条件 请确认 cgroup 配置所在的 OBServer 已停止运行，停止 OBServer 的相关操作请参见 重启节点 。 清除配置 使用 admin 用户登录 OBServer 服务器所在的机器。 删除 Oc…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.6.0

# 清除 cgroup 配置

更新时间：2026-05-23 19:20:18

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.6.0/zh-CN/600.manage/200.tenant-management/600.common-tenant-operations/300.resource-isolation/300.resource-isolation-of-mysql-mode/800.clear-cgroup-configuration-of-mysql-mode.md)  

cgroup 目录配置后，可以手动删除原来配置的 cgroup 系统目录。

## 前提条件

请确认 cgroup 配置所在的 OBServer 已停止运行，停止 OBServer 的相关操作请参见 [重启节点](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000005682481)。

## 清除配置

1. 使用 `admin` 用户登录 OBServer 服务器所在的机器。
 2. 删除 OceanBase 数据库软件安装目录与 cgroup 目录的软链接。

   ```shell
   [admin@xxx /home/admin/oceanbase]
   $ll cgroup
   lrwxrwxrwx 1 admin admin 29 Dec  8 11:09 cgroup -> /sys/fs/cgroup/cpu/oceanbase/

   [admin@xxx /home/admin/oceanbase]
   $ rm -rf cgroup

   ```
 3. 删除 cgroup 系统目录 `/sys/fs/cgroup/cpu/oceanbase`。

   由于 cgroup 系统目录中的文件需要从下往上递归删除，您可以创建一个脚本文件 `deletecgroupdir.sh` 来批量删除 cgroup 的系统目录。

      1. 创建脚本文件并填入内容保存。

        ```shell
        [admin@xxx /home/admin]$ vim deletecgroupdir.sh

        ```

        文件中需要填入的内容如下。

        ```JavaScript
        #! /bin/bash
        function read_dir(){
                for file in `ls $1`
                        do
                                if [ -d $1"/"$file ]
                                        then
                                                read_dir $1"/"$file

                                fi
                done
                string=$1
                echo rmdir $string
                rmdir $string
        }
        #读取第一个参数
        read_dir /sys/fs/cgroup/cpu/oceanbase

        ```
      2. 执行脚本，删除 cgroup 系统目录。

        ```shell
        [admin@xxx /home/admin]
        $sudo /bin/bash deletecgroupdir.sh

        ```

## 相关文档

[配置 cgroup](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000005685796)

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
