删除Arangodb群集节点

6ie5vjzr  于 2022-12-09  发布在  Go
关注(0)|答案(3)|浏览(209)

你好,我在Ubuntu 16.04版本上使用arangodb版本3.1.18我已经通过使用ArangoDbStarter使用Docker在两个节点上创建了arangodb集群,现在我的问题是,我如何才能从集群中删除节点?删除后,我如何才能知道节点是否被删除,它是否显示在Web界面上?请请求给予我一个解决方案。

1l5u6lss

1l5u6lss1#

对于Centos 6,
当您运行下面的命令时,您将获得失效协调程序的SERVER_ID。
curl --转储-http://co-ordinator-ip:8529/_db/_system/_admin/cluster/health
然后执行以下命令删除协调程序。
curl --转储-http://co-ordinator-ip:8529/_admin/cluster/removeServer-d '“服务器标识”'
这对我很有效。

iezvtpos

iezvtpos2#

协调器启动后可以运行简单循环:
for failed_id in $(curl http://coordinator:PORT/_db/_system/_admin/cluster/health | jq '.Health | to_entries[] | select (.value.CanBeDeleted==true) | select (.value.Status=="FAILED") | select (.value.Role=="Coordinator") | [.key] | .[]') ; do echo " deleting failed coordinator $failed_id" ; curl http://coordinator:PORT/_admin/cluster/removeServer -d ${failed_id} ; done
将删除重新启动后挂起的所有已删除的协调器节点

a9wyjsp7

a9wyjsp73#

To use ArangoDB clustering you need at least 3 nodes. Make sure that your service is not running already. Check this by executing sudo service arangodb status . If this is active, stop the service. On your fist node you can start it by executing the following command:
arangodb
or to start it as a backgroundprocess:
arangodb start
On your two other nodes execute the following command and make sure that arangodb service is also stopped:
arangodb --starter.join x.x.x.x:8528
or to start it as a backgroundprocess:
arangodb start --starter.join x.x.x.x:8528
where x.x.x.x is the Ip adres of your first node.
You can then access the dashboard by going to any or the 3 Ip addresses to port 8529. There you have a dashboard that will show you the status of your cluster.
To remove a node you can use the following command:
arangodb stop
If Arangodb was started as a backgroundprocess. If it was not like that juist kill the process. The Webui will now show the removed node in Red and pressing the trash can will remove it from the ui as well.

相关问题