Orientdb: Как установить роль сервера реплик?
Допустим, у нас есть три сервера: 1.1.1.1
, 2.2.2.2
а также 3.3.3.3
,
я хочу сделать 1.1.1.1
а также 2.2.2.2
быть master
с и 3.3.3.3
быть replica
(обе роли описаны в документации по ролям сервера orientdb)
Вот содержимое моего default-distributed-db-config.json
:
{
"replication": true,
"hotAlignment" : true,
"autoDeploy": true,
"readQuorum": 1,
"writeQuorum": "majority",
"executionMode": "undefined",
"readYourWrites": true,
"newNodeStrategy": "static",
"servers": {
"1.1.1.1": "master",
"2.2.2.2": "master",
"3.3.3.3": "replica"
},
"clusters": {
"internal": {},
"*": {
"servers": ["<NEW_NODE>"]
}
}
}
Когда я запускаю сервер OrientDB с этим конфигом, я получаю ошибку:
2019-06-24 21:49:08:247 INFO [orientdb-1] Loaded configuration for database 'OSystem' from disk: /orientdb/config/default-distributed-db-config.json [ODistributedStorage][orientdb-1] Error on loading distributed configuration file in: /orientdb/config/default-distributed-db-config.json
com.orientechnologies.orient.core.exception.OSerializationException: Error on unmarshalling JSON content for record: "replication": true,
"hotAlignment" : true,
"autoDeploy": true,
"readQuorum": 1,
"writeQuorum": "majority",
"executionMode": "undefined",
"readYourWrites": true,
"newNodeStrategy": "static",
"servers": {
"1.1.1.1": "master",
"2.2.2.2": "master",
"3.3.3.3": "replica"
},
"clusters": {
"internal": {},
"*": {
"servers": ["<NEW_NODE>"]
}
}
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.fromString(ORecordSerializerJSON.java:325)
at com.orientechnologies.orient.core.record.ORecordAbstract.fromJSON(ORecordAbstract.java:162)
at com.orientechnologies.orient.core.record.impl.ODocument.fromJSON(ODocument.java:2110)
at com.orientechnologies.orient.server.distributed.impl.ODistributedStorage.loadDatabaseConfiguration(ODistributedStorage.java:1954)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.initSystemDatabase(OHazelcastPlugin.java:354)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.startup(OHazelcastPlugin.java:279)
at com.orientechnologies.orient.server.OServer.registerPlugins(OServer.java:1194)
at com.orientechnologies.orient.server.OServer.activate(OServer.java:469)
at com.orientechnologies.orient.server.OServerMain$1.run(OServerMain.java:48)
Caused by: com.orientechnologies.orient.core.exception.OSerializationException: Error on unmarshalling JSON content for record: "159.69.218.235":"master","116.203.82.199":"master","116.203.80.44":"replica"
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.fromString(ORecordSerializerJSON.java:325)
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.getValueAsRecord(ORecordSerializerJSON.java:630)
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.getValueAsObjectOrMap(ORecordSerializerJSON.java:600)
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.getValue(ORecordSerializerJSON.java:441)
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.fromString(ORecordSerializerJSON.java:265)
... 8 more
Caused by: java.lang.IllegalArgumentException: Property '159.69.218' is null, is possible to set a value with dotted notation only on not null property
at com.orientechnologies.orient.core.record.impl.ODocument.field(ODocument.java:1436)
at com.orientechnologies.orient.core.record.impl.ODocument.field(ODocument.java:1295)
at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.fromString(ORecordSerializerJSON.java:312)
... 12 more
Я предполагаю, что есть некоторая синтаксическая ошибка, однако конфиг json действителен.
Поскольку в OrientDB отсутствует пример настройки реплик, кто-нибудь может объяснить, как настроить мастера и реплики?