Using Neo4j with PySpark on Databricks: org.neo4j.driver.exceptions.ServiceUnavailableException error

Viewed 95

I am trying to query a graph hosted on Neo4j from Databricks using neo4j-spark-connector. I am using the following code to access the graph:

df = spark.read.format("org.neo4j.spark.DataSource")\
 .option("url", "bolt://<IP adress>:7687")\
 .option("authentication.type", "basic")\
 .option("authentication.basic.username", "<username>")\
 .option("authentication.basic.password", "<password>")\
 .load()

This error is returned:

org.neo4j.driver.exceptions.ServiceUnavailableException: Unable to connect to 18.206.149.168:7687, ensure the database is running and that there is a working network connection to it.

Any idea of what I am missing in the use of the connector here ?

Details on versions/ libraries:

Neo4j Browser version: 4.2.1-patch-3.0 Neo4j Server version: 4.4.8 (enterprise)

Installed neo4j-spark-connector on Databricks:

neo4j-contrib:neo4j-connector-apache-spark_2.12:4.0.1_for_spark_3

I have added in the spark configuration following lines:

spark.neo4j.bolt.password <password>
spark.databricks.passthrough.enabled true
spark.neo4j.bolt.url bolt://<IP adress>:7687
spark.neo4j.bolt.user <username>

Unfortunately, online documentation isn't up-to-date to latest releases of neo4j versions (4+). I am trying to follow the process explained in this blog by adapting it to the neo4j version I am using.

0 Answers
Related