I have a Neo4j causal cluster deploy on kubernetes. The cluster has 3 cores and 3 replicas. Now I try to use python Neo4j bolt driver to connect. The problem happens when I use bolt+routing
driver + read_transaction, it will randomly give me error said that it can't resolve address of the replica. Anyone know why this is happening?
I am use python3.6 with Neo4j Bolt Driver 1.7
Here is my code
import os
from neo4j import GraphDatabase
NEO4J_URL = 'bolt+routing://neo4j-causal-cluster.default.svc.cluster.local:7687'
NEO4J_USER = os.environ['NEO4J_USER']
NEO4J_PASS = os.environ['NEO4J_PASS']
driver = GraphDatabase.driver(NEO4J_URL, auth=(NEO4J_USER, NEO4J_PASS))
with driver.session() as session:
session.read_transaction(query_new_user, ['123445'])
Here is the error I get
neobolt.addressing.AddressError: Cannot resolve address Address(host='neo4j-causal-cluster-replica-6f65-pdw', port=7687)
The error happens only when I try to run read_transaction
. When I run write_tranaction
, it's fine. But I feel it deson't make much sense to use write_transaction on read query