Neo4j 嵌入式:从 2.3.9 升级到 3.2.3:initial_hosts 没有相互通信
Neo4j embedded : Upgrade from 2.3.9 to 3.2.3 : initial_hosts are not communicating with each other
我已经在 SINGLE 模式下将我的 neo4j 嵌入式数据库从 2.3.9 升级到 3.2.3,它已成功升级。升级后,我启用了 "HA" 模式。虽然 运行 neo4j 有 3 个集群,但我面临以下问题。
个别服务器 运行 在 HA 模式下没问题。 (即 ha.initial_hosts = "ip_address_1:5101"),但如果我在 initial_hosts 下添加三台服务器(如配置所示),所有三台服务器都会立即停止。
我是否缺少任何配置?请提出建议。
配置:
neo4j {
# Enable these two options while upgrading neo4j database.
# dbms.allow_format_migration=true
# or weak or strong
cache_type = "weak"
# Reduce the default page cache memory allocation
dbms.memory.pagecache.size="6G"
# Port to listen to for incoming backup requests.
dbms.backup.address = ${local.private-ip}":6367"
# Unique server id for this Neo4j instance
# can not be negative id and must be unique
ha.server_id="1"
# List of other known instances in this cluster
ha.initial_hosts = "ip_1:5101,ip_2:5101,ip_3:5101"
# ha.initial_hosts = "ip_1:5101"
# ha.cluster_server = ${local.private-ip}":5101"
# IP and port for this instance to bind to for communicating cluster information
# with the other neo4j instances in the cluster.
ha.host.coordination = ${local.private-ip}":5101"
# IP and port for this instance to bind to for communicating data with the
# other neo4j instances in the cluster.
ha.host.data = ${local.private-ip}":6365"
# HA - High Availability
# SINGLE - Single mode, default.
dbms.mode="HA"
# HTTP Connector
dbms.connector.http.enabled="true"
dbms.connector.http.listen_address=":7474"
# Bolt connector
dbms.connector.bolt.enabled="true"
dbms.connector.bolt.tls_level="OPTIONAL"
dbms.connector.bolt.listen_address=":7689"
}
来自neo4j debug.log:
2017-10-09 12:35:47.153+0000 ERROR [o.n.k.h.c.m.HighAvailabilityModeSwitcher] Error while trying to switch to slave Cannot find the master among [] with master serverId=1 and uri=ha://ip_address_1:6365?serverId=1
java.lang.IllegalStateException: Cannot find the master among [] with master serverId=1 and uri=ha://ip_address_1:6365?serverId=1
at org.neo4j.kernel.ha.cluster.SwitchToSlave.checkMyStoreIdAndMastersStoreId(SwitchToSlave.java:263)
at org.neo4j.kernel.ha.cluster.SwitchToSlaveBranchThenCopy.checkDataConsistency(SwitchToSlaveBranchThenCopy.java:142)
at org.neo4j.kernel.ha.cluster.SwitchToSlave.executeConsistencyChecks(SwitchToSlave.java:478)
at org.neo4j.kernel.ha.cluster.SwitchToSlave.switchToSlave(SwitchToSlave.java:221)
at org.neo4j.kernel.ha.cluster.modeswitch.HighAvailabilityModeSwitcher.run(HighAvailabilityModeSwitcher.java:355)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.neo4j.helpers.NamedThreadFactory.run(NamedThreadFactory.java:109)
2017-10-09 12:35:47.154+0000 INFO [o.n.k.h.c.m.HighAvailabilityModeSwitcher] Attempting to switch to slave in 300s
join_timeout 的默认值为 30 秒。
加入集群超时。默认为 ha.broadcast_timeout。请注意,如果在集群形成期间超时到期,操作员可能必须重新启动一个或多个实例。
ha.join_timeout=10米
我已经在 SINGLE 模式下将我的 neo4j 嵌入式数据库从 2.3.9 升级到 3.2.3,它已成功升级。升级后,我启用了 "HA" 模式。虽然 运行 neo4j 有 3 个集群,但我面临以下问题。
个别服务器 运行 在 HA 模式下没问题。 (即 ha.initial_hosts = "ip_address_1:5101"),但如果我在 initial_hosts 下添加三台服务器(如配置所示),所有三台服务器都会立即停止。
我是否缺少任何配置?请提出建议。
配置:
neo4j {
# Enable these two options while upgrading neo4j database.
# dbms.allow_format_migration=true
# or weak or strong
cache_type = "weak"
# Reduce the default page cache memory allocation
dbms.memory.pagecache.size="6G"
# Port to listen to for incoming backup requests.
dbms.backup.address = ${local.private-ip}":6367"
# Unique server id for this Neo4j instance
# can not be negative id and must be unique
ha.server_id="1"
# List of other known instances in this cluster
ha.initial_hosts = "ip_1:5101,ip_2:5101,ip_3:5101"
# ha.initial_hosts = "ip_1:5101"
# ha.cluster_server = ${local.private-ip}":5101"
# IP and port for this instance to bind to for communicating cluster information
# with the other neo4j instances in the cluster.
ha.host.coordination = ${local.private-ip}":5101"
# IP and port for this instance to bind to for communicating data with the
# other neo4j instances in the cluster.
ha.host.data = ${local.private-ip}":6365"
# HA - High Availability
# SINGLE - Single mode, default.
dbms.mode="HA"
# HTTP Connector
dbms.connector.http.enabled="true"
dbms.connector.http.listen_address=":7474"
# Bolt connector
dbms.connector.bolt.enabled="true"
dbms.connector.bolt.tls_level="OPTIONAL"
dbms.connector.bolt.listen_address=":7689"
}
来自neo4j debug.log:
2017-10-09 12:35:47.153+0000 ERROR [o.n.k.h.c.m.HighAvailabilityModeSwitcher] Error while trying to switch to slave Cannot find the master among [] with master serverId=1 and uri=ha://ip_address_1:6365?serverId=1
java.lang.IllegalStateException: Cannot find the master among [] with master serverId=1 and uri=ha://ip_address_1:6365?serverId=1
at org.neo4j.kernel.ha.cluster.SwitchToSlave.checkMyStoreIdAndMastersStoreId(SwitchToSlave.java:263)
at org.neo4j.kernel.ha.cluster.SwitchToSlaveBranchThenCopy.checkDataConsistency(SwitchToSlaveBranchThenCopy.java:142)
at org.neo4j.kernel.ha.cluster.SwitchToSlave.executeConsistencyChecks(SwitchToSlave.java:478)
at org.neo4j.kernel.ha.cluster.SwitchToSlave.switchToSlave(SwitchToSlave.java:221)
at org.neo4j.kernel.ha.cluster.modeswitch.HighAvailabilityModeSwitcher.run(HighAvailabilityModeSwitcher.java:355)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.neo4j.helpers.NamedThreadFactory.run(NamedThreadFactory.java:109)
2017-10-09 12:35:47.154+0000 INFO [o.n.k.h.c.m.HighAvailabilityModeSwitcher] Attempting to switch to slave in 300s
join_timeout 的默认值为 30 秒。
加入集群超时。默认为 ha.broadcast_timeout。请注意,如果在集群形成期间超时到期,操作员可能必须重新启动一个或多个实例。
ha.join_timeout=10米