如何启动 Arango 3.1.8 集群,其中节点使用 arangod.conf 文件充当多个角色

问题描述 投票:0回答:1

我已经配置了三个虚拟机(通过 Azure),全部运行 Ubuntu 16.04。每个虚拟机都运行 ArangoDB 3.1.8。

虽然我可以让单台机器成功运行 Arango 并访问 UI,但我似乎无法使用 /etc/arangodb3 下的 arangod.conf 文件正确地对它们进行集群。

理想情况下,我希望在每台计算机上运行所有三个角色:代理、协调员和主要角色。虽然从命令行运行时这似乎是可能的(抱歉,来自 Windows 背景)如何使用配置文件来完成此操作?

到目前为止,我的 arangod.conf 中有这个:

[database]
directory = /var/lib/arangodb3

# maximal-journal-size = 33554432

[server]
endpoint = tcp://[::]:8529
endpoint = tcp://[::]:5001

authentication = true

# gather server statistics
statistics = true

uid = arangodb


[javascript]
startup-directory = usr/share/arangodb3/js
app-path = /var/lib/arangodb3-apps

[log]
level = info
file = /var/log/arangodb3/arangod.log

[agency]
id = 0
size = 3
supervision = true
activate = true

[cluster]
my-address = tcp://full_dn_to_server1:8529
my-local-info = myarango1

my-role = COORDINATOR; PRIMARY

agency-endpoint = tcp://full_dn_to_server1:5001
agency-endpoint = tcp://full_dn_to_server2:5001
agency-endpoint = tcp://full_dn_to_server3:5001

然后我计划在所有三台服务器上使用此文件,并对 cluster.my-* 和 Agency.id 属性进行更改。

我已查看以下链接寻求帮助: https://github.com/arangodb/arangodb/blob/b7cc85349c132f2ec7020dcddbd53e5bcfe12895/Documentation/Books/Manual/Deployment/Distributed.md https://raw.githubusercontent.com/ArangoDB/deployment/publish/Azure_ArangoDB_Cluster.sh

arangodb
1个回答
3
投票

您需要每个节点的配置文件。每个人都有个性。即agent.conf、dbserver.conf 和coordinator.conf。每个都需要有自己的端点。因此,上面的内容是所有三台机器上仅具有端点 5001 的 Agency.conf。 现在您仍然需要 coordinator.conf 和 dbserver.conf。 下面的 3.1 部署文档包含所有 3 种 arangod 实例以及必要的命令行参数: https://github.com/arangodb/arangodb/blob/b7cc85349c132f2ec7020dcddbd53e5bcfe12895/Documentation/Books/Manual/Deployment/Distributed.md 本质上,您需要将任何

--<domain>.<parameter> <value>
参数转换为各个conf 文件中的节条目。 所以
--agency.activate true --agency.endpoint tcp://some-host:port --agency.size
会变成

[agency]
size = 3
endpoint = tcp://some-host:port
activate = true

所以让我们从文档中获取协调器命令行:

arangod --server.authentication=false --server.endpoint tcp://0.0.0.0:8531 --cluster.my-address tcp://192.168.1.3:8531 --cluster.my-local-info coord1 --cluster.my-role COORDINATOR --cluster.agency-endpoint tcp://192.168.1.1:5001 --cluster.agency-endpoint tcp://192.168.1.2:5001 --cluster.agency-endpoint tcp://192.168.1.3:5001 --database.directory coordinator 

这会变成

[server]
authentication = false
endpoint = tcp://0.0.0.0:8531

[cluster]
my-address = tcp://192.168.1.3:8531
my-local-info = coord1
my-role = COORDINATOR
agency-endpoint = tcp://192.168.1.1:5001
agency-endpoint = tcp://192.168.1.2:5001
agency-endpoint = tcp://192.168.1.3:5001

[database]
directory coordinator

等等。您需要在每台机器上启动 3 个 arangod 进程,每个进程都具有预期的配置文件。即

arangod -c /etc/arangodb3/agent.conf
arangod -c /etc/arangodb3/coordinator.conf
arangod -c /etc/arangodb3/dbserver.conf

此外,您可能最后但并非最不重要的是要考虑看看 Max Neunhöfer 的 arangodb starter,网址为 https://github.com/neunhoef/ArangoDBStarter

© www.soinside.com 2019 - 2024. All rights reserved.