Last active
July 31, 2025 07:59
-
-
Save wey-gu/8876b17a2d72ef0fbc7d108d426d3910 to your computer and use it in GitHub Desktop.
NebulaGraph StorageD expose dev env
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| services: | |
| metad0: | |
| image: docker.io/vesoft/nebula-metad:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103:9559 | |
| - --local_ip=192.168.1.101 | |
| - --ws_ip=192.168.1.101 | |
| - --port=9559 | |
| - --ws_http_port=19559 | |
| - --data_path=/data/meta | |
| - --log_dir=/logs | |
| - --v=0 | |
| - --minloglevel=0 | |
| healthcheck: | |
| test: ["CMD", "curl", "-sf", "http://192.168.1.101:19559/status"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 20s | |
| ports: | |
| - 9559 | |
| - 19559 | |
| - 19560 | |
| volumes: | |
| - ./data/meta0:/data/meta | |
| - ./logs/meta0:/logs | |
| networks: | |
| devnet: | |
| ipv4_address: 192.168.1.101 | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| metad1: | |
| image: docker.io/vesoft/nebula-metad:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103:9559 | |
| - --local_ip=192.168.1.102 | |
| - --ws_ip=192.168.1.102 | |
| - --port=9559 | |
| - --ws_http_port=19559 | |
| - --data_path=/data/meta | |
| - --log_dir=/logs | |
| - --v=0 | |
| - --minloglevel=0 | |
| healthcheck: | |
| test: ["CMD", "curl", "-sf", "http://192.168.1.102:19559/status"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 20s | |
| ports: | |
| - 9559 | |
| - 19559 | |
| - 19560 | |
| volumes: | |
| - ./data/meta1:/data/meta | |
| - ./logs/meta1:/logs | |
| networks: | |
| devnet: | |
| ipv4_address: 192.168.1.102 | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| metad2: | |
| image: docker.io/vesoft/nebula-metad:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103:9559 | |
| - --local_ip=192.168.1.103 | |
| - --ws_ip=192.168.1.103 | |
| - --port=9559 | |
| - --ws_http_port=19559 | |
| - --data_path=/data/meta | |
| - --log_dir=/logs | |
| - --v=0 | |
| - --minloglevel=0 | |
| healthcheck: | |
| test: ["CMD", "curl", "-sf", "http://192.168.1.103:19559/status"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 20s | |
| ports: | |
| - 9559 | |
| - 19559 | |
| - 19560 | |
| volumes: | |
| - ./data/meta2:/data/meta | |
| - ./logs/meta2:/logs | |
| networks: | |
| devnet: | |
| ipv4_address: 192.168.1.103 | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| storaged0: | |
| image: docker.io/vesoft/nebula-storaged:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103:9559 | |
| - --local_ip=192.168.1.111 | |
| - --ws_ip=192.168.1.111 | |
| - --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://192.168.1.111:19779/status"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 20s | |
| ports: | |
| - 9779 | |
| - 19779 | |
| - 19780 | |
| volumes: | |
| - ./data/storage0:/data/storage | |
| - ./logs/storage0:/logs | |
| networks: | |
| devnet: | |
| ipv4_address: 192.168.1.111 | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| storaged1: | |
| image: docker.io/vesoft/nebula-storaged:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103:9559 | |
| - --local_ip=192.168.1.112 | |
| - --ws_ip=192.168.1.112 | |
| - --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://192.168.1.112:19779/status"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 20s | |
| ports: | |
| - 9779 | |
| - 19779 | |
| - 19780 | |
| volumes: | |
| - ./data/storage1:/data/storage | |
| - ./logs/storage1:/logs | |
| networks: | |
| devnet: | |
| ipv4_address: 192.168.1.112 | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| storaged2: | |
| image: docker.io/vesoft/nebula-storaged:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103:9559 | |
| - --local_ip=192.168.1.113 | |
| - --ws_ip=192.168.1.113 | |
| - --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://192.168.1.113:19779/status"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 20s | |
| ports: | |
| - 9779 | |
| - 19779 | |
| - 19780 | |
| volumes: | |
| - ./data/storage2:/data/storage | |
| - ./logs/storage2:/logs | |
| networks: | |
| devnet: | |
| ipv4_address: 192.168.1.113 | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| graphd: | |
| image: docker.io/vesoft/nebula-graphd:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103: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: | |
| - "29669:9669" | |
| - 19669 | |
| - 19670 | |
| volumes: | |
| - ./logs/graph:/logs | |
| networks: | |
| - devnet | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| graphd1: | |
| image: docker.io/vesoft/nebula-graphd:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103: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: | |
| - devnet | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| graphd2: | |
| image: docker.io/vesoft/nebula-graphd:nightly | |
| environment: | |
| USER: root | |
| command: | |
| - --meta_server_addrs=192.168.1.101:9559,192.168.1.102:9559,192.168.1.103: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: | |
| - devnet | |
| restart: on-failure | |
| cap_add: | |
| - SYS_PTRACE | |
| console: | |
| image: docker.io/vesoft/nebula-console:nightly | |
| entrypoint: "" | |
| command: | |
| - sh | |
| - -c | |
| - | | |
| for i in `seq 1 60`;do | |
| var=`nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "192.168.1.111":9779,"192.168.1.112":9779,"192.168.1.113":9779'`; | |
| if [[ $$? == 0 ]];then | |
| break; | |
| fi; | |
| sleep 1; | |
| echo "retry to add hosts."; | |
| done && tail -f /dev/null; | |
| depends_on: | |
| - graphd | |
| networks: | |
| - devnet | |
| networks: | |
| devnet: | |
| external: true | |
| name: devnet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo ip addr add 192.168.1.101/24 dev eth0 | |
| sudo ip addr add 192.168.1.102/24 dev eth0 | |
| sudo ip addr add 192.168.1.103/24 dev eth0 | |
| sudo ip addr add 192.168.1.111/24 dev eth0 | |
| sudo ip addr add 192.168.1.112/24 dev eth0 | |
| sudo ip addr add 192.168.1.113/24 dev eth0 | |
| docker network create --subnet=192.168.1.0/24 devnet | |
| # Allow inbound and outbound traffic for all required IPs and ports TCP | |
| for ip in 192.168.1.101 192.168.1.102 192.168.1.103 192.168.1.111 192.168.1.112 192.168.1.113; do | |
| for port in 9559 19559 19560 9779 19779 19780 9669 19669 19670; do | |
| sudo iptables -A INPUT -p tcp -s $ip --sport $port -j ACCEPT | |
| sudo iptables -A INPUT -p tcp -d $ip --dport $port -j ACCEPT | |
| sudo iptables -A OUTPUT -p tcp -d $ip --dport $port -j ACCEPT | |
| sudo iptables -A OUTPUT -p tcp -s $ip --sport $port -j ACCEPT | |
| done | |
| done | |
| # Optionally allow related and established connections | |
| sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
| sudo iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment