我正在尝试在同一主机上同时启动 2 个 Neo4j 1.9 实例(1 个用于开发,1 个用于测试)。我已经意识到改变 HTTP 和 HTTPS 端口是不够的,因为远程 shell 有自己的端口(默认为 1337)。
第二个实例无法启动,因为它无法绑定。
Caused by: java.rmi.server.ExportException: Port already in use: 1337; nested exception is:
java.net.BindException: Address already in use
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:328)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:236)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:207)
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:122)
at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:108)
at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
at org.neo4j.shell.impl.RmiLocation.ensureRegistryCreated(RmiLocation.java:180)
at org.neo4j.shell.impl.RmiLocation.bind(RmiLocation.java:195)
at org.neo4j.shell.impl.RemotelyAvailableServer.makeRemotelyAvailable(RemotelyAvailableServer.java:99)
at org.neo4j.shell.impl.AbstractServer.makeRemotelyAvailable(AbstractServer.java:156)
at org.neo4j.shell.impl.ShellBootstrap.enable(ShellBootstrap.java:122)
at org.neo4j.shell.impl.ShellBootstrap.load(ShellBootstrap.java:112)
at org.neo4j.shell.impl.ShellServerKernelExtension.start(ShellServerKernelExtension.java:47)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:492)
... 12 more
Caused by: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:128)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:45)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:349)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:667)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:317)
... 27 more
我尝试按照Neo4j 官方文档中的说明禁用远程 shell 。通过在neoj-server.properties添加enable_remote_shell = false。但它不起作用。
禁用此(可选?) Neo4j 服务的正确方法是什么?