What is neo4j-admin unbind ?
In Neo4j, a cluster consists of multiple instances (or nodes) working together to provide high availability and fault tolerance. Each instance in the cluster maintains a copy of the graph database and communicates with other nodes to ensure data consistency.
Neo4j-admin unbind is a utility command used only in a clustered environment and it removes the cluster state of a Causal Cluster member.
Basically, The "neo4j-admin unbind" command is used when you want to remove a cluster node from the cluster, thus this command will only run when Neo4j services are stopped on that cluster member. When a node is unbound, it no longer participates in the coordination and replication processes of the cluster.
Performing "unbind" on Single Core member
Yes, it is possible to execute "Neo4j-admin unbind" on an individual cluster member. In a causal cluster comprising three COREs, the routing table for our "test" database appears as follows. Based on this information, we observe that "localhost:7617" possesses the WRITE role, while the other two instances have READ roles.
YIELD ttl, servers
UNWIND servers as server
RETURN ttl, server.role, server.addresses;
Afterward, if we halt the Neo4j services on CORE-1, the leadership will be transferred to one of the remaining CORE members, and the others will assume the role of FOLLOWER.
To perform unbind, go to /bin directory of your Neo4j Installation and run "./neo4j-admin unbind"
aayushbhardwaj@Aayushs-MacBook-Pro bin % ./neo4j stop
Stopping Neo4j.......... stopped.
aayushbhardwaj@Aayushs-MacBook-Pro bin % ./neo4j-admin unbind
Selecting JVM - Version:11.0.19+0, Name:OpenJDK 64-Bit Server VM, Vendor:Homebrew
aayushbhardwaj@Aayushs-MacBook-Pro bin %
If we initiate the neo4j-admin unbind process and start the service, will the routing table begin using the IP of that node for read operations, even if it hasn't finished starting up or is still in the process of downloading snapshots?
- No, the core member will not serve any READ requests until the snapshot of databases is downloaded from the other raft group member.
- In the scenario where the database is still being downloaded and operations were directed to the unbound node IP, would read operations fail?
- No, read operations will not be served by the unbound member. This server will be available only for routing the requests to other server.