docker 部署 neo4j

本文详细介绍了如何从DockerHub拉取Neo4j镜像,使用docker-compose配置并启动容器,以及查看容器状态、日志和通过浏览器访问Neo4j的部署过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 获取neo4j镜像

拉取镜像

test@yfq image_detection % docker pull neo4j

Using default tag: latest
latest: Pulling from library/neo4j
latest: Pulling from library/neo4j
7d97e254a046: Pull complete 
732d09690fed: Pull complete 
e8cba66f5b65: Pull complete 
9e41d761a8cf: Pull complete 
33a66ada74dc: Pull complete 
Digest: sha256:eb36a96ef2d67050c92ca53109f10e0f24ac920971e58cdd0bf81aaec84a02e9
Status: Downloaded newer image for neo4j:latest
docker.io/library/neo4j:latest

检查拉到的镜像

test@yfq neo4j % docker images | grep neo4j

neo4j           latest    e03a2a7d1b29   5 days ago    495MB

2. 创建容器,部署neo4j

编写 docker-compose.txt 文件

version: '2.4'
services:
     spread:
      image: 'neo4j:latest'
      #restart: always
      container_name: neo4j_v1
      ports:
        - 7474:7474
        - 7687:7687
      volumes:
        - /data/neo4j/:/neo4j/  # 映射为自己的目录
      working_dir: /neo4j/

启动容器

docker-compose -f docker-compose.txt up -d

查看容器运行状态和日志

testo@yfq neo4j % docker ps | grep neo4j_v1

2c0466b641b1   neo4j:latest   "tini -g -- /startup…"   13 minutes ago   Up 13 minutes   0.0.0.0:7474->7474/tcp, 7473/tcp, 0.0.0.0:7687->7687/tcp   neo4j_v1
test@yfq neo4j % docker logs -f --tail 100 neo4j_v1
        
2023-09-12 09:38:40.651+0000 INFO  Starting...
2023-09-12 09:38:41.673+0000 INFO  This instance is ServerId{9fdb69c7} (9fdb69c7-64a7-44dd-b064-424c7b2f4bc7)
2023-09-12 09:38:42.500+0000 INFO  ======== Neo4j 5.11.0 ========
2023-09-12 09:38:44.810+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2023-09-12 09:38:45.732+0000 INFO  Remote interface available at http://localhost:7474/
2023-09-12 09:38:45.735+0000 INFO  id: 15BD17FE10F86D426C3FF13E7CE65FC6406D375DB32DC6CE3F8420F61F9DCFFA
2023-09-12 09:38:45.736+0000 INFO  name: system
2023-09-12 09:38:45.736+0000 INFO  creationDate: 2023-09-12T09:38:43.159Z
2023-09-12 09:38:45.736+0000 INFO  Started.

查看neo4j部署情况

浏览器输入:http://localhost:7474/browser/
在这里插入图片描述

neo4j部署完成

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值