-
Notifications
You must be signed in to change notification settings - Fork 80
/
docker-compose-lite.yaml
162 lines (155 loc) · 4.51 KB
/
docker-compose-lite.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: '3.4'
services:
metad0:
image: docker.io/vesoft/nebula-metad:nightly
environment:
USER: root
command:
- --meta_server_addrs=metad0:9559
- --local_ip=metad0
- --ws_ip=metad0
- --port=9559
- --ws_http_port=19559
- --data_path=/data/meta
# - --log_dir=/logs
# log to stderr not file
- --logtostderr=true
- --redirect_stdout=false
# log to stderr not file
- --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:19559
- 19560
volumes:
- ./data/meta0:/data/meta
# - ./logs/meta0:/logs
networks:
- nebula-net
restart: on-failure
cap_add:
- SYS_PTRACE
storaged0:
image: docker.io/vesoft/nebula-storaged:nightly
environment:
USER: root
command:
- --meta_server_addrs=metad0:9559
- --local_ip=storaged0
- --ws_ip=storaged0
- --port=9779
- --ws_http_port=19779
- --data_path=/data/storage
# - --log_dir=/logs
# log to stderr not file
- --logtostderr=true
- --redirect_stdout=false
# log to stderr not file
- --v=0
- --minloglevel=0
depends_on:
- metad0
healthcheck:
test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- 9779:9779
- 19779:19779
- 19780
volumes:
- ./data/storage0:/data/storage
# - ./logs/storage0:/logs
networks:
- nebula-net
restart: on-failure
cap_add:
- SYS_PTRACE
graphd:
image: docker.io/vesoft/nebula-graphd:nightly
environment:
USER: root
command:
- --meta_server_addrs=metad0:9559
- --port=9669
- --local_ip=graphd
- --ws_ip=graphd
- --ws_http_port=19669
# - --log_dir=/logs
# log to stderr not file
- --logtostderr=true
- --redirect_stdout=false
# log to stderr not file
- --v=0
- --minloglevel=0
depends_on:
- storaged0
healthcheck:
test: ["CMD", "curl", "-sf", "http://graphd:19669/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- 9669:9669
- 19669:19669
- 19670
# volumes:
# - ./logs/graph:/logs
networks:
- nebula-net
restart: on-failure
cap_add:
- SYS_PTRACE
storage-activator:
# This is just a script to activate storaged for the first time run by calling nebula-console
# Refer to https://docs.nebula-graph.io/master/4.deployment-and-installation/manage-storage-host/#activate-storaged
# If you like to call console via docker, run:
# docker run --rm -ti --network host vesoft/nebula-console:nightly -addr 127.0.0.1 -port 9669 -u root -p nebula
image: docker.io/vesoft/nebula-console:nightly
entrypoint: ""
environment:
ACTIVATOR_RETRY: ${ACTIVATOR_RETRY:-30}
command:
- sh
- -c
- |
for i in `seq 1 $$ACTIVATOR_RETRY`; do
nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779' 1>/dev/null 2>/dev/null;
if [[ $$? == 0 ]]; then
echo "✔️ Storage activated successfully.";
break;
else
output=$$(nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779' 2>&1);
if echo "$$output" | grep -q "Existed"; then
echo "✔️ Storage already activated, Exiting...";
break;
fi
fi;
if [[ $$i -lt $$ACTIVATOR_RETRY ]]; then
echo "⏳ Attempting to activate storaged, attempt $$i/$$ACTIVATOR_RETRY... It's normal to take some attempts before storaged is ready. Please wait.";
else
echo "❌ Failed to activate storaged after $$ACTIVATOR_RETRY attempts. Please check MetaD, StorageD logs. Or restart the storage-activator service to continue retry.";
echo "ℹ️ Error during storage activation:"
echo "=============================================================="
echo "$$output"
echo "=============================================================="
break;
fi;
sleep 5;
done && tail -f /dev/null;
depends_on:
- graphd
networks:
- nebula-net
networks:
nebula-net: