无法通过 docker-compose 文件使用 Docker Swarm 将 neo4j 服务部署为 docker 堆栈
Failing to deploy a neo4j service as a docker stack using Docker Swarm via a docker-compose file
我正在尝试将 docker-compose.yml(我知道版本和服务未说明,它们是文件的一部分)文件配置到 运行 neo4j 实例.我正在使用 docker swarm 并部署堆栈,即使用以下命令:
docker 集群初始化
docker stack deploy -c docker-compose.yml neo
note_db:
image: neo4j:latest
environment:
- NEO4J_AUTH=<username>/<password>
- NEO4J_dbms_mode=CORE
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_connector_http_listen__address=:7474
- NEO4J_dbms_connector_https_listen__address=:6477
- NEO4J_dbms_connector_bolt_listen__address=:7687
ports:
- "7474:7474"
- "6477:6477"
- "7687:7687"
volumes:
- type: bind
source: ~/neo4j/data
target: /data
- type: bind
source: ~/neo4j/logs
target: /logs
deploy:
replicas: 1
resources:
limits:
cpus: "0.1"
memory: 120M
restart_policy:
condition: on-failure
我省略了用户名和密码。我目前只尝试启动一个实例,因为我仍在测试。我删除了 NEO4J_AUTH 和 NEO4J_AUTH=none,结果相同。
日志提供以下内容:
org.neo4j.commandline.admin.CommandFailed: initial password was not set because live Neo4j-users were detected., at org.neo4j.commandline.admin.security.SetInitialPasswordCommand.setPasswor (SetInitialPasswordCommand.java:83)
command failed: initial password was not set because live Neo4j-users were detected.,
Starting Neo4j.,
2018-09-17 16:12:39.396+0000 INFO ======== Neo4j 3.4.7 ========,
2018-09-17 16:12:41.990+0000 INFO Starting...,
2018-09-17 16:12:43.792+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@70b0b186' was successfully initialized, but failed to start. Please see the attached cause exception "/logs/debug.log (Permission denied)".
在 debug.log 文件中,我发现的唯一内容是:
[o.n.b.s.a.BasicAuthentication] Failed authentication attempt for 'neo4j'
(没有其他故障、错误或警告)。
显然,我遇到了某种身份验证问题,但我不确定错误出在哪里以及如何解决。我已经尝试 NEO4J_AUTH=none
并完全删除 ENV,它仍然不起作用。
有人发布了与此问题相关的内容,但尚未收到任何回复。我希望我的也是。
来自用户:logisima
您的身份验证没有任何问题,这是权限问题:cause exception "/logs/debug.log (Permission denied)"
我正在尝试将 docker-compose.yml(我知道版本和服务未说明,它们是文件的一部分)文件配置到 运行 neo4j 实例.我正在使用 docker swarm 并部署堆栈,即使用以下命令:
docker 集群初始化
docker stack deploy -c docker-compose.yml neo
note_db:
image: neo4j:latest
environment:
- NEO4J_AUTH=<username>/<password>
- NEO4J_dbms_mode=CORE
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_connector_http_listen__address=:7474
- NEO4J_dbms_connector_https_listen__address=:6477
- NEO4J_dbms_connector_bolt_listen__address=:7687
ports:
- "7474:7474"
- "6477:6477"
- "7687:7687"
volumes:
- type: bind
source: ~/neo4j/data
target: /data
- type: bind
source: ~/neo4j/logs
target: /logs
deploy:
replicas: 1
resources:
limits:
cpus: "0.1"
memory: 120M
restart_policy:
condition: on-failure
我省略了用户名和密码。我目前只尝试启动一个实例,因为我仍在测试。我删除了 NEO4J_AUTH 和 NEO4J_AUTH=none,结果相同。
日志提供以下内容:
org.neo4j.commandline.admin.CommandFailed: initial password was not set because live Neo4j-users were detected., at org.neo4j.commandline.admin.security.SetInitialPasswordCommand.setPasswor (SetInitialPasswordCommand.java:83)
command failed: initial password was not set because live Neo4j-users were detected.,
Starting Neo4j.,
2018-09-17 16:12:39.396+0000 INFO ======== Neo4j 3.4.7 ========,
2018-09-17 16:12:41.990+0000 INFO Starting...,
2018-09-17 16:12:43.792+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@70b0b186' was successfully initialized, but failed to start. Please see the attached cause exception "/logs/debug.log (Permission denied)".
在 debug.log 文件中,我发现的唯一内容是:
[o.n.b.s.a.BasicAuthentication] Failed authentication attempt for 'neo4j'
(没有其他故障、错误或警告)。
显然,我遇到了某种身份验证问题,但我不确定错误出在哪里以及如何解决。我已经尝试 NEO4J_AUTH=none
并完全删除 ENV,它仍然不起作用。
有人发布了与此问题相关的内容,但尚未收到任何回复。我希望我的也是。
来自用户:logisima
您的身份验证没有任何问题,这是权限问题:cause exception "/logs/debug.log (Permission denied)"