由于我无法让Neo4j Contanier工作,我认为我的docker-compose.yml中存在问题
当我运行这个命令(docker-compose up -d
),它的工作.
当我尝试计算通过Dijkstra
的最短路径时,出现如下错误
org.neo4j.driver.exceptions.ClientException: There is no procedure with the name `apoc.algo.dijkstra` registered for this database instance.
Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
我该如何修复它?
version: '3'
services:
neo4j-db:
image: neo4j:4.1
container_name: app-neo4j-db
ports:
- 7474:7474
- 7687:7687
volumes:
- $HOME/neo4j/data:/data
- $HOME/neo4j/logs:/logs
- $HOME/neo4j/import:/import
- $HOME/neo4j/plugins:/plugins
environment:
NEO4J_AUTH: "neo4j/123456"
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_dbms_security_procedures_unrestricted: apoc.\\\*,gds.\\\*
dbms_connector_bolt_listen__address: neo4j-db:7687
dbms_connector_bolt_advertised__address: neo4j-db:7687
healthcheck:
test: cypher-shell --username neo4j --password 123456 'MATCH (n) RETURN COUNT(n);' # Checks if neo4j server is up and running
interval: 10s
timeout: 10s
retries: 5
app:
image: 'springbootneo4jshortestpath:latest'
build:
context: .
dockerfile: Dockerfile
container_name: SpringBootNeo4jShortestPath
depends_on:
neo4j-db:
condition: service_healthy # Wait for neo4j to be ready
links:
- neo4j-db
environment:
NEO4J_URI: bolt://neo4j-db:7687
NEO4J_USER: neo4j
NEO4J_PASSWORD: 123456
volumes:
app-neo4j-db:
下面是我的项目链接:Link
1条答案
按热度按时间vuktfyat1#
https://docs.docker.com/compose/compose-file/compose-file-v3/#environment
它应该是:
或
此外,您不能在NEO4JLABS_PLUGINS中分配数组,最好引用值,例如:“新版本”