neo4j 3.2.2-1 在找不到可用的硬件地址后不断重启

neo4j 3.2.2-1 constant restart just after Failed to find a usable hardware address

我正在尝试在 Centos 7.2 的最小安装上让 neo4j 达到 运行,neo4j 通过 yum 安装。

然而它似乎开始启动,但失败,关闭,然后在连续循环中重新启动:

2017-07-18 03:06:34.731+0000 INFO [o.n.k.i.DatabaseHealth] Database health set to OK

017-07-18 03:06:35.140+0000 WARN [io.netty.util.internal.MacAddressUtil] Failed to find a usable hardware address from the network interfaces; using random bytes: be:ac:2d:4b:9d:99:28:41

2017-07-18 03:06:35.226+0000 INFO [o.n.k.i.t.l.c.CheckPointerImpl] Check Pointing triggered by database shutdown [1]:  Starting check pointing...
...
2017-07-18 03:06:35.335+0000 INFO [o.n.k.i.f.GraphDatabaseFacadeFactory] Shutdown started

ifconfig 给我:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.240  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::f010:beff:fea8:314d  prefixlen 64  scopeid 0x20<link>
        ether f2:10:be:a8:31:4d  txqueuelen 1000  (Ethernet)
        RX packets 195385  bytes 316555671 (301.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 105586  bytes 7261323 (6.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 7  bytes 391 (391.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7  bytes 391 (391.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

我已经尝试将 dbms.connectors.default_listen_address 设置为静态 ip 0.0.0.0,并将其注释掉。

我觉得我可能缺少依赖关系或 netty 用来获取 MAC 地址的东西,但 netty 网站声称不需要依赖关系。

最后一点信息是这是一个 lxc 容器,但我发誓我过去在 lxc 中有一个 neo4j 运行ning 版本。

此外,这被标记为警告,但它似乎正在停止启动。

如有任何想法,我们将不胜感激!

经过一些工作,我发现了原因。 MAC 地址位原来是个误会。

实际原因是使用:

neo4j-admin set-initial-password mypass

每当我以这种方式设置初始密码时,neo4j 都无法正常启动。 不幸的是,我确实需要找出一种设置初始密码的方法,因为这是自动部署的一部分。

最终解决方案是不使用 neo4j-admin 并使用 web api 设置密码。

这个 link 展示了一个使用 curl 的好例子: http://430.io/change-neo4j-default-password-in-command-line/

curl -H "Content-Type: application/json" -X POST -d '{"password":"NEW PASSWORD"}' -u neo4j:neo4j http://localhost:7474/user/neo4j/password