Failed to connect to local server through shell (Neo4j 2.1.6)

follow http://goo.gl/RSluPw

Unable to connect to local server through shell.

I installed neo4j-community-2.1.6 (without any changes), started the server and then wanted to connect via a shell (as mentioned here http://goo.gl/jI12RO ). What am I missing?

Here is my console output:

[~/bin/neo4j]
$ ls
CHANGES.txt   NOTICE.txt    bin/          lib/
LICENSE.txt   README.txt    conf/         plugins/
LICENSES.txt  UPGRADE.txt   data/         system/

[~/bin/neo4j]
$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

[~/bin/neo4j]
$ ./bin/neo4j start
Using additional JVM arguments:  -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow
Starting Neo4j Server...WARNING: not changing user
process [5481]... waiting for server to be ready............................................................................... OK.
http://localhost:7474/ is ready.

[~/bin/neo4j]
$ neo4j-shell
ERROR (-v for expanded information):
    Exception creating connection to: 172.24.46.19; nested exception is: 
    java.net.SocketException: Host is down

 -host      Domain name or IP of host to connect to (default: localhost)
 ...

[~/bin/neo4j]
$ neo4j-shell -v
ERROR (-v for expanded information):
    Connection refused
java.rmi.ConnectException: Connection refused to host: 172.24.46.19; nested exception is: 
    java.net.ConnectException: Operation timed out
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
    at com.sun.proxy.$Proxy1.welcome(Unknown Source)
    at org.neo4j.shell.impl.AbstractClient.sayHi(AbstractClient.java:215)
    at org.neo4j.shell.impl.RemoteClient.findRemoteServer(RemoteClient.java:63)
    at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:55)
    at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:43)
    at org.neo4j.shell.ShellLobby.newClient(ShellLobby.java:165)
    at org.neo4j.shell.StartClient.startRemote(StartClient.java:297)
    at org.neo4j.shell.StartClient.start(StartClient.java:175)
    at org.neo4j.shell.StartClient.main(StartClient.java:120)
Caused by: java.net.ConnectException: Operation timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at java.net.Socket.<init>(Socket.java:425)
    at java.net.Socket.<init>(Socket.java:208)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:147)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
    ... 14 more

 -host      Domain name or IP of host to connect to (default: localhost)
 -port      Port of host to connect to (default: 1337)
 ...

[~/bin/neo4j]
$ 

      

Why is the shell trying to connect to host 172.24.46.19? The suggestions http://goo.gl/R3iSzK doesn't help either.

Update 1:

I have activated the remote shell in neo4j.properties

:

# Enable shell server so that remote clients can connect via Neo4j shell.
remote_shell_enabled=true
# The network interface IP the shell will listen on (use 0.0.0 for all interfaces)
remote_shell_host=127.0.0.1
# The port the shell will listen on, default is 1337
remote_shell_port=1337

      

Still no success:

$ neo4j start
Using additional JVM arguments:  -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow
Starting Neo4j Server...WARNING: not changing user
process [7104]... waiting for server to be ready............................................................................... OK.
http://localhost:7474/ is ready.
[~]
$ neo4j-shell
ERROR (-v for expanded information):
    Exception creating connection to: 172.24.46.19; nested exception is: 
    java.net.SocketException: Host is down

 ...

[~]
$ neo4j-shell -host 127.0.0.1 -port 1337
ERROR (-v for expanded information):
    Exception creating connection to: 172.24.46.19; nested exception is: 
    java.net.SocketException: Host is down

      

Still trying to connect to 172.24.46.19.

+3


source to share


1 answer


I had a similar problem, changing the port from 1337 to 1338 (you can choose a different port number).



1. Stop neo4j server
2. Enable shell properties in neo4j.conf file
   # Enable a remote shell server which Neo4j Shell clients can log in to.
   dbms.shell.enabled=true
   # The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces).
   dbms.shell.host=0.0.0.0 
   # The port the shell will listen on, default is 1337.
   dbms.shell.port=1338
3. start neo4j server
4. Start shell
   root@ubuntu:/etc/neo4j# neo4j-shell -port 1338
   Welcome to the Neo4j Shell! Enter 'help' for a list of commands. Please note that neo4j-shell is deprecated and to be replaced by cypher-shell.
NOTE: Remote Neo4j graph database service 'shell' at port 1338

neo4j-sh (?)$

      

+2


source







All Articles