Use following to list all data nodes in cluster (no matter alive or dead):
influxd-ctl -s ip:port node list
Where ip:port
is any TCP address of alive node in this cluster.
Sample output as:
Nodes:
4 http://:8092 tcp://127.0.0.1:8082
5 http://:8093 tcp://127.0.0.1:8083
6 http://:8094 tcp://127.0.0.1:8084
7 http://:8095 tcp://127.0.0.1:8085
8 http://:8096 tcp://127.0.0.1:8086
9 http://:8091 tcp://127.0.0.1:8081
15 http://:8097 tcp://127.0.0.1:8087
Use following to list all available shards (only id) on specific node:
influxd-ctl -s ip:addr shard node <node-id>
Output:
Shards on node 15:
[513 549 556 575 578 580 582 585 593 594]
influxd-ctl -s ip:port shard list <database> <retention policy>
influxd-ctl -s ip:port shard info <shard id>
Output:
Shard: 594
Database: _internal
Retention Policy: monitor
Nodes: [15]
Feel free to restart any node if you have handoff hinted(hh) service enabled on every other node. New replicated data blocked will be cached and retry to replicate when the node was back online. Any failed query sent to this node will be retried to other replicas.
Adding operation is simple. Configure it and start it then it will appear in node list.
- Remove it from configuration through
influxd-ctl node remove
- Stop the instance
Replacement is more complicated. For instance we call the instance to be replaced
as A
and the new one as B
.
- Add B into cluster
- Freeze both A and B through
influxd-ctl node freeze
- Truncate shards and wait a while to make sure no further writes on A and B
- Get all shards through
influxd-ctl shard node
- Copy them from A to B through
influxd-ctl shard copy
- Progress can be checked through
influxd-ctl shard status
- Better to verify the actual data directories are copied correctly
- Remove A from cluster
- Unfreeze B to let it accept creation of new shards