-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.multi-node.yml
More file actions
177 lines (169 loc) · 4.53 KB
/
docker-compose.multi-node.yml
File metadata and controls
177 lines (169 loc) · 4.53 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
# Docker Compose configuration for multi-node SPACE deployment
#
# This sets up a 3-node SPACE mesh for testing multi-node capabilities:
# - Node 1 (Seed): Initial seed node for the mesh
# - Node 2: Joins mesh via seed node
# - Node 3: Joins mesh via seed node
#
# Each node runs with:
# - PODMS orchestrator (gossip + scaling + replication)
# - S3 protocol gateway
# - Web interface for monitoring
# - Prometheus metrics
#
# Usage:
# docker-compose -f docker-compose.multi-node.yml up --build
#
# Access points:
# - Node 1 S3: http://localhost:9001
# - Node 1 Web: http://localhost:8081
# - Node 2 S3: http://localhost:9002
# - Node 2 Web: http://localhost:8082
# - Node 3 S3: http://localhost:9003
# - Node 3 Web: http://localhost:8083
version: '3.8'
services:
# Node 1 - Seed Node
space-node-1:
build:
context: .
dockerfile: Dockerfile
container_name: space-node-1
hostname: node-1
environment:
- SPACE_NODE_ID=node-1
- SPACE_ZONE=us-west-metro
- SPACE_LISTEN_ADDR=0.0.0.0:9000
- SPACE_S3_PORT=9001
- SPACE_WEB_PORT=8081
- SPACE_SEED_PEERS=
- SPACE_DEFAULT_POLICY=metro-sync
- SPACE_GOSSIP_FANOUT=8
- RUST_LOG=info,space=debug,podms_orchestrator=debug
ports:
- "9001:9001" # S3 API
- "8081:8081" # Web UI
- "9000:9000" # Mesh replication
volumes:
- space-node-1-data:/data
networks:
space-mesh:
ipv4_address: 172.20.0.10
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
interval: 10s
timeout: 5s
retries: 3
# Node 2 - Joins via seed
space-node-2:
build:
context: .
dockerfile: Dockerfile
container_name: space-node-2
hostname: node-2
environment:
- SPACE_NODE_ID=node-2
- SPACE_ZONE=us-west-metro
- SPACE_LISTEN_ADDR=0.0.0.0:9000
- SPACE_S3_PORT=9002
- SPACE_WEB_PORT=8082
- SPACE_SEED_PEERS=172.20.0.10:9000
- SPACE_DEFAULT_POLICY=metro-sync
- SPACE_GOSSIP_FANOUT=8
- RUST_LOG=info,space=debug,podms_orchestrator=debug
ports:
- "9002:9002" # S3 API
- "8082:8082" # Web UI
- "9100:9000" # Mesh replication
volumes:
- space-node-2-data:/data
networks:
space-mesh:
ipv4_address: 172.20.0.11
depends_on:
- space-node-1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082/health"]
interval: 10s
timeout: 5s
retries: 3
# Node 3 - Joins via seed
space-node-3:
build:
context: .
dockerfile: Dockerfile
container_name: space-node-3
hostname: node-3
environment:
- SPACE_NODE_ID=node-3
- SPACE_ZONE=us-west-metro
- SPACE_S3_PORT=9003
- SPACE_WEB_PORT=8083
- SPACE_LISTEN_ADDR=0.0.0.0:9000
- SPACE_SEED_PEERS=172.20.0.10:9000
- SPACE_DEFAULT_POLICY=metro-sync
- SPACE_GOSSIP_FANOUT=8
- RUST_LOG=info,space=debug,podms_orchestrator=debug
ports:
- "9003:9003" # S3 API
- "8083:8083" # Web UI
- "9200:9000" # Mesh replication
volumes:
- space-node-3-data:/data
networks:
space-mesh:
ipv4_address: 172.20.0.12
depends_on:
- space-node-1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083/health"]
interval: 10s
timeout: 5s
retries: 3
# Prometheus for metrics collection
prometheus:
image: prom/prometheus:latest
container_name: space-prometheus
volumes:
- ./deploy/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
ports:
- "9090:9090"
networks:
- space-mesh
depends_on:
- space-node-1
- space-node-2
- space-node-3
# Grafana for visualization
grafana:
image: grafana/grafana:latest
container_name: space-grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=space
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./deploy/grafana-dashboards:/etc/grafana/provisioning/dashboards
- ./deploy/grafana-datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
networks:
- space-mesh
depends_on:
- prometheus
networks:
space-mesh:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
space-node-1-data:
space-node-2-data:
space-node-3-data:
prometheus-data:
grafana-data: