docker从头安装neo4j
时间: 2023-10-09 18:05:44 浏览: 138
要从头安装Neo4j,您可以按照以下步骤进行操作:
1. 首先,创建一个Docker网络,使用以下命令:
```
docker network create --driver=bridge --subnet=172.43.0.0/16 neo4j
```
2. 创建Neo4j目录,使用以下命令:
```
mkdir -p /neo4j
```
3. 创建一个名为docker-compose.yml的启动脚本,并将以下内容添加到文件中:
```
version: '3.1'
services:
neo4j:
image: neo4j:4.1.1
container_name: neo4j
hostname: openldap
privileged: true
restart: always
environment:
- NEO4J_AUTH=neo4j/neo4j123
ports:
- "7474:7474"
- "7687:7687"
volumes:
- ./data:/var/lib/neo4j/data
- ./logs:/var/lib/neo4j/logs
- ./conf:/var/lib/neo4j/conf
- ./mnt:/var/lib/neo4j/import
- ./plugins:/var/lib/neo4j/plugins
networks:
neo4j:
ipv4_address: 172.43.0.20
networks:
neo4j:
external: true
```
4. 执行安装命令,使用以下命令:
```
docker-compose up -d
```
5. 您可以使用以下命令查看容器名称:
```
docker ps -a
```
6. 为了进入容器,使用以下命令,并替换"neo4j"为容器名称:
```
docker exec -it neo4j /bin/bash
```
7. 最后,您可以通过访问http://ip:7474,使用用户名"neo4j"和密码"neo4j123"来访问Neo4j。请确保将"ip"替换为您的实际IP地址。
这样,您就完成了从头安装Neo4j的过程。如果您还想安装Neo4j的APOC插件,您可以使用以下命令来运行具有APCOC插件的Neo4j的Docker容器:
```
docker run umbag/neo4j -e NEO4J_dbms_security_procedures_unrestricted=apoc.*
```
希望以上信息对您有所帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [docker-compose neo4j install](https://blog.csdn.net/hanzheng260561728/article/details/107997480)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [neo4j-apoc:安装了APOC插件的Neo4J Docker映像](https://download.csdn.net/download/weixin_42131405/18278611)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文