Parameters and Settings
Enable/Disable the serverless mode
serverless
WeSQL, by default, uses object storage as its persistent storage medium. This includes persisting the binlog to object storage, creating consistent snapshots and saving them to object storage, and persisting SmartEngine extent data to object storage. However, to support environments where object storage is unavailable, or to compare the performance between object storage and local disk, WeSQL also supports using local disk as the persistent storage medium. In such cases, serverless mode must be disabled.
The serverless mode can be disabled either via the server command option:
mysqld --serverless=false
or by modifying the option file (my.cnf):
serverless=false
Object Storage Settings
WeSQL persists data to object storage. This section covers the configuration parameters related to object storage.
objectstore_provider
The object storage provider setting. Currently supported values are aws and local, and this parameter is mandatory.
The local option simulates object storage using the local file system and is intended for testing and development purposes only.
When objectstore_provider is set to local, the serverless mode must be enabled. This behavior is different from disabling serverless mode, even though in both configurations the local disk is used.
Example:
objectstore_provider=aws
objectstore_region
The region where the object storage is located. This parameter is Required.
Example:
objectstore_region=cn-northwest-1
objectstore_endpoint
The endpoint of the object storage. This allows access to the object storage via the specified endpoint.
objectstore_use_https
Specifies whether to use the HTTPS protocol for accessing object storage. The default value is false.
Example:
objectstore_use_https=true
objectstore_bucket
The bucket in the object storage where all persistent data of the WeSQL instance will be stored. Each bucket can only be used by one instance, and this parameter is Required.
Example:
objectstore_bucket=wesql-cluster-1
cluster_objectstore_id
The data directory identifier under the object storage bucket that stores all persistent data of the WeSQL instance. To ensure the uniqueness of data directory identifiers for different instances under the bucket, it is recommended to set option value as UUID.
Example:
cluster_objectstore_id=FD2D88FB-7994-4318-AD3F-2E37ADF52DBC
> uuidgen
FD2D88FB-7994-4318-AD3F-2E37ADF52DBC
Consistent Snapshot Settings
consistent_snapshot_persistent_on_objectstore
Indicates whether to enable consistent snapshots, default is true. Consistent snapshots will be periodically generated and persisted to object storage. Consistent snapshots should be disabled for Logger nodes.
Example:
consistent_snapshot_persistent_on_objectstore=false
consistent_snapshot_archive_dir
The local temporary archive path for consistent snapshot objects. This directory must be created before starting the instance, and it must not be a subdirectory of the datadir. The default value is null, which will automatically use MySQL's tmp directory (--tmpdir) as the archive_dir.
Example:
consistent_snapshot_archive_dir=/u01/wesql_archive_dir
consistent_snapshot_archive_period
The frequency, in seconds, at which a consistent snapshot is generated. The default value is 600 seconds (10 minutes). A consistent snapshot is created at every cycle. Additionally, a consistent snapshot is generated after the system starts up and before shuts down gracefully.
Example:
consistent_snapshot_archive_period=1800
consistent_snapshot_expire_auto_purge
Indicates whether to enable the automatic cleanup of expired consistent snapshots stored in object storage. The default value is true. Consistent snapshots will be cleaned up when the creation time plus 'consistent_snapshot_expire_seconds' exceeds the current time.
Example:
consistent_snapshot_expire_auto_purge=true
consistent_snapshot_expire_seconds
The expiration period, in seconds, for consistent snapshots stored in object storage. The default value is 0, meaning only the latest consistent snapshot is retained, and older snapshots are automatically purged. If you want to retain historical consistent snapshots, you can set a specific period in seconds to keep them for a defined time. This setting can be used for Point-in-Time Recovery (PITR).
Example:
consistent_snapshot_expire_seconds=2592000
consistent_snapshot_innodb_tar_mode
In what format is the InnoDB data of a consistent snapshot persisted to object storage.
'TAR' indicates that InnoDB data is first packaged using tar locally before being persisted. 'TAR_AND_COMPRESS' indicates that InnoDB data is first compressed and then packaged using tar before being persisted. 'OFF' indicates that InnoDB data is directly persisted by directory. The defaut value is 'OFF'.
consistent_snapshot_innodb_tar_mode=TAR
consistent_snapshot_smartengine_tar_mode
In what format is the SmartEngine data of a consistent snapshot persisted to object storage.
'TAR' indicates that SmartEngine data is first packaged using tar locally before being persisted. 'TAR_AND_COMPRESS' indicates that SmartEngine data is first compressed and then packaged using tar before being persisted. 'OFF' indicates that SmartEngine data is directly persisted by directory. The defaut value is 'OFF'.
consistent_snapshot_smartengine_tar_mode=TAR
Binlog Archive Settings
binlog_archive
Indicates whether to enable binlog persistent, default is true. Binlog will be periodically persisted to object storage.
binlog_archive=false
binlog_archive_dir
The local temporary archive path for binlog objects. This directory must be created before starting the instance, and it must not be a subdirectory of the datadir. The default value is null, which will automatically use MySQL's tmp directory (--tmpdir) as the archive_dir.
Example:
binlog_archive_dir=/u01/wesql_archive_dir
binlog_archive_slice_max_size
The binlog object size when uploaded to object storage, with a default value of 4MB. During the binlog persistence process, events are batched and written to the local cache. Once the size limit defined by this parameter is reached, these events are packaged and uploaded to object storage as a binlog slice object.
Example:
binlog_archive_slice_max_size=1048576
For example, the binlog file binlog.000001 would have the following slice objects:
binlog.000001.00000000000000000002.0004048843
binlog.000001.00000000000000000002.0009345154
binlog.000001.00000000000000000002.0010137258
binlog_archive_period
The minimum time period for binlog persistence, during which binlog events must be persisted even if the locally cached binlog events have not reached 'binlog_archive_slice_max_size'.The goal is to achieve near real-time persistence, even if the binlog is persisted to object storage in batches. The default value is 3 seconds.
Example:
binlog_archive_period=3
binlog_archive_expire_auto_purge
Indicates whether to enable the automatic cleanup of expired binlog objects stored in object storage. The default value is true. Binlog objects will be cleaned up when the creation time plus 'binlog_archive_expire_seconds' exceeds the current time.
Example:
binlog_archive_expire_auto_purge=true
binlog_archive_expire_seconds
The expiration period, in seconds, for binlog objects stored in object storage. The default value is 2592000 seconds (30 days). The value of binlog_archive_expire_seconds should be greater than consistent_snapshot_expire_seconds. Otherwise, even if a binlog is marked as expired, it cannot be purged as long as it is still referenced by a consistent snapshot.
Example:
binlog_archive_expire_seconds=2592000
Raft Group Settings(TODO: the description)
raft-replication-cluster-id
Specifies the Raft group cluster ID.
raft-replication-cluster-info
Defines the Raft group members and their respective addresses (this is logger node 2 in the cluster).
--raft-replication-cluster-info='192.168.0.2:13006;192.168.0.3:13007;192.168.0.4:13008@2'
raft_replication_auto_leader_transfer
Allows automatic leader transfer in the Raft group.
raft_replication_log_type_node
Specifies that this node is a logger node in the Raft group.
raft_replication_election_timeout
raft election timeout.
raft_replication_heartbeat_thread_cnt
Number of raft heartbeat thread.
raft_replication_io_thread_cnt
Number of raft IO thread.
raft_replication_worker_thread_cnt
Number of raft worker thread.
raft_replication_large_trx
raft large trx or not.
raft_replication_max_log_size
Max one log size. (default: 20M)
raft_replication_large_event_split_size
Split size for large event, dangerous to change this variable.
raft_replication_log_cache_size
Max cached logs size.
raft_replication_log_level
raft log level.
raft_replication_new_follower_threshold
Max delay index to allow a learner becomes a follower.
raft_replication_pipelining_timeout
The timeout the raft server cache the log (milliseconds).
raft_replication_send_timeout
raft send packet timeout.
raft_replication_configure_change_timeout
raft configure change timeout (ms). Default 1 min.
raft_replication_force_change_meta
raft cluster force to change meta.
raft_replication_force_single_mode
raft cluster force to use single mode.
raft_replication_learner_node
raft cluster learner node type.
raft_replication_learner_timeout
raft learner connection timeout.