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 used to store baseline data, and its path is specified by the
data_dirparameter. When you start the OceanBase cluster for the first time,${data_dir}/{sstable,slog}will be created automatically. The size of the data disk is determined by parametersdatafile_disk_percentageanddatafile_size. Additionally, after deployment, you can perform dynamic expansion of disk files through thedatafile_nextanddatafile_maxsizeoptions. For more information, see Configure automatic scale-out of disk space for data files.Note
The current version of OceanBase Database supports separating
slogfrom the data disk, meaningslogand data files do not need to be on the same disk. For more information about the OceanBase installation directory, see Installation directory structure of an OBServer node.Clog disk
The path of the clog disk is specified by the
clog_dirparameter. We recommend that you set the size of the clog disk to 3 to 4 times or more of the memory for OceanBase Database. When you start the OceanBase cluster for the first time,${clog_dir}will be created automatically. The clog disk contains multiple fixed-size files, which can be automatically created and cleared based on your needs. Automatic clearance is triggered when the clog reaches 80% of the total disk capacity. However, the clog can only be deleted when the corresponding memory data has been merged into 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 path of the installation disk is specified by the
home_pathparameter. 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.