orientdborientdb-2.1distributed-database

Orient DB distributed replica on embedded server


We are setting a distributed OrientDB database on an embedded server (we are using OrientDB v.2.2.31). We would like to have a master-replica configuration, but we have encountered some issues in doing that.

We have setted the default-distributed-db-config.json file in the following way, both for the master and for the replica:

{
  "autoDeploy": true,
  "hotAlignment": true,
  "executionMode": "asynchronous",
  "readQuorum": 1,
  "writeQuorum": 1,
  "failureAvailableNodesLessQuorum": false,
  "readYourWrites": true,
  "newNodeStrategy" : "static",
  "servers": {
    "orientdb_master": "master",
    "orientdb_replica1": "replica"
  },
  "clusters": {
    "internal": {
    },
    "index": {
    },
    "*": {
      "servers": ["<NEW_NODE>"]
    }
  }
}

"orientdb_master" and "orientdb_replica1" are the hostnames associated to the the master and slave server, respectively.

We start the master server first and then the other server: the connection between them takes place without problems, but the server that should be the replica is actually another master (and so, we have a multi-master configuration).

How can we specify that the second server is a replica? There are other parameters that it is necessary to set?

Thanks in advance


Solution

  • Instead of setting orientdb_replica1 (the hostname), you should use the node name you assigned at startup. You can find it under config/orientdb-server-config.xml.