After OceanBase Database is upgraded, the directory structure of the control group (cgroup) may change. Therefore, before upgrading OceanBase Database, you must clear the previously configured cgroup system directory.
Prerequisites
The OBServer node where the cgroup system directory is configured has been stopped. For the steps to stop an OBServer node, see Restart a node.
Procedure
Log in to the server where the OBServer node is located using the
adminuser.Remove the soft link between the OceanBase Database software installation directory and the cgroup system directory.
[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 cgroupDelete the cgroup system directory
/sys/fs/cgroup/cpu/oceanbase.Since the files in the cgroup system directory must be recursively deleted from a lower-level directory to an upper-level directory, you can create a script file named
deletecgroupdir.shto delete the cgroup system directory and its subdirectories in batches.Create a script file and save it with the following content.
[admin@xxx /home/admin]$ vim deletecgroupdir.shThe content to be filled in the file is as follows:
#! /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 the first parameter. read_dir /sys/fs/cgroup/cpu/oceanbaseExecute the script to delete the cgroup system directory.
[admin@xxx /home/admin] $sudo /bin/bash deletecgroupdir.sh