Skip to main content
Version: 2.3.x

Configuration

This section describes how to configure the CnosDB configuration.

The configuration adopts TOML syntax.

TOML Syntax Reference: https://toml.io

Use the cnosdb config command to create default configuration files, For example:

cnosdb run config > ./cnosdb.conf

Use the cnosdb check server-config <path> command to check if the configuration file is legal, for example:

cnosdb check server-config ./cnosdb.conf

Use the cnosdb command to specify the configuration file to start:

cnosdb --config ./cnosdb.conf

Description

Global

ParametersDefaultDescription
reporting_disabledfalseWhether to turn off the automatic reporting of telemetry data by CnosDB, mainly to track the usage rates of different versions of CnosDB, which is beneficial for the continuous development of CnosDB.Data is reported every 24 hours, each record includes: instance running time, operating system type, database version, geographical location of the instance (up to provincial or continental level).
hostlocalhostUsed to communicate with other nodes.

[deployment]

ParametersDefaultDescription
modequery_tskvDeployment mode, Optional: tskv, query, query_tskv, singleton. tskv: Deploying only tskv engine requires specifying a meta address. query: Only deploy the query engine, a meta address needs to be specified. query_tskv: query and tskv engines are both deployed, a meta address needs to be specified. singleton: Deploying a standalone version without specifying a meta address.
cpu10Number of CPU cores used by the node to run
memory16Maximum memory used by the node during operation, unit: (G)

[query]

ParametersDefaultDescription
max_server_connections10240Maximum number of concurrent connection requests.
query_sql_limit16777216Maximum number of bytes per SQL query request, unit: Bytes
write_sql_limit167772160Maximum number of bytes per Line Protocol to write to the request, unit: Bytes
auth_enabledfalseWhether to start checking user permissions.
read_timeout_ms3000query visits the timeout of tskv in units: ms
write_timeout_ms3000Timeout for writing to tskv in unit: ms.
stream_trigger_cpu1Number of CPUs to prepare stream calculation tasks
stream_executor_cpu2Number of CPUs to execute stream calculation tasks

[storage]

ParametersDefaultDescription
path/etc/cnosdb/cnosdb.confData storage directory.
max_summary_size128MMaximum size of a single Summary log.
base_file_size16MSingle file data size.
flush_req_channel_cap16Cumulative flush task ceiling.
max_cached_readers32The maximum count of file handles (for querying) opened in each vnode.
max_level4The maximum number of layers of the LSM, in the range 0-4.
compact_trigger_file_num4Number of files to trigger compaction.
compact_trigger_cold_duration1hCompaction is triggered when no action is taken during the time period.
max_compact_size2GMaximum selected file size for compaction.
max_concurrent_compaction4Maximum number of compaction tasks to be performed simultaneously.
strict_writefalseWhether to enable strict writing.
copyinto_trigger_flush_size128MCOPY INTO Export triggers the memory size of the disk.

[wal]

ParametersDefaultDescription
enabledtrueWhether to enable WAL.
path/var/lib/cnosdb/walWAL storage directory.
wal_req_channel_cap64Cumulative write WAL task ceiling.
max_file_size1GMaximum size of a single WAL.
flush_trigger_total_file_size2GFlash when all WAL sizes reach this value.
syncfalseWhether to sync for each writing.
sync_interval0Time interval for synchronizing the WAL, i.e. without active synchronization, in h, m, s, ms, us, ns

[cache]

ParametersDefaultDescription
max_buffer_size128MMaximum active cache size.
max_immutable_number4Maximum number of inactive cache.
partitionEqual to the number of system 'CPU'Number of partitions for memcache cache

[log]

ParametersDefaultDescription
levelinfoLog Level (debug, info, error, warn).
path/var/log/cnosdbLog storage directory.
tokio_trace{ addr = "127.0.0.1:6669" }Tokio tracking is off by default.

[security]

ParametersDefaultDescription
tls_configNoneTLS Configuration

[security.tls_config](optional)

ParametersDefaultDescription
certificateNoneTLS service certificate
private_keyNoneTLS service private key

[cluster]

ParametersDefaultDescription
namecluster_xxxNode name
meta_service_addr127.0.0.1:8901Remote meta Service port
http_listen_port8902HTTP service listening port.
grpc_listen_port8903GRPC service listening port.
flight_rpc_listen_port8904Flight RPC service listening port.
tcp_listen_port8905TCP service listening port.
vector_listen_port8906Use to listen for Vector written data.

[hintedoff]

ParametersDefaultDescription
enabletrueIs the HIntedOff service enabled, default: true
path/var/lib/cnosdb/hhHintedOff storage directory.
threads3Number of conjunctions to process the Hinted handoff data.

[heartbeat]

ParametersDefaultDescription
report_time_interval_sec30Time interval between reporting heart, disk balance and other information on this node to meta service in: seconds.

[node_basic]

ParametersDefaultDescription
node_id1001Node ID.
cold_data_serverfalseWhether to stop creating Vnode on this node.
store_metricstrueWhether to track the usage of this node and store it in the usage_schema database.

[trace]

ParametersDefaultDescription
auto_generate_spanfalseWhether to automatically generate a root span. This parameter is valid when the client does not carry a span context

[trace.log] (optional)

ParametersDefaultDescription
pathNonetrace log file path

[trace.jaeger] (optional)

ParametersDefaultDescription
jaeger_agent_endpointNonethe Jaeger agent endpoint。eg: http://localhost:14268/api/traces
max_concurrent_exports2The parallelism of the reporter on trace.Default value is 2
max_queue_size4096span Maximum queue size of the buffer. If the queue is full, it drops the span, default value is 4096If the queue is full, it will drop span.

meta file description

Global

ParametersDefaultDescription
id1meta node's id, requires unique cluster
host127.0.0.1host for communication with other nodes
port8901port for communicating with other nodes
snapshot_path/var/lib/cnosdb/meta/snapshot
journal_path/var/lib/cnosdb/meta/journal
snapshot_per_events500

[log]

ParametersDefaultDescription
levelinfoLog Level (debug, info, error, warn).
path/var/log/cnosdbLog storage directory.

[meta_init]

ParametersDefaultDescription
cluster_namecluster_xxxCluster Name
admin_userrootUser name of the system administrator
system_tenantcnosdbName of the default tenant
default_database["public","usage_schema"]Default database created

[heartbeat]

ParametersDefaultDescription
heartbeat_recheck_interval300How often to check the status of CnosDB nodes, in seconds.
heartbeat_expired_interval300How long has the CnosDB node not reported an abnormal heartbeat determination, measured in seconds.