In Neo4j 4.0, if you are logged into the
READ_REPLICA of a Causal Cluster, and execute the following command to login into
$NEO4J_HOME/bin/cypher-shell -u neo4j -p mypwd
You will encounter this error:
Failed to obtain connection towards WRITE server. Known routing table is: Ttl 1589334991968, currentTime 1589334691977, routers AddressSet=[localhost:7637], writers AddressSet=, readers AddressSet=[localhost:7637], database '<default database>'
Before the 4.0 version, the above was a completely valid/correct command to log into the
The reason is that the default value for the address (
-a) parameter in the command is
The syntax is documented in the cypher-shell command-line help as:
$NEO4J_HOME/bin/cypher-shell -help -a ADDRESS, --address ADDRESS address and port to connect to (default: neo4j://localhost:7687)
The implication of the default value
neo4j://localhost:7687 is that the
cypher-shell is interpreting the login command as:
$NEO4J_HOME/bin/cypher-shell -u neo4j -p mypwd -a neo4j://localhost:7687
The above command is invalid/wrong. The
To get around this error and logging into the
cypher-shell of a
READ_REPLICA, use the following command instead:
$NEO4J_HOME/bin/cypher-shell -u neo4j -p mypwd -a bolt://localhost:7687
While connecting to a
READ REPLICA from a different
Causal Cluster member, use the command as:
$NEO4J_HOME/bin/cypher-shell -u neo4j -p mypwd -a bolt://<read-replica-server-ip>:7687
A key takeaway from this article is that if you’re using
- Last Modified: 2020-10-15 08:05:54 UTC by Vivek Saran.
- Relevant for Neo4j Versions: 4.0.
- Relevant keywords cypher-shell, bolt.