A typical OBServer node working directory contains the following eight directories: audit/, bin/, etc/, etc2/, etc3/, log/, run/, and store/. However, not all of them are required for the installation of an OBServer node. Before you start an OBServer node, make sure that the etc/, log/, run/, and store/ directories exist. In addition, the store/ directory must contain the clog/, slog/, and sstable/ directories. The etc2/ and etc3/ directories are created by an OBServer node to store the backup configuration files. The audit/ directory is created by an OBServer node to store the audit logs. The bin/ directory stores the observer binary files for future use.
├─audit
├─bin
├─etc
├─etc2
├─etc3
├─log
├─run
├─store
├─clog
├─slog
├─sstable
Directory of configuration files
The configuration files are stored in the etc/, etc2/, and etc3/ directories. These three directories have the same files. The difference among the directories lies in that the etc/ directory must be manually created before you start an OBServer node, whereas the other two are created by an OBServer node to store copies of configuration files in the etc/ directory. You can specify whether to create the etc2/ and etc3/ directories by setting the config_additional_dir parameter. A configuration change not only writes data into the observer.config.bin file in the etc/ directory but also creates additional configuration files in the etc2/ and etc3/ directories. The OBServer node does not read configuration files in the etc2/ and etc3/ directories. Configuration files in these two directories are used for backup only. The OBServer node automatically creates the two directories if it has the permission. Otherwise, an error is returned in the log.
The configuration files store the incremental information of the cluster- and tenant-level parameters. You can log on to the database and execute an ALTER SYSTEM statement to modify a cluster parameter, or specify a cluster parameter by using a command-line tool. The value of a parameter that is specified by using a command-line tool overwrites the existing one. If you use a command-line tool, you can specify the following options to modify parameters of the OBServer node:
-z,--zone ZONE The name of the zone in which the node exists.
-p,--mysql_port PORT The MySQL port number for the SQL service protocol.
-P,--rpc_port PORT The RPC port number for the communication within a cluster.
-n,--appname APPNAME The name of the OceanBase cluster.
-c,--cluster_id ID The ID of the OceanBase cluster.
-d,--data_dir DIR The directory where data such as the SSTable is stored.
-i,--devname DEV The name of the NIC bound to the service process.
-r,--rs_list RS_LIST The RootService list.
-l,--log_level LOG_LEVEL The system log level.
-o,--optstr OPTSTR The additional parameters specified in the format of "parameter name=new value,parameter name=new value".
Directory of log files
The log/ directory stores the following operational log files: observer logs, RootService logs, and election logs. The size of a single log file is 256 MB.
When the enable_syslog_recycle parameter is set to true and the max_syslog_file_count parameter is set to an integer greater than 0, log files are automatically recycled. enable_syslog_recycle specifies whether to enable system log recycling. max_syslog_file_count specifies the maximum number of log files allowed for each log type.
Data file directory
The data files are stored in the store/ directory, which contains the clog/, slog/, and sstable/ directories. The slog/ directory stores transaction logs for static data writes. The clog/ directory stores transaction logs for dynamic data writes. The sstable/ directory stores the baseline data and contains a file named block_file, which is created after the OBServer node starts. The size of the file is determined by the datafile_size or datafile_disk_percentage parameter.
Note
datafile_sizespecifies the size of a data file.datafile_disk_percentagespecifies the percentage of occupied space of the disk where thedata_dirdirectory resides. The disk of thedata_dirdirectory will be initialized by OceanBase Database to store data.
For more information about the two parameters, see the System parameters chapter of OceanBase Database Reference Guide.