无法通过docker-compose文件使用Docker Swarm将neo4j服务部署为docker堆栈

时间:2018-09-17 20:37:53

标签: docker neo4j docker-swarm docker-stack

我正在尝试配置docker-compose.yml(我知道版本和服务未声明,它们不在文件中)文件来​​运行neo4j实例。我正在使用docker swarm并部署堆栈,即使用以下命令:

docker swarm初始化

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,但仍然无法正常工作。

有人对此问题发表了一些看法,但是他们没有收到任何回应。我希望我能做到。

1 个答案:

答案 0 :(得分:0)

FROM用户:logisima

您在auth上没有任何问题,这是一个权限问题:cause exception "/logs/debug.log (Permission denied)"