如果集群节点较少,一个node会同时负责meta和data,node上部署的进程同时具有meta和data的管理功能。
启动参数
对于3节点的InfluxDB集群,其启动参数:
//ops1节点
# influxd -config /etc/influxdb/influxdb.conf -join ops1:8091,ops2:8091,ops3:8091 --hostname ops1
//ops2节点
# influxd -config /etc/influxdb/influxdb.conf -join ops1:8091,ops2:8091,ops3:8091 --hostname ops2
//ops3节点
# influxd -config /etc/influxdb/influxdb.conf -join ops1:8091,ops2:8091,ops3:8091 --hostname ops3
启动完毕后,使用集群管理命令,可以查询当前集群的节点:
# influxd_ctl show-nodes
============Meta Nodes============
ID Host TCPHost
1 ops2:8091 ops2:8088
2 ops3:8091 ops3:8088
3 ops1:8091 ops1:8088
============Data Nodes============
ID Host TCPHost
可以看到,meta nodes均已被识别。
添加data nodes
在其中一个节点上执行:
# influxd_ctl add-data ops1:8088
# influxd_ctl add-data ops2:8088
# influxd_ctl add-data ops3:8088
再查询集群中当前节点:
# influxd_ctl show-nodes
============Meta Nodes============
ID Host TCPHost
1 ops2:8091 ops2:8088
2 ops3:8091 ops3:8088
3 ops1:8091 ops1:8088
============Data Nodes============
ID Host TCPHost
1 178.104.163.69:8086 ops2:8088
2 178.104.163.239:8086 ops3:8088
3 178.104.163.205:8086 ops1:8088
可以看到,data-nodes均已加入集群。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。