Skip to main content
Version: latest

Configuration

Introduction

The configuration adopts TOML syntax.

TOML Syntax Reference: https://toml.io

You can use cnosdb config command to create a default config file (v2.2.0), for example:

cnosdb config > /tmp/config.toml

You can use cnosdb check server-config <path> command to check a config file (v2.2.0), for example:

cnosdb check server-config /tmp/config.toml

The configuration file consists of several TOML key-value pairs and tables, as shown below:

TOML Key

  • reporting_disabled Whether to turn off information collection.
  • host Node host.
  • raft_logs_to_keep When using raft protocol for replication; How many raft logs each replication group keeps and how often to take snapshots.
  • using_raft_replication Raft protocol is used for replica replication. Note: it is not stable at present, so it is not recommended for online use.

TOML Value

  • [deployment] CnosDB startup configuration (v2.2.0)
  • [query] query interface configuration
  • [storage] storage configuration
  • [wal] write pre-log configuration
  • [cache] cache configuration
  • [log] runs log configuration
  • [security] security configuration
  • [cluster] cluster configuration
  • [heartbeat] heartbeat configuration (v2.3.0)
  • [node_basic] node configuration (v2.3.0)
  • [hintedoff] hintedOff configuration
  • [trace] fFull link tracing configuration

The detailed configuration file description is as follows:

[deployment]

ParameterDescription
modeDeployment mode, select from [tskv,query, query_tskv, singleton], default: query_tskv
cpuSpecify the number of CPU cores required for the instance, default: 10
memoryline_protocol request, the maximum number of bytes in the request body, default: 16

Parameter mode can be selected from the following values:

  • tskv : Deploying only tskv engine requires specifying a meta address.
  • query : Deploying only the query engine requires specifying a meta address.
  • query_tskv : Both query and tskv engines are deployed, and a meta address needs to be specified.
  • singleton : Deploying a standalone version without specifying a meta address.

reporting_disabled

Note: If close information collection

The CnosDB collects information to better improve the product

We do not collect user data, we only collect

  • Database instance running time
  • Operating system type and architecture run by database instance.
  • Database version
  • Areas run by database instances, only at the provincial level, state level

You can set this as True to shut down information collection at the top of the configuration file.

reporting_disabled = true

host

Description: node host, used to communicate with other nodes, default: localhost.

[query]

ParameterDescription
max_server_connectionsMaximum concurrent connection request, default is 10240.
query_sql_limitThe maximum SQL accounting when the request is requested, default is 16777216.
write_sql_limitWhen writing a request on LINE_PROTOCOL, request the maximum number of bytes, default is 16777216.
auth_enabledWhether to start checking user permissions, default is false.

[storage]

ParameterDescription
pathData storage location
max_summary_sizeThe largest summary log size is used to restore data in the database, default: 128M
base_file_sizeSingle file data size, default: 16M
flush_req_channel_capCumulative upper limit of persistence tasks, default: 16
max_levelLSM's maximum number of layers, value range 0-4, default: 4
compact_trigger_file_numThe number of files required to trigger the compaction, default: 4
compact_trigger_cold_durationIf there is no operation within the time period, a compaction will be triggered, default: 1h
max_compact_sizeMaximum compression size, default: 2G
max_concurrent_compactionThe maximum number of concurrent compaction tasks, default: 4
strict_writeWhether it is strictly written, default: false

[wal]

ParameterDescription
wal_req_channel_capMaximum accumulated write WAL tasks, default: 64
enabledWhether to enable Wal, default: false
pathRemote log path
max_file_sizeThe maximum size of a single WAL, default: 1G
syncSynchronous Write WAL Remote Log, Default False
sync_intervalThe time interval for synchronizing WAL, default: 0, i.e. not actively synchronizing

[cache]

ParameterDescription
max_buffer_sizeMaximum cache size, default: 134217728
max_immutable_numberImmemTable maximum, default: 4

[log]

ParameterDescription
levelLog Level (Debug, Info, Error, Warn), Default: Info
pathLog storage location

[security]

ParameterDescription
tls_configOptional, TLS configuration

[security.tls_config]

ParameterDescription
certificateTLS service certificate
private_keyTLS service private key

[cluster]

ParameterDescription
nameCluster Name
meta_service_portRemote Meta Service port
http_listen_portHTTP service listening port
grpc_listen_portGRPC service listening port
tcp_listen_portTCP service listening port
flight_rpc_listen_portFlight RPC service listening port

[node_basic]

ParameterDescription
node_idNode ID
cold_data_serverIf this field is true, it means that the node is not used when allocating vnode
store_metricsIf this field is true, it means storing metrics information to db

[heartbeat]

ParameterDescription
report_time_interval_secsThis field indicates how often the node reports the time stamp, disk remaining amount and other information to the meta node

[hintedoff]

ParameterDescription
enableIs the HIntedOff service enabled, default: true
pathHintedOff storage directory, default: /tmp/cnosdb/hh
threadsNumber of concurrent processing of handoff data, default: 3

[subscription]

ParameterDescription
cachecache size (bit) before sending and forwarding, default: 1028
concurrencynumber of concurrent requests processed for forwarding, default: 8
timeouttimeout period for forwarding requests (seconds), default: 300

[trace]

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

[trace.log] (optional)

ParameterDescription
pathtrace log file path

[trace.jaeger] (optional)

ParameterDescription
jaeger_agent_endpointthe Jaeger agent endpoint.eg: http://localhost:14268/api/traces
max_concurrent_exportstrace parallelism of the reporter, default value is 2
max_queue_sizespan Maximum queue size of the buffer. If the queue is full, it drops the span, default value is 4096

CnosDB Meta Configuration

The configuration file of the Meta node is in the same format as the Data node and consists of several TOML key-value pairs and tables, as follows:

TOML KEY

  • id : id of Meta node, the value must be unique in the cluster
  • host: host of Meta node
  • port: port of Meta node
  • snapshot_path: snapshot storage path of Meta node
  • journal_path: journal storage path of Meta node
  • snapshot_per_events: The Meta node does a snapshot interval

TOML TABLE

  • [log]: run log configuration
  • [meta_init]: example initializes related configuration information of Meta node
  • [heartbeat]: check CnosDB node status configurations periodically

The detailed configuration file description is as follows:

[log]

ParameterDescription
levelLog level(debug、info、error、warn, default: info
pathlog storage path,default:data/log

[meta_init]

ParameterDescription
cluster_nameClusterName
admin_userUser name of the system administrator
system_tenantName of the default tenant
default_databaseDefault database created

[heartbeat]

ParameterDescription
heartbeat_recheck_intervalInterval for checking the heartbeat status of a node
heartbeat_expired_intervalInterval for checking whether a node is abnormal