Check replica role

Hello there,

I’m deploying a very simple cluster consisting in one master and one replica.

So I set distributed-db-config.json with these modifications:

{
    "servers": {
        "my-master": "master",
        "my-replica": "replica"
    }
}

But I have observed the two following facts:

  1. in logs all servers are marked as “MASTER”
+-------------+------+--------------------+-----+---------+--------------+--------------+------------------------+
|Name         |Status|Databases           |Conns|StartedOn|Binary        |HTTP          |UsedMemory              |
+-------------+------+--------------------+-----+---------+--------------+--------------+------------------------+
|my-replica(@)|ONLINE|demo=ONLINE (MASTER)|0    |13:37:20 |10.2.0.21:2424|10.2.0.21:2480|500.86MB/3.87GB (12.65%)|
|my-master(*) |ONLINE|demo=ONLINE (MASTER)|4    |13:37:51 |10.2.0.22:2424|10.2.0.22:2480|434.66MB/3.87GB (10.98%)|
+-------------+------+--------------------+-----+---------+--------------+--------------+------------------------+
  1. when I shutdown my-replica I can’t write anymore. Server response in error with No enough nodes online to execute the operation, available nodes: [my-master]

Can someone help me in checking my-replica is really a replica ? Thank you !

Hi @loganmzz

check on the OrientDB master folder of demo, you should have a copy of the distributed-db-config.json for demo db. Check that file on the master, in case my-replica it’s not replica change it and then restart the master and after the replica.

Let me know if this works

Thanks

Configuration file is exactly in the state I left it …

The ${ORIENTDB_HOME}/databases/demo/distributed-config.json file?

I have no such file :frowning:

When a new database is registered to be distributed a copy will be saved in the database folder itself.
Not sure why you don’t have it. In both server you don’t have it?

Thanks

Oups I forgot that I have wipe out my databases file storage :confused: Directory exists on master after on attempt to recreate it, I had an error because I tried a writeQuorum: 1. Both master and replica have started and sync, but I had an error when trying to create database from Studio. demo directory has been created with some files, but not the distribution configuration one.

I fix my setup and will give you description of directories and files in databases directory.

Ok, now I have:

  • @master:databases/demo/distributed-config.json
"@type":"d","@version":0,"readYourWrites":true,"newNodeStrategy":"static","servers":{"@type":"d","@version":0,"my-replica":"replica","my-master":"master"},"autoDeploy":true,"readQuorum":1,"executionMode":"undefined","version":3,"writeQuorum":"majority","clusters":{"@type":"d","@version":0,"internal":{"@type":"d","@version":0},"*":{"@type":"d","@version":0,"servers":["my-master","my-replica","<NEW_NODE>"]}}}
  • @replica:databases/demo/distributed-config.json
{"@type":"d","@version":0,"readYourWrites":true,"newNodeStrategy":"static","servers":{"@type":"d","@version":0,"my-replica":"replica","my-master":"master"},"autoDeploy":true,"readQuorum":1,"executionMode":"undefined","version":3,"writeQuorum":"majority","clusters":{"@type":"d","@version":0,"internal":{"@type":"d","@version":0},"*":{"@type":"d","@version":0,"servers":["my-master","my-replica","<NEW_NODE>"]}}}
  • Create new class: 200 OK
{"result":[{"operation": "create class", "className": "Message"}],"elapsedMs":76}
  • Add new Message record: 200 OK
{"@type":"d","@rid":"#12:0","@version":1,"@class":"Message","content":"Hello World !"}
  • Shutdown my-replica

  • Create new class: 500 Internal Server Error

{
  "errors": [
    {
      "reason": 500,
      "code": 500,
      "content": "com.orientechnologies.orient.server.distributed.ODistributedException: Error on creating cluster 'dummy' on distributed nodes: local and remote ids assigned are different"
    }
  ]
}
  • Add new Message record: 500 Internal Server Error
{
  "errors": [
    {
      "reason": 500,
      "code": 500,
      "content": "com.orientechnologies.orient.server.distributed.ODistributedException: No enough nodes online to execute the operation, available nodes: [my-master]"
    }
  ]
}
1 Like

News on the subject : yesterday I left as is and shutdown the host. This morning, I restart it and surprises have come:

  1. Replica now appears as replica in logs:
+-------------+------+---------------------+-----+---------+--------------+--------------+------------------------+
|Name         |Status|Databases            |Conns|StartedOn|Binary        |HTTP          |UsedMemory              |
+-------------+------+---------------------+-----+---------+--------------+--------------+------------------------+
|my-replica(*)|ONLINE|demo=ONLINE (REPLICA)|2    |07:43:54 |10.2.0.45:2424|10.2.0.45:2480|307.42MB/1.93GB (15.53%)|
|my-master(@) |ONLINE|demo=ONLINE (MASTER) |3    |07:23:16 |10.2.0.39:2424|10.2.0.39:2480|789.27MB/3.87GB (19.93%)|
+-------------+------+---------------------+-----+---------+--------------+--------------+------------------------+
  1. However, I’m not able to connect to the database as root

I will give a try to create a new database, and also wipe the installation in order to retry from scratch.

No problem to create a new database but after replica has shutdown I still have the com.orientechnologies.orient.server.distributed.ODistributedException: No enough nodes online to execute the operation, available nodes: [my-master] issue.

Did you fix this issue? I was encountered this problem.

Not exactly fixed … I just deployed 2-3 masters and 1 replica … And also delayed replica startup by checking at least 2 masters are online.

1 Like