-1

问题:

数据库无法启动,以状态“KILLED”退出,日志以:Caused by: ... bind(..) failed: Address already in use

桌面初始错误

与这些非常相似:

日志结束于:

Caused by: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use

我尝试过的事情:

  • 杀死与 neo4j 相关的所有进程
  • 搜索默认端口lsof :11002/3
  • 重新安装
    • 一些您似乎无法删除的配置文件.config

操作系统和版本数据

  • 操作系统:Linux pop-os 5.4.0-7634-generic #38~1596560323~20.04~7719dbd-Ubuntu SMP Tue Aug 4 19:12:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
  • neo4j 版本:4.1.0
  • 桌面版:1.3.4

neo4j.log

Directories in use:
  home:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0
  config:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/conf
  logs:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/logs
  plugins:      /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/plugins
  import:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/import
  data:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/data
  certificates: /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/certificates
  run:          /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/run
Starting Neo4j.
WARNING: Max 8192 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Directories in use:
  home:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0
  config:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/conf
  logs:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/logs
  plugins:      /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/plugins
  import:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/import
  data:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/data
  certificates: /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/certificates
  run:          /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/run
Starting Neo4j.
WARNING: Max 8192 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
2020-08-21 19:04:24.399+0000 INFO  Note that since you did not explicitly set the port in dbms.connector.bolt.advertised_address Neo4j automatically set it to 11002 to match dbms.connector.bolt.listen_address. This behavior may change in the future and we recommend you to explicitly set it.
2020-08-21 19:04:24.402+0000 INFO  Note that since you did not explicitly set the port in dbms.connector.http.advertised_address Neo4j automatically set it to 11003 to match dbms.connector.http.listen_address. This behavior may change in the future and we recommend you to explicitly set it.
2020-08-21 19:04:24.402+0000 INFO  Starting...
Directories in use:
  home:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0
  config:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/conf
  logs:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/logs
  plugins:      /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/plugins
  import:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/import
  data:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/data
  certificates: /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/certificates
  run:          /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/run
Starting Neo4j.
WARNING: Max 8192 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
2020-08-21 19:04:24.399+0000 INFO  Note that since you did not explicitly set the port in dbms.connector.bolt.advertised_address Neo4j automatically set it to 11002 to match dbms.connector.bolt.listen_address. This behavior may change in the future and we recommend you to explicitly set it.
2020-08-21 19:04:24.402+0000 INFO  Note that since you did not explicitly set the port in dbms.connector.http.advertised_address Neo4j automatically set it to 11003 to match dbms.connector.http.listen_address. This behavior may change in the future and we recommend you to explicitly set it.
2020-08-21 19:04:24.402+0000 INFO  Starting...
2020-08-21 19:04:26.747+0000 INFO  ======== Neo4j 4.1.0 ========
Directories in use:
  home:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0
  config:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/conf
  logs:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/logs
  plugins:      /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/plugins
  import:       /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/import
  data:         /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/data
  certificates: /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/certificates
  run:          /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/run
Starting Neo4j.
WARNING: Max 8192 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
2020-08-21 19:04:24.399+0000 INFO  Note that since you did not explicitly set the port in dbms.connector.bolt.advertised_address Neo4j automatically set it to 11002 to match dbms.connector.bolt.listen_address. This behavior may change in the future and we recommend you to explicitly set it.
2020-08-21 19:04:24.402+0000 INFO  Note that since you did not explicitly set the port in dbms.connector.http.advertised_address Neo4j automatically set it to 11003 to match dbms.connector.http.listen_address. This behavior may change in the future and we recommend you to explicitly set it.
2020-08-21 19:04:24.402+0000 INFO  Starting...
2020-08-21 19:04:26.747+0000 INFO  ======== Neo4j 4.1.0 ========
2020-08-21 19:04:32.005+0000 ERROR Failed to start Neo4j on dbms.connector.http.listen_address, a socket address. If missing port or hostname it is acquired from dbms.default_listen_address. Error starting Neo4j database server at /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/data/databases
java.lang.RuntimeException: Error starting Neo4j database server at /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/data/databases
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:198)
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:158)
    at com.neo4j.server.enterprise.EnterpriseManagementServiceFactory.createManagementService(EnterpriseManagementServiceFactory.java:38)
    at com.neo4j.server.enterprise.EnterpriseBootstrapper.createNeo(EnterpriseBootstrapper.java:20)
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:117)
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:87)
    at com.neo4j.server.enterprise.EnterpriseEntryPoint.main(EnterpriseEntryPoint.java:25)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'Server[backup-server]' was successfully initialized, but failed to start. Please see the attached cause exception "bind(..) failed: Address already in use".
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:463)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110)
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:189)
    ... 6 more
Caused by: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
2020-08-21 19:04:32.006+0000 INFO  Neo4j Server shutdown initiated by request

调试日志

2020-08-21 19:04:24.897+0000 INFO [o.n.i.d.DiagnosticsManager] ********************************************************************************
2020-08-21 19:04:24.898+0000 INFO [o.n.i.d.DiagnosticsManager]                              [ System diagnostics ]                             
2020-08-21 19:04:24.899+0000 INFO [o.n.i.d.DiagnosticsManager] ********************************************************************************
2020-08-21 19:04:24.902+0000 INFO [o.n.i.d.DiagnosticsManager] --------------------------------------------------------------------------------
2020-08-21 19:04:24.902+0000 INFO [o.n.i.d.DiagnosticsManager]                          [ System memory information ]                          
2020-08-21 19:04:24.902+0000 INFO [o.n.i.d.DiagnosticsManager] --------------------------------------------------------------------------------
...
2020-08-21 19:04:25.482+0000 INFO [c.n.c.c.TransactionBackupServiceProvider] Binding backup service on address 127.0.0.1:6362
2020-08-21 19:04:26.747+0000 INFO [c.n.s.e.EnterpriseNeoWebServer] ======== Neo4j 4.1.0 ========
2020-08-21 19:04:26.824+0000 INFO [o.n.b.BoltServer] Bolt server loaded
2020-08-21 19:04:26.930+0000 ERROR [c.n.c.n.Server] backup-server: cannot bind to '127.0.0.1:6362' with transport 'EpollServerSocketChannel'. bind(..) failed: Address already in use
io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
2020-08-21 19:04:26.943+0000 ERROR [o.n.g.f.DatabaseManagementServiceFactory] Error starting Neo4j database server at /home/edwardweymouth/.config/Neo4j Desktop/Application/neo4jDatabases/database-8c955e24-f305-4cd8-9342-490ffd3dc0ab/installation-4.1.0/data/databases Component 'Server[backup-server]' was successfully initialized, but failed to start. Please see the attached cause exception "bind(..) failed: Address already in use".
org.neo4j.kernel.lifecycle.LifecycleException: Component 'Server[backup-server]' was successfully initialized, but failed to start. Please see the attached cause exception "bind(..) failed: Address already in use".
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:463)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110)
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:189)
    at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:158)
    at com.neo4j.server.enterprise.EnterpriseManagementServiceFactory.createManagementService(EnterpriseManagementServiceFactory.java:38)
    at com.neo4j.server.enterprise.EnterpriseBootstrapper.createNeo(EnterpriseBootstrapper.java:20)
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:117)
    at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:87)
    at com.neo4j.server.enterprise.EnterpriseEntryPoint.main(EnterpriseEntryPoint.java:25)
Caused by: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
2020-08-21 19:04:26.944+0000 INFO [o.n.g.f.DatabaseManagementServiceFactory] Shutdown started
4

1 回答 1

0

这里有很多地址已经在使用中,所以很难解析,但调试日志中的这一点原来是重要的部分:

2020-08-21 19:04:25.482+0000 INFO [c.n.c.c.TransactionBackupServiceProvider] Binding backup service on address 127.0.0.1:6362
2020-08-21 19:04:26.747+0000 INFO [c.n.s.e.EnterpriseNeoWebServer] ======== Neo4j 4.1.0 ========
2020-08-21 19:04:26.824+0000 INFO [o.n.b.BoltServer] Bolt server loaded
2020-08-21 19:04:26.930+0000 ERROR [c.n.c.n.Server] backup-server: cannot bind to '127.0.0.1:6362' with transport 'EpollServerSocketChannel'. bind(..) failed: Address already in use

搜索端口:

$ lsof -i :6362
COMMAND    PID           USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
java    530156 user  427u  IPv6 3670839      0t0  TCP localhost:6362 (LISTEN)
$ kill 530156

看起来桌面在那里的字段中留下了一些 java runnin'...

在那之后数据库启动一切都很好。

于 2020-08-21T20:08:19.667 回答