Skip to main content

Anode Management

Starting the TDgpt Service​

The taosanoded service is created when you install an anode. You can use systemd to manage this service:

systemctl start  taosanoded
systemctl stop taosanoded
systemctl status taosanoded

Starting a Time-Series Foundation Model​

Time-series foundation models require significant hardware resources. For this reason, they are not started automatically. To start a time-series foundation model manually, use the following procedure:

# Start TDtsfm
start-model tdtsfm

# Start Time-MoE
start-model timemoe
# Stop TDtsfm
stop-model tdtsfm

# Stop Time-MoE
stop-model timemoe

Directory and Configuration Information​

The directory structure of an anode is described in the following table:

Directory or FileDescription
/usr/local/taos/taosanode/binDirectory containing executable files
/usr/local/taos/taosanode/resourceDirectory containing resource files, linked to /var/lib/taos/taosanode/resource/
/usr/local/taos/taosanode/libDirectory containing libraries
/usr/local/taos/taosanode/modelDirectory containing models, linked to /var/lib/taos/taosanode/model
/var/log/taos/taosanode/Log directory
/etc/taos/taosanode.config.pyConfiguration file

Configuration​

Since v3.4.1.0, Linux Anodes use Gunicorn and read /etc/taos/taosanode.config.py. Earlier versions used uWSGI and taosanode.ini.

import multiprocessing

bind = '0.0.0.0:6035'
workers = 2
worker_class = 'sync'
threads = max(multiprocessing.cpu_count() // 4 + 1, 2)
max_requests = 1000
max_requests_jitter = 50
timeout = 1200
keepalive = 1200
accesslog = '/var/log/taos/taosanode/access.log'
errorlog = '/var/log/taos/taosanode/error.log'
loglevel = 'debug'
proc_name = 'tdgpt_taosanode_app'
preload_app = True

app_log = '/var/log/taos/taosanode/taosanode.app.log'
model_dir = '/usr/local/taos/taosanode/model/'
log_level = 'DEBUG'
draw_result = False

tdtsfm_1 = 'http://127.0.0.1:6061/tdtsfm'
timemoe_fc = 'http://127.0.0.1:6062/ds_predict'

For additional Gunicorn settings, see the Gunicorn documentation.

The main configuration options for an anode are described as follows:

  • app_log: Anode application log file.
  • model_dir: Directory in which models are stored.
  • log_level: Anode application log level. Valid values are DEBUG, INFO, CRITICAL, ERROR, and WARN; the default is DEBUG.

Managing Anodes​

You manage anodes through the TDengine CLI. The following actions must be performed within the CLI on a client that is connected to your TDengine cluster.

Create an Anode​

CREATE ANODE {node_url}

The node_url parameter determines the URL of the anode service. This information will be registered to your TDengine cluster. Do not register a single anode to multiple TDengine clusters.

URL format requirements

The URL must satisfy all of the following:

  • The scheme must be http:// or https://. Bare host:port strings and other schemes such as file:// or ftp:// are rejected.
  • By default, URLs that resolve to private or internal network addresses are allowed. To block them, set anodeAllowInternalUrl false in taos.cfg and restart taosd. Blocked ranges include loopback (127.0.0.0/8, ::1), link-local (169.254.0.0/16, fe80::/10), and RFC-1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).

Example:

CREATE ANODE 'http://192.168.1.50:6035'

Restricting Anode URLs to public addresses

In environments where the TDengine server should not connect to internal services (for example, multi-tenant or cloud deployments), set anodeAllowInternalUrl to false in taos.cfg and restart taosd:

anodeAllowInternalUrl false
ParameterScopeDefaultDescription
anodeAllowInternalUrltaosdtrueAllow CREATE ANODE with URLs that resolve to private or internal network addresses. Set to false to block loopback, link-local, and RFC-1918 addresses. Can be changed at runtime via ALTER ALL DNODES 'anodeAllowInternalUrl' '0'.

View Anodes​

You can run the following command to display the FQDN and status of the anodes in your cluster:

SHOW ANODES;

taos> show anodes;
id | url | status | create_time | update_time |
==================================================================================================================
1 | 192.168.0.1:6035 | ready | 2024-11-28 18:44:27.089 | 2024-11-28 18:44:27.089 |
Query OK, 1 row(s) in set (0.037205s)

View Advanced Analytics Services​

SHOW ANODES FULL;

taos> show anodes full;
id | type | algo |
============================================================================
1 | anomaly-detection | grubbs |
1 | anomaly-detection | lof |
1 | anomaly-detection | shesd |
1 | anomaly-detection | ksigma |
1 | anomaly-detection | iqr |
1 | anomaly-detection | sample_ad_model |
1 | forecast | arima |
1 | forecast | holtwinters |
1 | forecast | tdtsfm_1 |
1 | forecast | timemoe-fc |
Query OK, 10 row(s) in set (0.028750s)

The actual list depends on the models loaded by the Anode. Common built-in models include:

TypeNameDescription
Anomaly detectiongrubbsStatistical model
Anomaly detectionlofDensity-based model
Anomaly detectionshesdSeasonal ESD model
Anomaly detectionksigmaStatistical model
Anomaly detectioniqrStatistical model
ForecastingarimaAutoregressive moving average algorithm
ForecastingholtwintersExponential smoothing algorithm
Forecastingtdtsfm_1TDtsfm v1.0
Forecastingtimemoe-fcTime-MoE

These algorithms and models are described in detail in the relevant documentation.

Refresh the Algorithm Cache​

UPDATE ANODE {anode_id}
UPDATE ALL ANODES

Delete an Anode​

DROP ANODE {anode_id}

Deleting an anode only removes it from your TDengine cluster. To stop an anode, use systemctl on the machine where the anode is located. To remove an anode, run the rmtaosanode command on the machine where the anode is located.

Windows Service and Model Management​

Windows installations register the Taosanode service and provide scripts under C:\TDengine\taosanode\bin:

OperationCommand
Start Anodestart-taosanode.bat or net start Taosanode
Stop Anodestop-taosanode.bat or net stop Taosanode
Show Anode statusstatus-taosanode.bat or sc query Taosanode
Start one modelstart-model.bat tdtsfm
Stop one modelstop-model.bat tdtsfm
Show model statusstatus-model.bat

The Windows configuration file is C:\TDengine\taosanode\cfg\taosanode.config.py, and the service uses Waitress. Logs are stored in C:\TDengine\taosanode\log.