Java – set the orientdb of the shard

I'm trying to set up on 3 servers For example, I am

>Node1 is a client_ 1 and has a client_ Copy of 2. > Node2 is a client_ 2 and has a client_ Copy of 3. > Node3 is a client_ 3 and has a client_ Copy of 1

I have tried to set it up through the following steps: 1 Download orientdb 2.1 1 community and unzip it to 3 servers 2. Delete each server of the gracefuldeadconcerns database from the database directory 3. Edit default distributed DB config. On node1 JSON, 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>" ]
}
}
}

>Using dserver SH start node1. > Use the console on node1 to create a database: connect remote: localhost root password create database remote: localhost / testdb root password plot graph > create a class and rename the default cluster: create class Client extensions V alter cluster client name client_ 1 > use dserver SH starts node2 and waits for the database to deploy automatically, then starts node3 and waits for deployment

At this time, I have a database on three nodes, in which a class named "client" has only one cluster "client_1"

>On node2, add the client_ 2. Cluster: alter class client addcluster client_ 2 > similarly, on node3: alter class client addcluster client_ three

If I reconnect all console sessions and execute "List cluster", I now see all three client class clusters on each node I saw it, too CPM and the of each of the three clusters on each node PCL file However, it appears that my intention is default distributed DB config JSON is being adopted as if I waited a few minutes and then inserted each record node. I see that the timestamp and file size only change the file, which is related to the cluster that should exist on each node (if the file does not exist in the error, it will be good and less confusing nodes, but it is not the end of the world)

So... Now it seems that my database settings are the same as I expected, but the purpose of this is to enable us to survive when the server is down, so I use ctrl-c to turn off node3 I can still see each record (I've inserted three from node1 and node2, one for each cluster - so far everything's going well

If I look at distirbuted dB on node1 or node2 JSON, I now see that my "client" class cluster has been reconfigured - node3 in the configuration is no longer:

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

Now I restart node3 Configuration not updated again:

"client_3": { "servers": [ "node1" ],"@type": "d" }

Is there a problem with the way I create / configure the database or this error?

Solution

I think the problem here is that "hotalignment" needs to be set to "true" in the file "default-distributed-db-config. JSON" According to orientdb 2.2 X sharing doc, "if hotalignment = false is set, when the node rejoins the cluster (after failure or just unreachable), the complete copy of the database from the node may not have all information about fragmentation." But note that from changes between 2.1 x to 2.2. The bullet of X: "the hot alignment setting is deleted: once the server joins the cluster, it will remain in the configuration until they are manually deleted."

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>