Repository navigation
Expand file tree
/
Copy pathdocker-compose-cluster.yml
More file actions
118 lines (112 loc) · 3.39 KB
/
Copy pathdocker-compose-cluster.yml
File metadata and controls
118 lines (112 loc) · 3.39 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
# Docker Compose for TAG Cluster
#
# TAG uses embedded OCache - each TAG node has its own embedded cache that
# forms a distributed cluster via gossip protocol and gRPC for routing.
#
# Usage:
# export AWS_ACCESS_KEY_ID=<your-key>
# export AWS_SECRET_ACCESS_KEY=<your-secret>
# docker compose -f docker-compose-cluster.yml up -d
x-tag-common: &tag-common
build:
context: .
dockerfile: Dockerfile
image: tigrisdata/tag:latest
restart: unless-stopped
networks:
- tag-cluster
services:
# TAG Node 1 (with embedded cache)
tag-1:
<<: *tag-common
container_name: tag-1
hostname: tag-1
ports:
- "8081:8080"
- "9001:9000" # gRPC for cache routing
- "7001:7000" # Cluster gossip
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- TAG_UPSTREAM_ENDPOINT=${TAG_UPSTREAM_ENDPOINT:-https://t3.storage.dev}
- TAG_CACHE_NODE_ID=tag-1
- TAG_CACHE_DISK_PATH=/data/cache
- TAG_CACHE_CLUSTER_ADDR=:7000
- TAG_CACHE_GRPC_ADDR=:9000
- TAG_CACHE_ADVERTISE_ADDR=tag-1:9000
- TAG_CACHE_SEED_NODES=tag-1:7000,tag-2:7000,tag-3:7000
- TAG_LOG_LEVEL=${TAG_LOG_LEVEL:-info}
volumes:
- tag-1-cache:/data/cache
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
# TAG Node 2 (with embedded cache)
tag-2:
<<: *tag-common
container_name: tag-2
hostname: tag-2
ports:
- "8082:8080"
- "9002:9000" # gRPC for cache routing
- "7002:7000" # Cluster gossip
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- TAG_UPSTREAM_ENDPOINT=${TAG_UPSTREAM_ENDPOINT:-https://t3.storage.dev}
- TAG_CACHE_NODE_ID=tag-2
- TAG_CACHE_DISK_PATH=/data/cache
- TAG_CACHE_CLUSTER_ADDR=:7000
- TAG_CACHE_GRPC_ADDR=:9000
- TAG_CACHE_ADVERTISE_ADDR=tag-2:9000
- TAG_CACHE_SEED_NODES=tag-1:7000,tag-2:7000,tag-3:7000
- TAG_LOG_LEVEL=${TAG_LOG_LEVEL:-info}
volumes:
- tag-2-cache:/data/cache
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
depends_on:
- tag-1
# TAG Node 3 (with embedded cache)
tag-3:
<<: *tag-common
container_name: tag-3
hostname: tag-3
ports:
- "8083:8080"
- "9003:9000" # gRPC for cache routing
- "7003:7000" # Cluster gossip
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- TAG_UPSTREAM_ENDPOINT=${TAG_UPSTREAM_ENDPOINT:-https://t3.storage.dev}
- TAG_CACHE_NODE_ID=tag-3
- TAG_CACHE_DISK_PATH=/data/cache
- TAG_CACHE_CLUSTER_ADDR=:7000
- TAG_CACHE_GRPC_ADDR=:9000
- TAG_CACHE_ADVERTISE_ADDR=tag-3:9000
- TAG_CACHE_SEED_NODES=tag-1:7000,tag-2:7000,tag-3:7000
- TAG_LOG_LEVEL=${TAG_LOG_LEVEL:-info}
volumes:
- tag-3-cache:/data/cache
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
depends_on:
- tag-2
networks:
tag-cluster:
volumes:
tag-1-cache:
tag-2-cache:
tag-3-cache: