The running of an OBServer node relies on the data disk, clog disk, and installation disk where OceanBase Database is installed. If you are an individual user, you can put all the data on a single disk and skip this topic. If you are an enterprise user, you must separately mount your data to three disks.
If you do not have three disks for a server, or if you are using Redundant Array of Independent Disks (RAID), you need to partition the disk or disk array into logical volumes. The recommended partitioning method is as follows:
Data disk
The data disk is mounted to the
data_dirdirectory, and is used for storing the baseline data. When you start OceanBase Database for the first time, the${data_dir}/{sstable,slog}directory is automatically created. The size of the data disk is determined by thedatafile_disk_percentageparameter.Clog disk
The clog disk is mounted to the
clog_dirdirectory. We recommend that you set the size of the clog disk to at least 3 or 4 times that of the memory for the OceanBase Database. When you start OceanBase Database for the first time, the${clog_dir}directory is automatically created. The clog disk contains files of a fixed size, You can create or clean up them as needed. When the total size of clog files reaches 80% of the total disk capacity, automatic cleanup is triggered. However, the clog files can be cleaned up only when the corresponding memory data has been compacted and merged with the baseline data.For a given size of memory data, the size of clog files is approximately three times larger. Therefore, the maximum space required for the clog disk is directly proportional to the total amount of data after two major compactions. You can use the empirical formula for evaluation: Size of clog files = Maximum memory space for incremental data × 3 or 4.
OceanBase Database installation disk
The disk for the installation of OceanBase Database is mounted to the
home_pathdirectory. We recommend that you reserve at least 200 GB to save log files for 7 or more days. The RPM package of OceanBase Database is located in the${home_path}directory. The baseline data files and clog files are mapped to the preceding data disk and clog disk through soft links. The operational logs of OceanBase Database are located in the${home_path}/logdirectory. The number of operational logs will keep increasing because OceanBase Database cannot automatically delete them. Therefore, you need to regularly delete the operational logs.
After you plan the disks, run the following command to view the disk information:
df -h
For example, the following output is returned:
Filesystem Size Used Avail Use% Mounted on
devtmpfs 31G 0 31G 0% /dev
tmpfs 31G 0 31G 0% /dev/shm
tmpfs 31G 516K 31G 1% /run
tmpfs 31G 0 31G 0% /sys/fs/cgroup
/dev/vda1 493G 171G 302G 37% /
tmpfs 6.2G 0 6.2G 0% /run/user/0
/dev/vdd1 984G 77M 934G 1% /data
/dev/vdc1 196G 61M 186G 1% /redo
/dev/vdb1 492G 73M 467G 1% /home/admin/oceanbase
In the previous output:
The
/datastring indicates the information of the data disk, which is 1 TB in size.The
/redostring indicates the information of the log disk where the redo logs are stored.The
/home/admin/oceanbasestring indicates the information of the installation disk where the binary files and operational logs of OceanBase Database are stored.