cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Unable to connect to remote Neo4j instance

I followed the instructions here to deploy a Neo4j instance on Amazon EC2.

At first I was unable to connect to the instance with cypher-shell -- the terminal returned the following error:

Unable to connect to localhost:7687, ensure the database is running and that there is a working network connection to it.

I was able to connect to the instance with the cypher-shell and browser by adding the following lines in the neo4j.template:

dbms.connector.bolt.listen_address=0.0.0.0:7687
dbms.connector.http.listen_address=0.0.0.0:8080

However, when I tried to enable the HTTPS connector using Cloudflare's Free SSL, all ports stopped working and I was unable to connect to the instance with cypher-shell and got the error Unable to connect to localhost:7687, ensure the database is running and that there is a working network connection to it. Here are the changes appended at the end of the neo4j.template:

dbms.connector.https.enabled=true
dbms.ssl.policy.https.enabled=true
dbms.ssl.policy.https.client_auth=NONE

dbms.ssl.policy.https.private_key=/var/lib/neo4j/certificates/https/example.co.key
dbms.ssl.policy.https.public_certificate=/var/lib/neo4j/certificates/https/example.co.pem

dbms.ssl.policy.https.base_directory=/var/lib/neo4j/certificates/https

dbms.connector.https.advertised_address=abc.example.co:443
dbms.connector.https.listen_address=0.0.0.0:443

Note #1: I've ensured neo4j is able to access the certificates:

$neo4j-home> ls certificates/https
-r-------- ... example.co.key
-rw-r--r-- ... example.co.pem
drwxr-xr-x ... revoked
drwxr-xr-x ... trusted

Note #2:

  1. I've also enabled the appropriate inbound rules in the security group.

  2. I've checked the logs with journalctl -e -u neo4j. Nothings seems to be amiss.

  3. I restarted the neo4j with sudo systemctl restart neo4j every time I made modified neo4j.template

1 REPLY 1

You've got a lot of variables in play here, I wouldn't know where to start. I suggest starting small, first verify neo4j is online with HTTP using cypher-shell connecting from the server it is installed on, then perhaps move to HTTPS, then think about connections from outside of AWS.

Tackle one issue at a time, if at all possible.