Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
on 11-25-2019 10:38 AM
I installed neo4j on a remote Ubuntu 18.04 Digital Ocean droplet. When I check the status of my neo4j server I see that my server is actively running and the remote interface is available at port 7474
username@ip-***-**-**-***:~$ sudo service neo4j status
neo4j.service - Neo4j Graph Database
Loaded: loaded (/lib/systemd/system/neo4j.service; disabled; vendor preset: enabled)
Active: active (running) since Mon 2019-11-25 18:21:05 UTC; 1min 8s ago
Main PID: 11340 (java)
Tasks: 40 (limit: 2362)
CGroup: /system.slice/neo4j.service
└─11340 /usr/bin/java -cp /var/lib/neo4j/plugins:/etc/neo4j:/usr/share/neo4j/lib/*:/var/lib/neo4j/plugins/* -server -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow
Nov 25 18:21:05 ip-***-**-**-*** neo4j[11340]: import: /var/lib/neo4j/import
Nov 25 18:21:05 ip-***-**-**-*** neo4j[11340]: data: /var/lib/neo4j/data
Nov 25 18:21:05 ip-***-**-**-*** neo4j[11340]: certificates: /var/lib/neo4j/certificates
Nov 25 18:21:05 ip-***-**-**-*** neo4j[11340]: run: /var/run/neo4j
Nov 25 18:21:05 ip-***-**-**-*** neo4j[11340]: Starting Neo4j.
Nov 25 18:21:07 ip-***-**-**-*** neo4j[11340]: 2019-11-25 18:21:07.507+0000 INFO ======== Neo4j 3.5.12 ========
Nov 25 18:21:07 ip-***-**-**-*** neo4j[11340]: 2019-11-25 18:21:07.528+0000 INFO Starting...
Nov 25 18:21:11 ip-***-**-**-*** neo4j[11340]: 2019-11-25 18:21:11.566+0000 INFO Bolt enabled on 0.0.0.0:7687.
Nov 25 18:21:14 ip-***-**-**-*** neo4j[11340]: 2019-11-25 18:21:14.347+0000 INFO Started.
Nov 25 18:21:16 ip-***-**-**-*** neo4j[11340]: 2019-11-25 18:21:16.132+0000 INFO Remote interface available at http://localhost:7474/
My firewall is enabled and allowing HTTP and OpenSSH access:
username@ip-***-**-**-***:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
I made sure that I edited Neo4j's configuration file at /etc/neo4j/neo4j.conf and made the single edit to the file uncommenting the following line:
dbms.connectors.default_listen_address=0.0.0.0
After uncommenting that line I save the file and restart Neo4j
sudo service neo4j restart
When I go to http://SERVER_IP_ADDRESS:7474/browser/ on my laptop it just loads forever until landing on Firefox's default "Problem loading page". I have no idea what I'm doing wrong. I have searched far and wide across these forums and Google and haven't been able to solve this. I've come across this problem in other posts, but none of the solutions worked.
For the record, here is the Java software I installed on Ubuntu:
username@ip-***-**-**-***:~$ java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
For remote access you need to open ports 7474 (or 7473 for https) and 7687 for bolt. So try
sudo ufw allow 7474/tcp
sudo ufw allow 7687/tcp
I don't have HTTPS set up at the moment. Unfortunately, it's still not working. Below is the firewall status after making the changes you suggested.
username@ip-***-**-**-***:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
7474/tcp ALLOW Anywhere
7687/tcp ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
7474/tcp (v6) ALLOW Anywhere (v6)
7687/tcp (v6) ALLOW Anywhere (v6)
what do you get upon netstat -atnp | grep LISTEN
?
Here you go:
username@ip-***-**-**-***:~$ sudo netstat -atnp | grep LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 916/nginx: master p
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 700/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 895/sshd
tcp6 0 0 :::7687 :::* LISTEN 1816/java
tcp6 0 0 :::80 :::* LISTEN 916/nginx: master p
tcp6 0 0 :::7473 :::* LISTEN 1816/java
tcp6 0 0 :::7474 :::* LISTEN 1816/java
tcp6 0 0 :::22 :::* LISTEN 895/sshd
There it is: Neo4j uses ipv6 only. You can force it to use ipv4 instead. Add to your neo4j.conf the following line:
dbms.jvm.additional=-Djava.net.preferIPv4Stack=true
If you use Ubuntu on the ORACLE cloud, special extra steps are needed.
This is what worked for me, based on this thread: ubuntu 18.04 - "No route to host" when trying to connect to a TCP service on an Oracle Cloud Intance...
The following extra steps were needed on the Oracle cloud, to open up ports on Ubuntu 20 :
sudo vim /etc/iptables/rules.v4
(or whatever editor you use)-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
, insert:-A INPUT -p tcp -m state --state NEW -m tcp --dport 1234 -j ACCEPT
(change the number of the port that needs to be opened!)
sudo su -
iptables-restore < /etc/iptables/rules.v4
exit
nc -zvw100 THE_IP_ADDRESS_OF_MACHINE_WHOSE_PORT_WE_OPENED THE_PORT_NUMBER