nebula-docker-compose v2.6.0 启动失败

  • nebula 版本:2.6.0
  • 部署方式:单机
  • 操作系统:CentOS Linux release 7.9.2009 (Core)
  • 安装方式:Docker
  • docker版本:1.13.1
    image
  • docker-compose版本:1.18.0
    image
  • 是否为线上版本:N

问题描述:我试着在CentOS7的虚拟机部署nebula的docker版,但是一直无法正常启动。下面是启动时的日志,里面提到了Permission denied,于是我将logs文件的权限改为了rwx模式,但仍然会出现相同的错误信息。
另外,我在论坛里找到了请教 Nebula Graph 2.0 Docker Compose 安装问题这个帖子,里面有相似的问题但没有具体的解决办法,请问这个问题该如何解决呢?

[ytkj@192 nebula-docker-compose]$ docker-compose up
Recreating nebuladockercompose_metad0_1 ... 
Recreating nebuladockercompose_metad1_1 ... 
Recreating nebuladockercompose_metad1_1 ... done
Recreating nebuladockercompose_storaged2_1 ... 
Recreating nebuladockercompose_storaged1_1 ... 
Recreating nebuladockercompose_storaged2_1 ... done
Recreating nebuladockercompose_graphd1_1 ... 
Recreating nebuladockercompose_graphd_1 ... 
Recreating nebuladockercompose_graphd_1 ... done
Attaching to nebuladockercompose_metad0_1, nebuladockercompose_metad2_1, nebuladockercompose_metad1_1, nebuladockercompose_storaged1_1, nebuladockercompose_storaged0_1, nebuladockercompose_storaged2_1, nebuladockercompose_graphd1_1, nebuladockercompose_graphd2_1, nebuladockercompose_graphd_1
metad2_1     | WARNING: Logging before InitGoogleLogging() is written to STDERR
metad2_1     | E1109 08:55:36.578418     1 MetaDaemon.cpp:203] Failed to create or open `/logs/metad-stdout.log': Permission denied
metad0_1     | WARNING: Logging before InitGoogleLogging() is written to STDERR
metad0_1     | E1109 08:55:36.486173     1 MetaDaemon.cpp:203] Failed to create or open `/logs/metad-stdout.log': Permission denied
metad1_1     | WARNING: Logging before InitGoogleLogging() is written to STDERR
metad1_1     | E1109 08:55:36.644002     1 MetaDaemon.cpp:203] Failed to create or open `/logs/metad-stdout.log': Permission denied
storaged1_1  | WARNING: Logging before InitGoogleLogging() is written to STDERR
storaged1_1  | E1109 08:55:38.011570     1 StorageDaemon.cpp:65] Failed to create or open `/logs/storaged-stdout.log': Permission denied
nebuladockercompose_metad0_1 exited with code 1
storaged0_1  | WARNING: Logging before InitGoogleLogging() is written to STDERR
storaged0_1  | E1109 08:55:38.076349     1 StorageDaemon.cpp:65] Failed to create or open `/logs/storaged-stdout.log': Permission denied
nebuladockercompose_metad2_1 exited with code 1
nebuladockercompose_metad1_1 exited with code 1
nebuladockercompose_storaged1_1 exited with code 1
storaged2_1  | WARNING: Logging before InitGoogleLogging() is written to STDERR
storaged2_1  | E1109 08:55:38.153842     1 StorageDaemon.cpp:65] Failed to create or open `/logs/storaged-stdout.log': Permission denied
graphd1_1    | Could not create logging file: Permission denied
graphd1_1    | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!Could not create logging file: Permission denied
graphd1_1    | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!Could not create logging file: Permission denied
graphd1_1    | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!E1109 08:55:39.380911     1 GraphDaemon.cpp:74] Failed to create or open `/logs/graphd-stdout.log': Permission denied
nebuladockercompose_storaged0_1 exited with code 1
graphd2_1    | Could not create logging file: Permission denied
graphd2_1    | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!Could not create logging file: Permission denied
graphd2_1    | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!Could not create logging file: Permission denied
graphd2_1    | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!E1109 08:55:39.453431     1 GraphDaemon.cpp:74] Failed to create or open `/logs/graphd-stdout.log': Permission denied
graphd_1     | Could not create logging file: Permission denied
graphd_1     | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!Could not create logging file: Permission denied
graphd_1     | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!Could not create logging file: Permission denied
graphd_1     | COULD NOT CREATE A LOGGINGFILE 20221109-085539.1!E1109 08:55:39.476969     1 GraphDaemon.cpp:74] Failed to create or open `/logs/graphd-stdout.log': Permission denied
nebuladockercompose_storaged2_1 exited with code 1
nebuladockercompose_graphd1_1 exited with code 1
nebuladockercompose_graphd2_1 exited with code 1
nebuladockercompose_graphd_1 exited with code 1

要不试试申请试用云吧

感谢建议,但是我现在的需求就是离线部署

参考了docker-compose的volume映射发生Permission denied的解决这篇文章,现在可以正常启动了。
解决方式就是在docker-compose.yaml文件内的每个容器中都加上privileged: true字段,这样就不会出现Permission denied的错误而能够正常启动。
我的docker-compose.yaml文件内容如下:

version: '3.4'
services:
  metad0:
    image: vesoft/nebula-metad:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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
      - 19559
      - 19560
    volumes:
      - ./data/meta0:/data/meta
      - ./logs/meta0:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  metad1:
    image: vesoft/nebula-metad:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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
      - 19560
    volumes:
      - ./data/meta1:/data/meta
      - ./logs/meta1:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  metad2:
    image: vesoft/nebula-metad:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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
    volumes:
      - ./data/meta2:/data/meta
      - ./logs/meta2:/logs
    networks:
      - nebula-net
    cap_add:
      - SYS_PTRACE

  storaged0:
    image: vesoft/nebula-storaged:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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:v2.6.0
    environment:
      USER: root
      TZ:   "${TZ}"
    privileged: true
    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

networks:
  nebula-net:


感觉这也算个issue,官方要不考虑更新下docker-compose?