gpt4 book ai didi

docker - 从 docker 容器启动 neo4j 显示 "Neo4j is not running"

转载 作者:行者123 更新时间:2023-12-02 19:06:46 24 4
gpt4 key购买 nike

我一直在尝试在容器中使用使用 neo4j 社区并且遇到错误。我认为这可能更多是 docker 使用问题而不是 neo4j 使用问题。

我从 https://github.com/neo4j/docker-neo4j-publish 构建了一个容器镜像2.3.9、3.3.3、3.3.4 和 3.3.5(唯一的区别是更高版本中的一些新端口)。我什至从 dockerhub.com 拉了一个原生 3.3.3

mkdir /tmp/data
chmod 777 /tmp/data
docker run --detach=true --name=neo4j --publish=7474:7474 --publish=7687:7687 --publish=7473:7473 --volume=/tmp/data:/data neo4j:3.3.3
docker exec -it neo4j find / -name '*.log'

虽然它似乎正在使用
neo4j> CREATE (n);
0 rows available after 50 ms, consumed after another 0 ms
Added 1 nodes
neo4j> CREATE (m),(o);
0 rows available after 15 ms, consumed after another 0 ms
Added 2 nodes
neo4j> MATCH (n) RETURN n;
+----+
| n |
+----+
| () |
| () |
| () |
+----+

3 rows available after 21 ms, consumed after another 8 ms

我实际上得到这样的错误:
docker exec -it neo4j neo4j status
Neo4j is not running

现在这个看起来我错误地试图在一个正在运行的实例上启动另一个 Neo4j 实例:
 docker exec -it neo4j neo4j console
Active database: graph.db
Directories in use:
home: /var/lib/neo4j
config: /var/lib/neo4j/conf
logs: /var/lib/neo4j/logs
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run: /var/lib/neo4j/run
Starting Neo4j.
2018-04-15 06:30:13.119+0000 WARN Unknown config option: causal_clustering.discovery_listen_address
2018-04-15 06:30:13.123+0000 WARN Unknown config option: causal_clustering.raft_advertised_address
2018-04-15 06:30:13.123+0000 WARN Unknown config option: causal_clustering.raft_listen_address
2018-04-15 06:30:13.123+0000 WARN Unknown config option: ha.host.coordination
2018-04-15 06:30:13.124+0000 WARN Unknown config option: causal_clustering.transaction_advertised_address
2018-04-15 06:30:13.124+0000 WARN Unknown config option: causal_clustering.discovery_advertised_address
2018-04-15 06:30:13.124+0000 WARN Unknown config option: ha.host.data
2018-04-15 06:30:13.124+0000 WARN Unknown config option: causal_clustering.transaction_listen_address
2018-04-15 06:30:13.146+0000 INFO ======== Neo4j 3.3.3 ========
2018-04-15 06:30:13.186+0000 INFO Starting...
2018-04-15 06:30:13.997+0000 INFO Bolt enabled on 0.0.0.0:7687.
2018-04-15 06:30:14.094+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@44a59da3' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /var/lib/neo4j/data/databases/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@44a59da3' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /var/lib/neo4j/data/databases/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@44a59da3' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /var/lib/neo4j/data/databases/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)".

有人对 Neo4j 的 docker 实现有经验吗?这是一个单线程问题,意味着我需要以不同于容器的方式调用 CLI 工具吗?

最佳答案

neo4j status仅当您使用 neo4j start 启动 neo4j 时,该命令才有效. Start 创建一个 neo4j.pid 文件,status 使用该文件查看 neo4j 是否正在运行。在 docker 下启动使用控制台选项而不是启动选项。这不会创建 PID 文件,因此状态不起作用。但这并不重要,因为 neo4j 几乎是唯一运行的进程;如果 neo4j 死亡,容器将退出。如果 docker ps -a表示容器已启动,然后 neo4j 已启动。

关于docker - 从 docker 容器启动 neo4j 显示 "Neo4j is not running",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49839153/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com