_collectd.mdx 2.7 KB
Newer Older
1
### Configuring taosAdapter
D
dingbo 已提交
2

3
To configure taosAdapter to receive collectd data.
D
dingbo 已提交
4

5
- Enable the configuration item in the taosAdapter configuration file (default location is /etc/taos/taosadapter.toml)
D
dingbo 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19

```
...
[opentsdb_telnet]
enable = true
maxTCPConnections = 250
tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049]
user = "root"
password = "taosdata"
...
```

20
The default database name written by taosAdapter is `collectd`. You can also modify the taosAdapter configuration file dbs entry to specify a different name. user and password are the values configured by the actual TDengine. After changing the configuration file, you need to restart the taosAdapter.
D
dingbo 已提交
21

22
- You can also enable the taosAdapter to receive collectd data by using the taosAdapter command-line parameters or by setting environment variables.
D
dingbo 已提交
23

24 25 26
### Configure collectd
#collectd
collectd uses a plugin mechanism to write the collected monitoring data to different data storage software in various forms. tdengine supports both direct collection plugins and write_tsdb plugins.
D
dingbo 已提交
27

28
#### is configured to receive data from the direct collection plugin
D
dingbo 已提交
29

30
Modify the relevant configuration items in the collectd configuration file (default location /etc/collectd/collectd.conf).
D
dingbo 已提交
31 32 33 34 35 36 37 38

```text
LoadPlugin network
<Plugin network>
         Server "<taosAdapter's host>" "<port for collectd direct>"
</Plugin>
```

39
where <taosAdapter's host\> fills in the server's domain name or IP address running taosAdapter. <port for collectd direct\> fills in the port that taosAdapter uses to receive collectd data (default is 6045).
D
dingbo 已提交
40

41
An example is as follows.
D
dingbo 已提交
42 43 44

```text
LoadPlugin network
45
<Plugin network
D
dingbo 已提交
46 47 48 49
         Server "127.0.0.1" "6045"
</Plugin>
```

50
#### Configure write_tsdb plugin data
D
dingbo 已提交
51

52
Modify the relevant configuration items in the collectd configuration file (default location /etc/collectd/collectd.conf).
D
dingbo 已提交
53 54 55 56 57 58 59 60 61 62 63 64

```text
LoadPlugin write_tsdb
<Plugin write_tsdb>
        <Node>
                Host "<taosAdapter's host>"
                Port "<port for collectd write_tsdb plugin>"
                ...
        </Node>
</Plugin>
```

65
Where <taosAdapter's host\> fills in the server's domain name or IP address running taosAdapter. <port for collectd write_tsdb plugin\> Fill in the data that taosAdapter uses to receive the collectd write_tsdb plugin (default is 6047).
D
dingbo 已提交
66 67 68 69 70 71 72 73 74 75

```text
LoadPlugin write_tsdb
<Plugin write_tsdb>
        <Node>
                Host "127.0.0.1"
                Port "6047"
                HostTags "status=production"
                StoreRates false
                AlwaysAppendDS false
76
        </Node
D
dingbo 已提交
77 78 79
</Plugin>
```

80
Then restart collectd.
D
dingbo 已提交
81 82 83 84

```
systemctl restart collectd
```