docker 部署 nebula-storaged-listener

提问参考模版:

  • nebula 版本:v3.1.0
  • 部署方式:单机
  • 安装方式: Docker
  • 是否为线上版本:N
  • 硬件信息
    • 磁盘 SSD
    • CPU、内存信息 4G i7
  • 问题的具体描述
    SHOW LISTENER; OFFLINE ,日志无报错

  • 相关的 meta / storage / graph info 日志信息(尽量使用文本形式方便检索)
    ES
    image



docker-compose.yaml 文件信息

version: '3.4'
services:
  metad0:
    image: vesoft/nebula-metad:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad0
      - --ws_ip=metad0
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad0:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "9559:9559"
      - 19559
      - 19560
    volumes:
      - ./data/meta0:/data/meta
      - ./logs/meta0:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  metad1:
    image: vesoft/nebula-metad:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad1
      - --ws_ip=metad1
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad1:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9559
      - "19559:19559"
      - 19560
    volumes:
      - ./data/meta1:/data/meta
      - ./logs/meta1:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  metad2:
    image: vesoft/nebula-metad:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad2
      - --ws_ip=metad2
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad2:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9559
      - 19559
      - "19560:19560"
    volumes:
      - ./data/meta2:/data/meta
      - ./logs/meta2:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  storaged0:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged0
      - --ws_ip=storaged0
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./data/storage0:/data/storage
      - ./logs/storage0:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  storaged1:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged1
      - --ws_ip=storaged1
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged1:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./data/storage1:/data/storage
      - ./logs/storage1:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  storaged2:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged2
      - --ws_ip=storaged2
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged2:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./data/storage2:/data/storage
      - ./logs/storage2:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  graphd:
    image: vesoft/nebula-graphd:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd
      - --ws_ip=graphd
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "9669:9669"
      - 19669
      - 19670
    volumes:
      - ./logs/graph:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  graphd1:
    image: vesoft/nebula-graphd:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd1
      - --ws_ip=graphd1
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd1:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9669
      - 19669
      - 19670
    volumes:
      - ./logs/graph1:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  graphd2:
    image: vesoft/nebula-graphd:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd2
      - --ws_ip=graphd2
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd2:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9669
      - 19669
      - 19670
    volumes:
      - ./logs/graph2:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE
  
  console:
    image: vesoft/nebula-console:v3.0.0
    entrypoint: ""
    command: 
      - sh
      - -c
      - |
        sleep 3 &&
        nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779' &&
        sleep 36000
    depends_on:
      - graphd
    networks:
      - nebula-net
  listener0:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ:   "${TZ}"
    entrypoint:
      - sh
      - -c
    command:
      - /usr/local/nebula/bin/nebula-storaged --flagfile /data/nebula-docker-compose/nebula-storaged-listener.conf
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://listener0:19789/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "9789:9789"
      - 19789
      - 19790
    volumes:
      - ./config/nebula-storaged-listener0.conf:/data/nebula-docker-compose/nebula-storaged-listener.conf
      - ./data/listener0:/data/listener
      - ./logs/listener0:/logs_listener
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  listener1:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    entrypoint:
      - sh
      - -c
    command:
      - /usr/local/nebula/bin/nebula-storaged --flagfile /data/nebula-docker-compose/nebula-storaged-listener.conf
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://listener1:19789/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9789
      - "19789:19789"
      - 19790
    volumes:
      - ./config/nebula-storaged-listener1.conf:/data/nebula-docker-compose/nebula-storaged-listener.conf
      - ./data/listener1:/data/listener
      - ./logs/listener1:/logs_listener
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  listener2:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    entrypoint:
      - sh
      - -c
    command:
      - /usr/local/nebula/bin/nebula-storaged --flagfile /data/nebula-docker-compose/nebula-storaged-listener.conf
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://listener2:19789/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9789
      - 19789
      - "19790:19790"
    volumes:
      - ./config/nebula-storaged-listener2.conf:/data/nebula-docker-compose/nebula-storaged-listener.conf
      - ./data/listener2:/data/listener
      - ./logs/listener2:/logs_listener
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

networks:
  nebula-net:

nebula-storaged-listener0.conf 文件信息

########## nebula-storaged-listener ###########
########## basics ##########
# Whether to run as a daemon process
--daemonize=false
# The file to host the process id
--pid_file=pids_listener/nebula-storaged.pid

########## logging ##########
# The directory to host logging files
--log_dir=/logs_listener
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
# Verbose log level, 1, 2, 3, 4, the higher of the level, the more verbose of the logging
--v=4
# Maximum seconds to buffer the log messages
--logbufsecs=0
# Whether to redirect stdout and stderr to separate output files
--redirect_stdout=true
# Destination filename of stdout and stderr, which will also reside in log_dir.
--stdout_log_file=storaged-stdout.log
--stderr_log_file=storaged-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
--stderrthreshold=2

########## networking ##########
# Meta server address
--meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
# Local ip
--local_ip=listener0
# Storage daemon listening port
--port=9789
# HTTP service ip
--ws_ip=listener0
# HTTP service port
--ws_http_port=19789
# HTTP2 service port
--ws_h2_port=19790
# heartbeat with meta service
--heartbeat_interval_secs=10

########## storage ##########
# Listener wal directory. only one path is allowed.
--listener_path=data/listener
# This parameter can be ignored for compatibility. let's fill A default value of "data"
--data_path=data/storage
# The type of part manager, [memory | meta]
--part_man_type=memory
# The default reserved bytes for one batch operation
--rocksdb_batch_size=4096
# The default block cache size used in BlockBasedTable.
# The unit is MB.
--rocksdb_block_cache=4
# The type of storage engine, `rocksdb', `memory', etc.
--engine_type=rocksdb
# The type of part, `simple', `consensus'...
--part_type=simple

nebula-storaged-listener1.conf

########## nebula-storaged-listener ###########
########## basics ##########
# Whether to run as a daemon process
--daemonize=false
# The file to host the process id
--pid_file=pids_listener/nebula-storaged.pid

########## logging ##########
# The directory to host logging files
--log_dir=/logs_listener
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
# Verbose log level, 1, 2, 3, 4, the higher of the level, the more verbose of the logging
--v=4
# Maximum seconds to buffer the log messages
--logbufsecs=0
# Whether to redirect stdout and stderr to separate output files
--redirect_stdout=true
# Destination filename of stdout and stderr, which will also reside in log_dir.
--stdout_log_file=storaged-stdout.log
--stderr_log_file=storaged-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
--stderrthreshold=2

########## networking ##########
# Meta server address
--meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
# Local ip
--local_ip=listener1
# Storage daemon listening port
--port=9789
# HTTP service ip
--ws_ip=listener1
# HTTP service port
--ws_http_port=19789
# HTTP2 service port
--ws_h2_port=19790
# heartbeat with meta service
--heartbeat_interval_secs=10

########## storage ##########
# Listener wal directory. only one path is allowed.
--listener_path=data/listener
# This parameter can be ignored for compatibility. let's fill A default value of "data"
--data_path=data/storage
# The type of part manager, [memory | meta]
--part_man_type=memory
# The default reserved bytes for one batch operation
--rocksdb_batch_size=4096
# The default block cache size used in BlockBasedTable.
# The unit is MB.
--rocksdb_block_cache=4
# The type of storage engine, `rocksdb', `memory', etc.
--engine_type=rocksdb
# The type of part, `simple', `consensus'...
--part_type=simple

nebula-storaged-listener2.conf 文件信息

########## nebula-storaged-listener ###########
########## basics ##########
# Whether to run as a daemon process
--daemonize=false
# The file to host the process id
--pid_file=pids_listener/nebula-storaged.pid

########## logging ##########
# The directory to host logging files
--log_dir=/logs_listener
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
# Verbose log level, 1, 2, 3, 4, the higher of the level, the more verbose of the logging
--v=4
# Maximum seconds to buffer the log messages
--logbufsecs=0
# Whether to redirect stdout and stderr to separate output files
--redirect_stdout=true
# Destination filename of stdout and stderr, which will also reside in log_dir.
--stdout_log_file=storaged-stdout.log
--stderr_log_file=storaged-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
--stderrthreshold=2

########## networking ##########
# Meta server address
--meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
# Local ip
--local_ip=listener2
# Storage daemon listening port
--port=9789
# HTTP service ip
--ws_ip=listener2
# HTTP service port
--ws_http_port=19789
# HTTP2 service port
--ws_h2_port=19790
# heartbeat with meta service
--heartbeat_interval_secs=10

########## storage ##########
# Listener wal directory. only one path is allowed.
--listener_path=data/listener
# This parameter can be ignored for compatibility. let's fill A default value of "data"
--data_path=data/storage
# The type of part manager, [memory | meta]
--part_man_type=memory
# The default reserved bytes for one batch operation
--rocksdb_batch_size=4096
# The default block cache size used in BlockBasedTable.
# The unit is MB.
--rocksdb_block_cache=4
# The type of storage engine, `rocksdb', `memory', etc.
--engine_type=rocksdb
# The type of part, `simple', `consensus'...
--part_type=simple

https://docs.nebula-graph.com.cn/3.1.0/4.deployment-and-installation/6.deploy-text-based-index/3.deploy-listener/
手册中指出 添加listner时,必须使用ip

而在docker环境中只有域名,此处可以这样绕过:

  1. 先用域名将docker启动起来;
  2. 登录到listener节点,kill对应的storage-listener进程;
  3. 重新启动listener节点,启动命令带入参数 将local_ip和ws_ip 由域名替换成listener对应的ip。
  4. 重新add listener,写入对应的ip

我还没有确认过,确定 listener 只支持 ip 不支持域名么?我在这里看上下文感觉是想提醒不要留 127.0.0.1 的默认配置的意思。而且我知道所有其他 role (agent, host)都是支持域名的哈。

可以进到 listener1 容器里边,打一个 ps -ef | grep nebula 我看下他的启动 command 么?对应的 conf 是哪一个?

看你的 docker-compose.yaml 里,三个 listener 的配置文件是同一个,并没有区分,这样应该不行,配置里有具体的地址的信息,实际上是对应的三个不同的配置?

换成ip就报错

三个不同的配置文件,实际是一样的,在单台机器上面部署的

docker compose 里虽然是单机,但是每一个 container 是有单独的 hostname/ip 的,三个都配置成一样,理论上最多只有一个才能正常工作,能提供一下 listenr.conf 么,上边你放的 01,02,03 的是被这里实际用到的么,看ps 结果不是的。

配置里要么写 listener01 要么写 它对应的容器网络ip (在容器里 ping listener01,应该是 172.xxx 网段的),无论写的哪一个,要和 add listener 命令里的字符对应上哈。

麻烦了哈
找到问题了,添添加 listener 到 Nebula Graph 集群,用错了端口

1 个赞

端口

端口改对后,用add listener 后面用的是ip还是listener1?

listerer1

version: '3.4'
services:

  metad0:
    image: vesoft/nebula-metad:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad0
      - --ws_ip=metad0
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad0:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "9559:9559"
      - 19559
      - 19560
    volumes:
      - ./data/meta0:/data/meta
      - ./logs/meta0:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  metad1:
    image: vesoft/nebula-metad:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad1
      - --ws_ip=metad1
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad1:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9559
      - "19559:19559"
      - 19560
    volumes:
      - ./data/meta1:/data/meta
      - ./logs/meta1:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  metad2:
    image: vesoft/nebula-metad:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad2
      - --ws_ip=metad2
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad2:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9559
      - 19559
      - "19560:19560"
    volumes:
      - ./data/meta2:/data/meta
      - ./logs/meta2:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  storaged0:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged0
      - --ws_ip=storaged0
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./data/storage0:/data/storage
      - ./logs/storage0:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  storaged1:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged1
      - --ws_ip=storaged1
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged1:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./data/storage1:/data/storage
      - ./logs/storage1:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  storaged2:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged2
      - --ws_ip=storaged2
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged2:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./data/storage2:/data/storage
      - ./logs/storage2:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  graphd:
    image: vesoft/nebula-graphd:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd
      - --ws_ip=graphd
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "9669:9669"
      - 19669
      - 19670
    volumes:
      - ./logs/graph:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  graphd1:
    image: vesoft/nebula-graphd:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd1
      - --ws_ip=graphd1
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd1:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9669
      - 19669
      - 19670
    volumes:
      - ./logs/graph1:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  graphd2:
    image: vesoft/nebula-graphd:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd2
      - --ws_ip=graphd2
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=0
      - --minloglevel=0
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd2:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9669
      - 19669
      - 19670
    volumes:
      - ./logs/graph2:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  console:
    image: vesoft/nebula-console:v3.0.0
    entrypoint: ""
    command:
      - sh
      - -c
      - |
        sleep 3 &&
        nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779' &&
        sleep 36000
    depends_on:
      - graphd
    networks:
      - nebula-net

  listener0:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    entrypoint:
      - sh
      - -c
    command:
      - /usr/local/nebula/bin/nebula-storaged --flagfile /data/nebula-docker-compose/nebula-storaged-listener.conf
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://listener0:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./config/nebula-storaged-listener0.conf:/data/nebula-docker-compose/nebula-storaged-listener.conf
      - ./data/listener0:/data/listener
      - ./logs/listener0:/logs_listener
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  listener1:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    entrypoint:
      - sh
      - -c
    command:
      - /usr/local/nebula/bin/nebula-storaged --flagfile /data/nebula-docker-compose/nebula-storaged-listener.conf
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://listener1:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./config/nebula-storaged-listener1.conf:/data/nebula-docker-compose/nebula-storaged-listener.conf
      - ./data/listener1:/data/listener
      - ./logs/listener1:/logs_listener
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  listener2:
    image: vesoft/nebula-storaged:v3.1.0
    environment:
      USER: root
      TZ: Asia/Shanghai
    entrypoint:
      - sh
      - -c
    command:
      - /usr/local/nebula/bin/nebula-storaged --flagfile /data/nebula-docker-compose/nebula-storaged-listener.conf
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://listener2:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - ./config/nebula-storaged-listener2.conf:/data/nebula-docker-compose/nebula-storaged-listener.conf
      - ./data/listener2:/data/listener
      - ./logs/listener2:/logs_listener
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  elasticsearch:
    image: 'elasticsearch:7.12.0'
    container_name: elasticsearch
    environment:
      - USER=root
      - TZ=Asia/Shanghai
      - discovery.type=single-node
      - 'ES_JAVA_OPTS=-Xms84m -Xmx512m'
    ports:
      - '9200:9200'
      - '9300:9300'
    volumes:
      - './elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml'
      - './elasticsearch/data:/usr/share/elasticsearch/data'
      - './elasticsearch/plugins:/usr/share/elasticsearch/plugins'
    networks:
      - nebula-net

networks:
  nebula-net:

ADD LISTENER ELASTICSEARCH “listener0”:9779,“listener1”:9779,“listener2”:9779;

2 个赞