Setting up sharded orientdb

I am trying to configure on 3 servers. For example, I'm trying to set up the client class with 3 clusters client_1, client_2, and client_3. My servers are called node1, node2 and node3. I want the clusters to be located so that I have 2 instances of each cluster, so if 1 node falls, I still have access to all the data, so for Example:

  • node1 is master for client_1 and has a copy of client_2.
  • node2 is the master for client_2 and has a copy of client_3.
  • node3 is the master for client_3 and has a copy of client_1.

I tried to configure this as follows: 1. Download the OrientDB 2.1.1 community and extract it to 3 servers. 2. Remove the GratefulDeadConcerts database from the database directory on each server. 3. Change default-distribution-db-config.json to node1 as follows:

{
"autoDeploy": true,
"hotAlignment": false,
"executionMode": "undefined",
"readQuorum": 1,
"writeQuorum": 2,
"failureAvailableNodesLessQuorum": false,
"readYourWrites": true,
"clusters": {
"internal": {
},
"index": {
},
"client_1": {
"servers" : [ "node1","node2" ]
},
"client_2": {
"servers" : [ "node2","node3" ]
},
"client_3": {
"servers" : [ "node3","node1" ]
},
"*": {
"servers" : [ "<NEW_NODE>" ]
}
}
}
  1. Start node1 using dserver.sh.
  2. Create a database using the console on node1: connect remote: password root localhost create a remote database file: localhost / testdb. Schedule for entering root password.
  3. Create a class and rename the default cluster: create class client client v change client client name client_1
  4. Startup node2 with dserver.sh, wait until the database is automatically deployed, then startup node3 and wait for deployment

At this moment, I have a database on 3 nodes with the class "client", with one cluster "client_1".

  1. 2 client_2: alter class client addcluster client_2
  2. , 3: alter class client addcluster client_3

" ", 3 node. .cpm .pcl 3 node. default-distrib-db-config.json , node , , node ( , , ).

... , , , , , , 3 ctrl-c. ( 3, ) 1, 2 - .

distirbuted-db.json node1 node2, , "" - node3 :

"client_3": { "servers": [ "node1" ], "@version": 0, "@type": "d" },
"client_2": { "servers": [ "node2" ], "@version": 0, "@type": "d" },
"client_1": { "servers": [ "node1", "node2" ], "@version": 0,
"@type": "d" }

3. :

"client_3": { "servers": [ "node1" ], "@version": 0,
"@type": "d" },
"client_2": { "servers": [ "node2" ], "@version": 0, "@type": "d" },
"client_1": { "servers": [ "node1", "node2" ], "@version": 0,
"@type": "d" }

- , / ?

+4
1

, , hotAlignment "true" "default-distribution-db-config.json". OrientDB 2.2.x sharding doc, " hotAlignment = false, node ( ), node ." , 2.1.x 2.2.x: " hotAlignment: , , , ."

0

Source: https://habr.com/ru/post/1605893/


All Articles