After OceanBase Database is upgraded, the structure of the control group (cgroup) directory may change. Therefore, before you upgrade OceanBase Database, you must delete the original cgroup system directory.
Prerequisites
You have stopped the OBServer node where the cgroup system directory is configured. For more information, see Restart a node.
Procedure
Log on as the
adminuser to the server where the OBServer node resides.Delete the soft link between the installation directory of OceanBase Database 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.Files in the cgroup system directory must be recursively deleted from a lower-level directory to an upper-level directory. Therefore, you can create a script file named
deletecgroupdir.shto delete a directory and its subdirectories.Create a script file, enter related content, and save the script file.
[admin@xxx /home/admin]$ vim deletecgroupdir.shYou must enter the following content in the script file:
#! /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