-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
183 lines (176 loc) · 4.49 KB
/
docker-compose.yml
File metadata and controls
183 lines (176 loc) · 4.49 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
services:
pd0:
container_name: surrealdb-pd0
hostname: pd0
image: pingcap/pd:v8.5.0
ports:
- "2379"
volumes:
- data:/data
- logs:/logs
command:
- --name=pd0
- --client-urls=http://0.0.0.0:2379
- --peer-urls=http://0.0.0.0:2380
- --advertise-client-urls=http://pd0:2379
- --advertise-peer-urls=http://pd0:2380
- --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
- --data-dir=/data/pd0
- --log-file=/logs/pd0.log
restart: on-failure
healthcheck:
test: /pd-ctl health | jq -e ".[] | select(.name == \"$(hostname)\").health"
start_period: 5s
retries: 5
timeout: 10s
pd1:
container_name: surrealdb-pd1
hostname: pd1
image: pingcap/pd:v8.5.0
ports:
- "2379"
volumes:
- data:/data
- logs:/logs
command:
- --name=pd1
- --client-urls=http://0.0.0.0:2379
- --peer-urls=http://0.0.0.0:2380
- --advertise-client-urls=http://pd1:2379
- --advertise-peer-urls=http://pd1:2380
- --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
- --data-dir=/data/pd1
- --log-file=/logs/pd1.log
restart: on-failure
healthcheck:
test: /pd-ctl health | jq -e ".[] | select(.name == \"$(hostname)\").health"
start_period: 5s
retries: 5
timeout: 10s
pd2:
container_name: surrealdb-pd2
hostname: pd2
image: pingcap/pd:v8.5.0
ports:
- "2379"
volumes:
- data:/data
- logs:/logs
command:
- --name=pd2
- --client-urls=http://0.0.0.0:2379
- --peer-urls=http://0.0.0.0:2380
- --advertise-client-urls=http://pd2:2379
- --advertise-peer-urls=http://pd2:2380
- --initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380
- --data-dir=/data/pd2
- --log-file=/logs/pd2.log
restart: on-failure
healthcheck:
test: /pd-ctl health | jq -e ".[] | select(.name == \"$(hostname)\").health"
start_period: 5s
retries: 5
timeout: 10s
tikv0:
container_name: surrealdb-tikv0
hostname: tikv0
image: pingcap/tikv:v8.5.0
volumes:
- data:/data
- logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv0:20160
- --status-addr=0.0.0.0:20180
- --data-dir=/data/tikv0
- --pd=pd0:2379,pd1:2379,pd2:2379
- --log-file=/logs/tikv0.log
depends_on:
pd0:
condition: service_healthy
pd1:
condition: service_healthy
pd2:
condition: service_healthy
restart: on-failure
healthcheck:
test: /tikv-ctl --host $(hostname):20160 metrics
start_period: 5s
retries: 5
timeout: 10s
tikv1:
container_name: surrealdb-tikv1
hostname: tikv1
image: pingcap/tikv:v8.5.0
volumes:
- data:/data
- logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv1:20160
- --status-addr=0.0.0.0:20180
- --data-dir=/data/tikv1
- --pd=pd0:2379,pd1:2379,pd2:2379
- --log-file=/logs/tikv1.log
depends_on:
pd0:
condition: service_healthy
pd1:
condition: service_healthy
pd2:
condition: service_healthy
restart: on-failure
healthcheck:
test: /tikv-ctl --host $(hostname):20160 metrics
start_period: 5s
retries: 5
timeout: 10s
tikv2:
container_name: surrealdb-tikv2
hostname: tikv2
image: pingcap/tikv:v8.5.0
volumes:
- data:/data
- logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv2:20160
- --status-addr=0.0.0.0:20180
- --data-dir=/data/tikv2
- --pd=pd0:2379,pd1:2379,pd2:2379
- --log-file=/logs/tikv2.log
depends_on:
pd0:
condition: service_healthy
pd1:
condition: service_healthy
pd2:
condition: service_healthy
restart: on-failure
healthcheck:
test: /tikv-ctl --host $(hostname):20160 metrics
start_period: 5s
retries: 5
timeout: 10s
surrealdb:
image: surrealdb/surrealdb:latest
container_name: surrealdb
ports:
- "8000:8000"
command:
- start
- --log=trace
- --user=root
- --pass=root
- tikv://pd0:2379
depends_on:
tikv0:
condition: service_healthy
tikv1:
condition: service_healthy
tikv2:
condition: service_healthy
restart: always
volumes:
data: {}
logs: {}