Skip to main content

taosd Reference

taosd is the core service of the TDengine database engine, and its configuration file is by default located at /etc/taos/taos.cfg, but you can also specify a configuration file in a different path. This section provides a detailed introduction to the command-line parameters of taosd and the configuration parameters in the configuration file.

Command Line Parameters

The command line parameters for taosd are as follows:

  • -a <json file>: Specifies a JSON file containing various configuration parameters for service startup, formatted like {"fqdn":"td1"}. For details on configuration parameters, please refer to the next section.
  • -c <directory>: Specifies the directory where the configuration file is located.
  • -s: Prints SDB information.
  • -C: Prints configuration information.
  • -e: Specifies environment variables, formatted like -e 'TAOS_FQDN=td1'.
  • -k: Retrieves the machine code.
  • -dm: Enables memory scheduling.
  • -V: Prints version information.

Configuration Parameters

note

After modifying configuration file parameters, you need to restart the taosd service or client application for the changes to take effect.

Parameter NameSupported VersionDescription
firstEpEndpoint of the first dnode in the cluster that taosd actively connects to at startup, default value localhost:6030
secondEpEndpoint of the second dnode in the cluster that taosd tries to connect to if the firstEp is unreachable, no default value
fqdnThe service address that taosd listens on, default is the first hostname configured on the server
serverPortThe port that taosd listens on, default value 6030
compressMsgSizeWhether to compress RPC messages; -1: do not compress any messages; 0: compress all messages; N (N>0): only compress messages larger than N bytes; default value -1
shellActivityTimerDuration in seconds for the client to send heartbeat to mnode, range 1-120, default value 3
numOfRpcSessionsMaximum number of connections supported by RPC, range 100-100000, default value 30000
numOfRpcThreadsNumber of threads for receiving and sending RPC data, range 1-50, default value is half of the CPU cores
numOfTaskQueueThreadsNumber of threads for client to process RPC messages, range 4-16, default value is half of the CPU cores
rpcQueueMemoryAllowedMaximum memory allowed for received RPC messages in dnode, in bytes, range 104857600-INT64_MAX, default value is 1/10 of server memory
resolveFQDNRetryTimeCancelled after 3.xNumber of retries when FQDN resolution fails
timeToGetAvailableConnCancelled after 3.3.4.xMaximum waiting time to get an available connection, range 10-50000000, in milliseconds, default value 500000
maxShellConnsCancelled after 3.xMaximum number of connections allowed
maxRetryWaitTimeMaximum timeout for reconnection, default value is 10s
shareConnLimitAdded in 3.3.4.0Number of requests a connection can share, range 1-512, default value 10
readTimeoutAdded in 3.3.4.0Minimum timeout for a single request, range 64-604800, in seconds, default value 900
Parameter NameSupported VersionDescription
monitorWhether to collect and report monitoring data, 0: off; 1: on; default value 0
monitorFqdnThe FQDN of the server where the taosKeeper service is located, default value none
monitorPortThe port number listened to by the taosKeeper service, default value 6043
monitorIntervalThe time interval for recording system parameters (CPU/memory) in the monitoring database, in seconds, range 1-200000, default value 30
monitorMaxLogsNumber of cached logs pending report
monitorCompWhether to use compression when reporting monitoring logs
monitorLogProtocolWhether to print monitoring logs
monitorForceV2Whether to use V2 protocol for reporting
telemetryReportingWhether to upload telemetry, 0: do not upload, 1: upload, default value 1
telemetryServerTelemetry server address
telemetryPortTelemetry server port number
telemetryIntervalTelemetry upload interval, in seconds, default 43200
crashReportingWhether to upload crash information; 0: do not upload, 1: upload; default value 1
Parameter NameSupported VersionDescription
countAlwaysReturnValueWhether count/hyperloglog functions return a value when input data is empty or NULL; 0: return empty row, 1: return; default value 1; When this parameter is set to 1, if the query contains an INTERVAL clause or the query uses TSMA, and the corresponding group or window has empty or NULL data, the corresponding group or window will not return a query result; Note that this parameter should be consistent between client and server
tagFilterCacheWhether to cache tag filter results
maxNumOfDistinctResMaximum number of distinct results allowed to return, default value 100,000, maximum allowed value 100 million
queryBufferSizeNot effective yet
queryRspPolicyQuery response strategy
filterScalarModeForce scalar filter mode, 0: off; 1: on, default value 0
queryPlannerTraceInternal parameter, whether the query plan outputs detailed logs
queryNodeChunkSizeInternal parameter, chunk size of the query plan
queryUseNodeAllocatorInternal parameter, allocation method of the query plan
queryMaxConcurrentTablesInternal parameter, concurrency number of the query plan
queryRsmaToleranceInternal parameter, tolerance time for determining which level of rsma data to query, in milliseconds
enableQueryHbInternal parameter, whether to send query heartbeat messages
pqSortMemThresholdInternal parameter, memory threshold for sorting
Parameter NameSupported VersionDescription
timezoneTime zone; defaults to dynamically obtaining the current time zone setting from the system
localeSystem locale information and encoding format, defaults to obtaining from the system
charsetCharacter set encoding, defaults to obtaining from the system
info
  1. To address the issue of data writing and querying across multiple time zones, TDengine uses Unix Timestamps to record and store timestamps. The nature of Unix Timestamps ensures that the timestamps generated are consistent at any given moment across any time zone. It is important to note that the conversion to Unix Timestamps is done on the client side. To ensure that other forms of time on the client are correctly converted to Unix Timestamps, it is necessary to set the correct time zone.

On Linux/macOS, the client automatically reads the time zone information set by the system. Users can also set the time zone in the configuration file in various ways. For example:

timezone UTC-8
timezone GMT-8
timezone Asia/Shanghai

All are valid settings for the GMT+8 time zone. However, note that on Windows, the format timezone Asia/Shanghai is not supported, and must be written as timezone UTC-8.

The setting of the time zone affects the querying and writing of SQL statements involving non-Unix timestamp content (timestamp strings, interpretation of the keyword now). For example:

SELECT count(*) FROM table_name WHERE TS<'2019-04-11 12:01:08';

In GMT+8, the SQL statement is equivalent to:

SELECT count(*) FROM table_name WHERE TS<1554955268000;

In the UTC time zone, the SQL statement is equivalent to:

SELECT count(*) FROM table_name WHERE TS<1554984068000;

To avoid the uncertainties brought by using string time formats, you can also directly use Unix Timestamps. Additionally, you can use timestamp strings with time zones in SQL statements, such as RFC3339 formatted timestamp strings, 2013-04-12T15:52:01.123+08:00 or ISO-8601 formatted timestamp strings 2013-04-12T15:52:01.123+0800. The conversion of these two strings to Unix Timestamps is not affected by the system's local time zone.

  1. TDengine provides a special field type, nchar, for storing wide characters in non-ASCII encodings such as Chinese, Japanese, and Korean. Data written to the nchar field is uniformly encoded in UCS4-LE format and sent to the server. It is important to note that the correctness of the encoding is ensured by the client. Therefore, if users want to properly use the nchar field to store non-ASCII characters such as Chinese, Japanese, and Korean, they need to correctly set the client's encoding format.

The characters input by the client use the current default encoding format of the operating system, which is often UTF-8 on Linux/macOS systems, but may be GB18030 or GBK on some Chinese systems. The default encoding in a Docker environment is POSIX. In Chinese version Windows systems, the encoding is CP936. The client needs to ensure the correct setting of the character set they are using, i.e., the current encoding character set of the operating system on which the client is running, to ensure that the data in nchar is correctly converted to UCS4-LE encoding format.

In Linux/macOS, the naming rule for locale is: <language>_<region>.<character set encoding> such as: zh_CN.UTF-8, where zh represents Chinese, CN represents mainland China, and UTF-8 represents the character set. The character set encoding provides instructions for the client to correctly parse local strings. Linux/macOS can set the system's character encoding by setting the locale, but since Windows uses a locale format that is not POSIX standard, another configuration parameter charset is used to specify the character encoding in Windows. Charset can also be used in Linux/macOS to specify the character encoding.

  1. If charset is not set in the configuration file, in Linux/macOS, taos automatically reads the current locale information of the system at startup, and extracts the charset encoding format from the locale information. If it fails to automatically read the locale information, it attempts to read the charset configuration, and if reading the charset configuration also fails, it interrupts the startup process.

In Linux/macOS, the locale information includes character encoding information, so after correctly setting the locale in Linux/macOS, there is no need to set charset separately. For example:

locale zh_CN.UTF-8

In Windows systems, it is not possible to obtain the current encoding from the locale. If it is not possible to read the string encoding information from the configuration file, taos defaults to setting the character encoding to CP936. This is equivalent to adding the following configuration in the configuration file:

charset CP936

If you need to adjust the character encoding, please consult the encoding used by the current operating system and set it correctly in the configuration file.

In Linux/macOS, if the user sets both locale and charset encoding, and if the locale and charset are inconsistent, the latter setting will override the earlier one.

locale zh_CN.UTF-8
charset GBK

Then the effective value of charset is GBK.

charset GBK
locale zh_CN.UTF-8

The effective value of charset is UTF-8.

Parameter NameSupported VersionDescription
dataDirDirectory for data files, all data files are written to this directory, default value /var/lib/taos
tempDirSpecifies the directory for generating temporary files during system operation, default value /tmp
minimalDataDirGBMinimum space to be reserved in the time-series data storage directory specified by dataDir, in GB, default value 2
minimalTmpDirGBMinimum space to be reserved in the temporary file directory specified by tempDir, in GB, default value 1
minDiskFreeSizeAfter 3.1.1.0When the available space on a disk is less than or equal to this threshold, the disk will no longer be selected for generating new data files, unit is bytes, range 52428800-1073741824, default value 52428800; Enterprise parameter
s3MigrateIntervalSecAfter 3.3.4.3Trigger cycle for automatic upload of local data files to S3, in seconds. Minimum: 600; Maximum: 100000. Default value 3600; Enterprise parameter
s3MigrateEnabledAfter 3.3.4.3Whether to automatically perform S3 migration, default value is 0, which means auto S3 migration is off, can be set to 1; Enterprise parameter
s3AccesskeyAfter 3.3.4.3Colon-separated user SecretId:SecretKey, for example AKIDsQmwsfKxTo2A6nGVXZN0UlofKn6JRRSJ:lIdoy99ygEacU7iHfogaN2Xq0yumSm1E; Enterprise parameter
s3EndpointAfter 3.3.4.3COS service domain name in the user's region, supports http and https, the region of the bucket must match the endpoint, otherwise it cannot be accessed; Enterprise parameter
s3BucketNameAfter 3.3.4.3Bucket name, followed by a hyphen and the AppId of the user registered COS service, where AppId is unique to COS, not present in AWS and Alibaba Cloud, needs to be part of the bucket name, separated by a hyphen; parameter values are string type, but do not need quotes; for example test0711-1309024725; Enterprise parameter
s3PageCacheSizeAfter 3.3.4.3Number of S3 page cache pages, range 4-1048576, unit is pages, default value 4096; Enterprise parameter
s3UploadDelaySecAfter 3.3.4.3How long a data file remains unchanged before being uploaded to S3, range 1-2592000 (30 days), in seconds, default value 60; Enterprise parameter
cacheLazyLoadThresholdInternal parameter, cache loading strategy
Parameter NameSupported VersionDescription
supportVnodesMaximum number of vnodes supported by a dnode, range 0-4096, default value is twice the number of CPU cores + 5
numOfCommitThreadsMaximum number of commit threads, range 0-1024, default value 4
numOfMnodeReadThreadsNumber of Read threads for mnode, range 0-1024, default value is one quarter of the CPU cores (not exceeding 4)
numOfVnodeQueryThreadsNumber of Query threads for vnode, range 0-1024, default value is twice the number of CPU cores (not exceeding 16)
numOfVnodeFetchThreadsNumber of Fetch threads for vnode, range 0-1024, default value is one quarter of the CPU cores (not exceeding 4)
numOfVnodeRsmaThreadsNumber of Rsma threads for vnode, range 0-1024, default value is one quarter of the CPU cores (not exceeding 4)
numOfQnodeQueryThreadsNumber of Query threads for qnode, range 0-1024, default value is twice the number of CPU cores (not exceeding 16)
numOfSnodeSharedThreadsNumber of shared threads for snode, range 0-1024, default value is one quarter of the CPU cores (not less than 2, not exceeding 4)
numOfSnodeUniqueThreadsNumber of exclusive threads for snode, range 0-1024, default value is one quarter of the CPU cores (not less than 2, not exceeding 4)
ratioOfVnodeStreamThreadsRatio of stream computing using vnode threads, range 0.01-4, default value 4
ttlUnitUnit for ttl parameter, range 1-31572500, in seconds, default value 86400
ttlPushIntervalFrequency of ttl timeout checks, range 1-100000, in seconds, default value 10
ttlChangeOnWriteWhether ttl expiration time changes with table modification; 0: no change, 1: change; default value 0
ttlBatchDropNumNumber of subtables deleted in a batch for ttl, minimum value 0, default value 10000
retentionSpeedLimitMBSpeed limit for data migration across different levels of disks, range 0-1024, in MB, default value 0, which means no limit
maxTsmaNumMaximum number of TSMAs that can be created in the cluster; range 0-3; default value 3
tmqMaxTopicNumMaximum number of topics that can be established for subscription; range 1-10000; default value 20
tmqRowSizeMaximum number of records in a subscription data block, range 1-1000000, default value 4096
auditAudit feature switch; Enterprise parameter
auditIntervalTime interval for reporting audit data; Enterprise parameter
auditCreateTableWhether to enable audit feature for creating subtables; Enterprise parameter
encryptAlgorithmData encryption algorithm; Enterprise parameter
encryptScopeEncryption scope; Enterprise parameter
enableWhiteListSwitch for whitelist feature; Enterprise parameter
syncLogBufferMemoryAllowedMaximum memory allowed for sync log cache messages for a dnode, in bytes, range 104857600-INT64_MAX, default value is 1/10 of server memory, effective from versions 3.1.3.2/3.3.2.13
syncElectIntervalInternal parameter, for debugging synchronization module
syncHeartbeatIntervalInternal parameter, for debugging synchronization module
syncHeartbeatTimeoutInternal parameter, for debugging synchronization module
syncSnapReplMaxWaitNInternal parameter, for debugging synchronization module
syncSnapReplMaxWaitNInternal parameter, for debugging synchronization module
arbHeartBeatIntervalSecInternal parameter, for debugging synchronization module
arbCheckSyncIntervalSecInternal parameter, for debugging synchronization module
arbSetAssignedTimeoutSecInternal parameter, for debugging synchronization module
mndSdbWriteDeltaInternal parameter, for debugging mnode module
mndLogRetentionInternal parameter, for debugging mnode module
skipGrantInternal parameter, for authorization checks
trimVDbIntervalSecInternal parameter, for deleting expired data
ttlFlushThresholdInternal parameter, frequency of ttl timer
compactPullupIntervalInternal parameter, frequency of data reorganization timer
walFsyncDataSizeLimitInternal parameter, threshold for WAL to perform FSYNC
transPullupIntervalInternal parameter, retry interval for mnode to execute transactions
mqRebalanceIntervalInternal parameter, interval for consumer rebalancing
uptimeIntervalInternal parameter, for recording system uptime
timeseriesThresholdInternal parameter, for usage statistics
udfWhether to start UDF service; 0: do not start, 1: start; default value 0
udfdResFuncsInternal parameter, for setting UDF result sets
udfdLdLibPathInternal parameter, indicates the library path for loading UDF

Stream Computing Parameters

Parameter NameSupported VersionDescription
disableStreamSwitch to enable or disable stream computing
streamBufferSizeControls the size of the window state cache in memory, default value is 128MB
streamAggCntInternal parameter, number of concurrent aggregation computations
checkpointIntervalInternal parameter, checkpoint synchronization interval
concurrentCheckpointInternal parameter, whether to check checkpoints concurrently
maxStreamBackendCacheInternal parameter, maximum cache used by stream computing
streamSinkDataRateInternal parameter, used to control the write speed of stream computing results
Parameter NameSupported VersionDescription
logDirLog file directory, operational logs will be written to this directory, default value /var/log/taos
minimalLogDirGBStops writing logs when the available space on the disk where the log folder is located is less than this value, unit GB, default value 1
numOfLogLinesMaximum number of lines allowed in a single log file, default value 10,000,000
asyncLogLog writing mode, 0: synchronous, 1: asynchronous, default value 1
logKeepDaysMaximum retention time for log files, unit: days, default value 0, which means unlimited retention, log files will not be renamed, nor will new log files be rolled out, but the content of the log files may continue to roll depending on the log file size setting; when set to a value greater than 0, when the log file size reaches the set limit, it will be renamed to taosdlog.yyy, where yyy is the timestamp of the last modification of the log file, and a new log file will be rolled out
slowLogThreshold3.3.3.0 onwardsSlow query threshold, queries taking longer than or equal to this threshold are considered slow, unit seconds, default value 3
slowLogMaxLen3.3.3.0 onwardsMaximum length of slow query logs, range 1-16384, default value 4096
slowLogScope3.3.3.0 onwardsType of slow query records, range ALL/QUERY/INSERT/OTHERS/NONE, default value QUERY
slowLogExceptDb3.3.3.0 onwardsSpecifies the database that does not report slow queries, only supports configuring one database
debugFlagLog switch for running logs, 131 (outputs error and warning logs), 135 (outputs error, warning, and debug logs), 143 (outputs error, warning, debug, and trace logs); default value 131 or 135 (depending on the module)
tmrDebugFlagLog switch for the timer module, range as above
uDebugFlagLog switch for the utility module, range as above
rpcDebugFlagLog switch for the rpc module, range as above
qDebugFlagLog switch for the query module, range as above
dDebugFlagLog switch for the dnode module, range as above
vDebugFlagLog switch for the vnode module, range as above
mDebugFlagLog switch for the mnode module, range as above
azDebugFlag3.3.4.3 onwardsLog switch for the S3 module, range as above
sDebugFlagLog switch for the sync module, range as above
tsdbDebugFlagLog switch for the tsdb module, range as above
tqDebugFlagLog switch for the tq module, range as above
fsDebugFlagLog switch for the fs module, range as above
udfDebugFlagLog switch for the udf module, range as above
smaDebugFlagLog switch for the sma module, range as above
idxDebugFlagLog switch for the index module, range as above
tdbDebugFlagLog switch for the tdb module, range as above
metaDebugFlagLog switch for the meta module, range as above
stDebugFlagLog switch for the stream module, range as above
sndDebugFlagLog switch for the snode module, range as above
Parameter NameSupported VersionDescription
enableCoreFileWhether to generate a core file when crashing, 0: do not generate, 1: generate; default value is 1
configDirDirectory where the configuration files are located
scriptDirDirectory for internal test tool scripts
assertAssertion control switch, default value is 0
randErrorChanceInternal parameter, used for random failure testing
randErrorDivisorInternal parameter, used for random failure testing
randErrorScopeInternal parameter, used for random failure testing
safetyCheckLevelInternal parameter, used for random failure testing
experimentalInternal parameter, used for some experimental features
simdEnableAfter 3.3.4.3Internal parameter, used for testing SIMD acceleration
AVX512EnableAfter 3.3.4.3Internal parameter, used for testing AVX512 acceleration
rsyncPortInternal parameter, used for debugging stream computing
snodeAddressInternal parameter, used for debugging stream computing
checkpointBackupDirInternal parameter, used for restoring snode data
enableAuditDeleteInternal parameter, used for testing audit functions
slowLogThresholdTestInternal parameter, used for testing slow logs

Compression Parameters

Parameter NameSupported VersionDescription
fPrecisionSets the compression precision for float type floating numbers, range 0.1 ~ 0.00000001, default value 0.00000001, floating numbers smaller than this value will have their mantissa truncated
dPrecisionSets the compression precision for double type floating numbers, range 0.1 ~ 0.0000000000000001, default value 0.0000000000000001, floating numbers smaller than this value will have their mantissa truncated
lossyColumnBefore 3.3.0.0Enables TSZ lossy compression for float and/or double types; range float/double/none; default value none, indicating lossless compression is off
ifAdtFseWhen TSZ lossy compression is enabled, use the FSE algorithm instead of the HUFFMAN algorithm, FSE algorithm is faster in compression but slightly slower in decompression, choose this for faster compression speed; 0: off, 1: on; default value is 0
maxRangeInternal parameter, used for setting lossy compression
curRangeInternal parameter, used for setting lossy compression
compressorInternal parameter, used for setting lossy compression

Additional Notes

  1. Effective in versions 3.2.0.0 ~ 3.3.0.0 (not inclusive), enabling this parameter will prevent rollback to the version before the upgrade
  2. TSZ compression algorithm is completed through data prediction technology, thus it is more suitable for data with regular changes
  3. TSZ compression time will be longer, if your server CPU is mostly idle and storage space is small, it is suitable to choose this
  4. Example: Enable lossy compression for both float and double types
lossyColumns     float|double
  1. Configuration requires service restart to take effect, if you see the following content in the taosd log after restarting, it indicates that the configuration has taken effect:
   02/22 10:49:27.607990 00002933 UTL  lossyColumns     float|double

taosd Monitoring Metrics

taosd reports monitoring metrics to taosKeeper, which are written into the monitoring database by taosKeeper, default is log database, which can be modified in the taoskeeper configuration file. Below is a detailed introduction to these monitoring metrics.

taosd_cluster_basic Table

taosd_cluster_basic table records basic cluster information.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
first_epVARCHARcluster first ep
first_ep_dnode_idINTdnode id of cluster first ep
cluster_versionVARCHARtdengine version. e.g.: 3.0.4.0
cluster_idVARCHARtagcluster id

taosd_cluster_info table

taosd_cluster_info table records cluster information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
cluster_uptimeDOUBLEuptime of the current master node. Unit: seconds
dbs_totalDOUBLEtotal number of databases
tbs_totalDOUBLEtotal number of tables in the current cluster
stbs_totalDOUBLEtotal number of stables in the current cluster
dnodes_totalDOUBLEtotal number of dnodes in the current cluster
dnodes_aliveDOUBLEtotal number of alive dnodes in the current cluster
mnodes_totalDOUBLEtotal number of mnodes in the current cluster
mnodes_aliveDOUBLEtotal number of alive mnodes in the current cluster
vgroups_totalDOUBLEtotal number of vgroups in the current cluster
vgroups_aliveDOUBLEtotal number of alive vgroups in the current cluster
vnodes_totalDOUBLEtotal number of vnodes in the current cluster
vnodes_aliveDOUBLEtotal number of alive vnodes in the current cluster
connections_totalDOUBLEtotal number of connections in the current cluster
topics_totalDOUBLEtotal number of topics in the current cluster
streams_totalDOUBLEtotal number of streams in the current cluster
grants_expire_timeDOUBLEauthentication expiration time, valid in enterprise edition, maximum DOUBLE value in community edition
grants_timeseries_usedDOUBLEnumber of used timeseries
grants_timeseries_totalDOUBLEtotal number of timeseries, maximum DOUBLE value in open source version
cluster_idVARCHARtagcluster id

taosd_vgroups_info Table

taosd_vgroups_info table records virtual node group information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
tables_numDOUBLENumber of tables in vgroup
statusDOUBLEvgroup status, range: unsynced = 0, ready = 1
vgroup_idVARCHARtagvgroup id
database_nameVARCHARtagName of the database the vgroup belongs to
cluster_idVARCHARtagcluster id

taosd_dnodes_info Table

taosd_dnodes_info records dnode information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
uptimeDOUBLEdnode uptime, unit: seconds
cpu_engineDOUBLEtaosd CPU usage, read from /proc/<taosd_pid>/stat
cpu_systemDOUBLEServer CPU usage, read from /proc/stat
cpu_coresDOUBLENumber of server CPU cores
mem_engineDOUBLEtaosd memory usage, read from /proc/<taosd_pid>/status
mem_freeDOUBLEServer free memory, unit: KB
mem_totalDOUBLETotal server memory, unit: KB
disk_usedDOUBLEDisk usage of data dir mount, unit: bytes
disk_totalDOUBLETotal disk capacity of data dir mount, unit: bytes
system_net_inDOUBLENetwork throughput, received bytes read from /proc/net/dev. Unit: byte/s
system_net_outDOUBLENetwork throughput, transmit bytes read from /proc/net/dev. Unit: byte/s
io_readDOUBLEIO throughput, speed calculated from rchar read from /proc/<taosd_pid>/io since last value. Unit: byte/s
io_writeDOUBLEIO throughput, speed calculated from wchar read from /proc/<taosd_pid>/io since last value. Unit: byte/s
io_read_diskDOUBLEDisk IO throughput, read_bytes read from /proc/<taosd_pid>/io. Unit: byte/s
io_write_diskDOUBLEDisk IO throughput, write_bytes read from /proc/<taosd_pid>/io. Unit: byte/s
vnodes_numDOUBLENumber of vnodes on dnode
mastersDOUBLENumber of master nodes on dnode
has_mnodeDOUBLEWhether dnode contains mnode, range: contains=1, does not contain=0
has_qnodeDOUBLEWhether dnode contains qnode, range: contains=1, does not contain=0
has_snodeDOUBLEWhether dnode contains snode, range: contains=1, does not contain=0
has_bnodeDOUBLEWhether dnode contains bnode, range: contains=1, does not contain=0
error_log_countDOUBLETotal number of error logs
info_log_countDOUBLETotal number of info logs
debug_log_countDOUBLETotal number of debug logs
trace_log_countDOUBLETotal number of trace logs
dnode_idVARCHARtagdnode id
dnode_epVARCHARtagdnode endpoint
cluster_idVARCHARtagcluster id

taosd_dnodes_status table

The taosd_dnodes_status table records dnode status information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
statusDOUBLEdnode status, value range ready=1, offline=0
dnode_idVARCHARtagdnode id
dnode_epVARCHARtagdnode endpoint
cluster_idVARCHARtagcluster id

taosd_dnodes_log_dir table

The taosd_dnodes_log_dir table records log directory information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
availDOUBLEavailable space in log directory. Unit: byte
usedDOUBLEused space in log directory. Unit: byte
totalDOUBLEspace in log directory. Unit: byte
nameVARCHARtaglog directory name, usually /var/log/taos/
dnode_idVARCHARtagdnode id
dnode_epVARCHARtagdnode endpoint
cluster_idVARCHARtagcluster id

taosd_dnodes_data_dir table

The taosd_dnodes_data_dir table records data directory information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
availDOUBLEavailable space in data directory. Unit: byte
usedDOUBLEused space in data directory. Unit: byte
totalDOUBLEspace in data directory. Unit: byte
levelVARCHARtagmulti-level storage levels 0, 1, 2
nameVARCHARtagdata directory, usually /var/lib/taos
dnode_idVARCHARtagdnode id
dnode_epVARCHARtagdnode endpoint
cluster_idVARCHARtagcluster id

taosd_mnodes_info table

The taosd_mnodes_info table records mnode role information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
roleDOUBLEmnode role, value range offline = 0, follower = 100, candidate = 101, leader = 102, error = 103, learner = 104
mnode_idVARCHARtagmaster node id
mnode_epVARCHARtagmaster node endpoint
cluster_idVARCHARtagcluster id

taosd_vnodes_role table

The taosd_vnodes_role table records virtual node role information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
vnode_roleDOUBLEvnode role, value range offline = 0, follower = 100, candidate = 101, leader = 102, error = 103, learner = 104
vgroup_idVARCHARtagdnode id
dnode_idVARCHARtagdnode id
database_nameVARCHARtagvgroup's belonging database name
cluster_idVARCHARtagcluster id

taosd_sql_req Table

taosd_sql_req records server-side SQL request information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
countDOUBLEnumber of SQL queries
resultVARCHARtagSQL execution result, values range: Success, Failed
usernameVARCHARtaguser name executing the SQL
sql_typeVARCHARtagSQL type, value range: inserted_rows
dnode_idVARCHARtagdnode id
dnode_epVARCHARtagdnode endpoint
vgroup_idVARCHARtagdnode id
cluster_idVARCHARtagcluster id

taos_sql_req Table

taos_sql_req records client-side SQL request information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
countDOUBLEnumber of SQL queries
resultVARCHARtagSQL execution result, values range: Success, Failed
usernameVARCHARtaguser name executing the SQL
sql_typeVARCHARtagSQL type, value range: select, insert, delete
cluster_idVARCHARtagcluster id

taos_slow_sql Table

taos_slow_sql records client-side slow query information.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
countDOUBLEnumber of SQL queries
resultVARCHARtagSQL execution result, values range: Success, Failed
usernameVARCHARtaguser name executing the SQL
durationVARCHARtagSQL execution duration, value range: 3-10s, 10-100s, 100-1000s, 1000s-
cluster_idVARCHARtagcluster id

TDengine records the system's operational status through log files, helping users monitor the system's condition and troubleshoot issues. This section mainly introduces the related explanations of two system logs: taosc and taosd.

TDengine's log files mainly include two types: normal logs and slow logs.

  1. Normal Log Behavior Explanation
    1. Multiple client processes can be started on the same machine, so the client log naming convention is taoslogX.Y, where X is a number, either empty or from 0 to 9, and Y is a suffix, either 0 or 1.

    2. Only one server process can exist on the same machine. Therefore, the server log naming convention is taosdlog.Y, where Y is a suffix, either 0 or 1.

      The rules for determining the number and suffix are as follows (assuming the log path is /var/log/taos/):

      1. Determining the number: Use 10 numbers as the log naming convention, /var/log/taos/taoslog0.Y - /var/log/taos/taoslog9.Y, check each number sequentially to find the first unused number as the log file number for that process. If all 10 numbers are used by processes, do not use a number, i.e., /var/log/taos/taoslog.Y, and all processes write to the same file (number is empty).
      2. Determining the suffix: 0 or 1. For example, if the number is determined to be 3, the alternative log file names would be /var/log/taos/taoslog3.0 /var/log/taos/taoslog3.1. If both files do not exist, use suffix 0; if one exists and the other does not, use the existing suffix. If both exist, use the suffix of the file that was modified most recently.
    3. If the log file exceeds the configured number of lines numOfLogLines, it will switch suffixes and continue logging, e.g., /var/log/taos/taoslog3.0 is full, switch to /var/log/taos/taoslog3.1 to continue logging. /var/log/taos/taoslog3.0 will be renamed with a timestamp suffix and compressed for storage (handled by an asynchronous thread).

    4. Control how many days log files are kept through the configuration logKeepDays, logs older than a certain number of days will be deleted when new logs are compressed and stored. It is not based on natural days.

In addition to recording normal logs, SQL statements that take longer than the configured time will be recorded in the slow logs. Slow log files are mainly used for analyzing system performance and troubleshooting performance issues.

  1. Slow Log Behavior Explanation
    1. Slow logs are recorded both locally in slow log files and sent to taosKeeper for structured storage via taosAdapter (monitor switch must be turned on).
    2. Slow log file storage rules are:
      1. One slow log file per day; if there are no slow logs for the day, there is no file for that day.
      2. The file name is taosSlowLog.yyyy-mm-dd (taosSlowLog.2024-08-02), and the log storage path is configured through logDir.
      3. Logs from multiple clients are stored in the same taosSlowLog.yyyy.mm.dd file under the respective log path.
      4. Slow log files are not automatically deleted or compressed.
      5. Uses the same three parameters as normal log files: logDir, minimalLogDirGB, asyncLog. The other two parameters, numOfLogLines and logKeepDays, do not apply to slow logs.