Arangodb Cluster with 2 nodes

335 views
Skip to first unread message

kumbharr...@gmail.com

unread,
Jun 21, 2018, 12:05:03 PM6/21/18
to ArangoDB
Hi Team,

I want to create Arangodb cluster with 2 nodes ( 2 dbserver, 2 coordinator and 2 agents etc) .
and we want to automate this process using ansible script , but the challenge what i'm facing is that its creating independent arangodb node and they are not joining to each other 

ssh c11 "arangodb --starter.data-dir=db > db.log &"
ssh c12 "arangodb --starter.data-dir=db --starter.join c11:8528 > db.log &" 


could you please help here

om...@arangodb.com

unread,
Jun 22, 2018, 4:37:10 AM6/22/18
to ArangoDB
Hi,

It is impossible to deploy an ArangoDB Cluster with only 2 nodes, you need at least 3 nodes that each of them runs:
  • 1 Agent
  • 1 Coordinator
  • 1 DBserver 
(so you will have 3 Agents that form the Agency, 3 Coordinators and 3 DBservers)

You can easily deploy an ArangoDB Cluster using the Starter using the following commands

node1:  arangodb --starter.data-dir=db1 --starter.join your host address 
node2:  arangodb --starter.data-dir=db2 --starter.join your host address 
node3:  arangodb --starter.data-dir=db3 --starter.join your host address 

Please make sure to use a different directory for each node

You may find useful the following links:


Best,


kumbharr...@gmail.com

unread,
Jun 22, 2018, 7:00:10 AM6/22/18
to ArangoDB
Thanks Om for your reply , Now i want to automate this deployment using ansible script or shell script .
Challenge that i'm facing here is when i try to run these cmds in ansible script its not forming the cluster its just running independent arangodb. Join cluster is not happening through ansible.

Kindly help

sa...@arangodb.com

unread,
Jun 23, 2018, 8:56:02 AM6/23/18
to ArangoDB
Hi,

You can use ansible, or automate the deployment using scripts

If the cluster does not form, I would suggest to double check the values you are using for the option --starter.join

Assuming you have 3 machines, A, B and C, you can use a comma separated list of values for the --starter.join option, i.e. --starter.join=A,B,C

A,B and C can be IPs or host names

If you are using 3 different machines, obviously you can use the same directory name for the option --starter.data-dir . What Omar had in mind when he wrote to use a different directory (db1, db2 and db3) was a local test. When using asible you probably would like to have identical machines and commands. Assuming you are using a fast local SSD disk for your data directory (recommended) you can pass to the --starter.data-dir the mount point of this disk, e.g.

--starter.data-dir=/data

I would also strongly suggest to use the option to use RocksDB as engine: --server.storage-engine=rocksdb  

Useful option is also --log.dir=path-to-log-dir

So a possible command to be run on each machines to form the cluster could be similar to the following:

arangodb --starter.data-dir=path-to-data-dir --starter.join=A,B,C --server.storage-engine=rocksdb --log.dir=path-to-log-dir

Execute the above command on machines A,B and C

To automate with systemd, you might find some info on this link: https://github.com/arangodb-helper/arangodb/tree/master/examples/systemd

I suggest also to start authentication, but this can be a second step. First try if your cluster form. Then you can do an additional test where you enable authentication (start from scratch by removing the old test cluster). Info on authentication option: https://docs.arangodb.com/devel/Manual/Programs/Starter/Options.html#authentication-options

Please could you try a fresh start (delete old database directories) and see if it now works. If you can send us the errors you see, from the starter shell and the log files, that can help with understanding next step

Hope this helps,
Santo
Reply all
Reply to author
Forward
0 new messages