-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
162 lines (150 loc) · 4.31 KB
/
Copy pathdocker-compose.yml
File metadata and controls
162 lines (150 loc) · 4.31 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
# A production-shaped minimum in one command. Every Orbita process serves the
# worker path; the object-store bootstrap certificate selects three Raft voters.
# Adding node-4 adds worker capacity without editing or restarting node-1..3.
name: orbita
x-orbita-image: &orbita-image
build:
context: .
dockerfile: Dockerfile
image: orbita:local
x-common-env: &common-env
ORBITA_NODE_ROLE: node
ORBITA_CLUSTER_NAME: quickstart
ORBITA_VOTER_TARGET: "3"
ORBITA_LISTEN: 0.0.0.0:7100
ORBITA_PEER_LISTEN: 0.0.0.0:7101
ORBITA_DATA_DIR: /var/lib/orbita
ORBITA_LOG_LEVEL: info
ORBITA_OBJECT_STORE_ENDPOINT: http://minio:9000
ORBITA_OBJECT_STORE_BUCKET: orbita
ORBITA_OBJECT_STORE_REGION: us-east-1
ORBITA_OBJECT_STORE_ACCESS_KEY_ID: orbita
ORBITA_OBJECT_STORE_SECRET_ACCESS_KEY: orbita-quickstart
ORBITA_OBJECT_STORE_FORCE_PATH_STYLE: "true"
x-orbita-healthcheck: &orbita-healthcheck
healthcheck:
test: ["CMD", "/usr/local/bin/orbita", "--endpoint", "http://127.0.0.1:7100", "cluster", "ready"]
interval: 5s
timeout: 5s
retries: 24
start_period: 10s
services:
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: orbita
MINIO_ROOT_PASSWORD: orbita-quickstart
ports:
- "127.0.0.1:9001:9001"
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 3s
retries: 20
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "mc alias set local http://minio:9000 orbita orbita-quickstart &&
mc mb --ignore-existing local/orbita"
node-1:
<<: [*orbita-image, *orbita-healthcheck]
command: ["serve", "--role", "node"]
environment:
<<: *common-env
ORBITA_NODE_ID: "1"
ORBITA_ADVERTISE: node-1:7100
ORBITA_PEER_ADVERTISE: node-1:7101
ORBITA_FAILURE_DOMAIN: compose-1
ports:
- "127.0.0.1:7100:7100"
volumes:
- node-1-data:/var/lib/orbita
depends_on:
minio-init:
condition: service_completed_successfully
node-2:
<<: [*orbita-image, *orbita-healthcheck]
command: ["serve", "--role", "node"]
environment:
<<: *common-env
ORBITA_NODE_ID: "2"
ORBITA_ADVERTISE: node-2:7100
ORBITA_PEER_ADVERTISE: node-2:7101
ORBITA_FAILURE_DOMAIN: compose-2
volumes:
- node-2-data:/var/lib/orbita
depends_on:
minio-init:
condition: service_completed_successfully
node-3:
<<: [*orbita-image, *orbita-healthcheck]
command: ["serve", "--role", "node"]
environment:
<<: *common-env
ORBITA_NODE_ID: "3"
ORBITA_ADVERTISE: node-3:7100
ORBITA_PEER_ADVERTISE: node-3:7101
ORBITA_FAILURE_DOMAIN: compose-3
volumes:
- node-3-data:/var/lib/orbita
depends_on:
minio-init:
condition: service_completed_successfully
# Optional capacity. `docker compose --profile capacity up -d node-4` joins
# it as a worker while the voter set remains at the configured target of 3.
node-4:
<<: [*orbita-image, *orbita-healthcheck]
profiles: ["capacity"]
command: ["serve", "--role", "node"]
environment:
<<: *common-env
ORBITA_NODE_ID: "4"
ORBITA_ADVERTISE: node-4:7100
ORBITA_PEER_ADVERTISE: node-4:7101
ORBITA_FAILURE_DOMAIN: compose-4
volumes:
- node-4-data:/var/lib/orbita
depends_on:
minio-init:
condition: service_completed_successfully
cli:
<<: *orbita-image
profiles: ["cli"]
environment:
ORBITA_ENDPOINT: http://node-1:7100
entrypoint: ["/usr/local/bin/orbita"]
command: ["--help"]
depends_on:
node-1:
condition: service_healthy
smoke:
<<: *orbita-image
profiles: ["smoke"]
environment:
ORBITA_ENDPOINT: http://node-1:7100
entrypoint: ["/bin/sh", "-c"]
command:
- |
set -eu
orbita keyspace create demo
for attempt in 1 2 3 4 5 6 7 8 9 10; do
orbita set demo greeting hello && break
sleep 1
done
orbita get demo greeting
orbita cluster describe
depends_on:
node-1:
condition: service_healthy
volumes:
minio-data:
node-1-data:
node-2-data:
node-3-data:
node-4-data: