Skip to content

Commit d8ef17d

Browse files
example: introduce Tarantool 3 cluster
Introduce Tarantool 3 cluster for manual Tarantool 3 dashboard check-up and screenshot making (for repo, PRs and official pages). Part of #224
1 parent 5499d7e commit d8ef17d

File tree

9 files changed

+1152
-0
lines changed

9 files changed

+1152
-0
lines changed

docker-compose.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
services:
2+
app:
3+
build:
4+
context: ./example_cluster/tarantool3_project
5+
dockerfile: app.Dockerfile
6+
networks:
7+
tarantool_dashboard_dev:
8+
ports:
9+
- 13301:13301
10+
- 13302:13302
11+
- 13303:13303
12+
- 13304:13304
13+
- 13305:13305
14+
- 8081:8081
15+
- 8082:8082
16+
- 8083:8083
17+
- 8084:8084
18+
- 8085:8085
19+
20+
load_generator:
21+
build:
22+
context: ./example_cluster/tarantool3_project
23+
dockerfile: load.Dockerfile
24+
networks:
25+
tarantool_dashboard_dev:
26+
27+
telegraf:
28+
image: telegraf:1.13-alpine
29+
networks:
30+
tarantool_dashboard_dev:
31+
volumes:
32+
# configure telegraf to work out of the box
33+
- ./example_cluster/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
34+
35+
influxdb:
36+
image: influxdb:1.7-alpine
37+
environment:
38+
INFLUXDB_REPORTING_DISABLED: "true"
39+
INFLUXDB_DB: "metrics"
40+
INFLUXDB_ADMIN_USER: "admin"
41+
INFLUXDB_ADMIN_PASSWORD: "admin"
42+
INFLUXDB_USER: "telegraf"
43+
INFLUXDB_USER_PASSWORD: "telegraf"
44+
INFLUXDB_HTTP_AUTH_ENABLED: "true"
45+
networks:
46+
tarantool_dashboard_dev:
47+
ports:
48+
- 8086:8086
49+
50+
prometheus:
51+
image: prom/prometheus:v2.17.2
52+
networks:
53+
tarantool_dashboard_dev:
54+
ports:
55+
- 9090:9090
56+
volumes:
57+
- ./example_cluster/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
58+
- ./example_cluster/prometheus/alerts.yml:/etc/prometheus/alerts.yml
59+
60+
grafana:
61+
image: grafana/grafana:8.1.3
62+
environment:
63+
GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true"
64+
GF_AUTH_ANONYMOUS_ENABLED: "true"
65+
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
66+
GF_AUTH_DISABLE_SIGNOUT_MENU: "true"
67+
GF_AUTH_DISABLE_LOGIN_FORM: "true"
68+
networks:
69+
tarantool_dashboard_dev:
70+
ports:
71+
- 3000:3000
72+
volumes:
73+
- ./example_cluster/grafana/provisioning:/etc/grafana/provisioning
74+
# Map to different folders to prevent name collision.
75+
- ./tests/Prometheus/dashboard_compiled.json:/usr/lib/dashboards/Prometheus-common/dashboard.json
76+
- ./tests/Prometheus/dashboard_static_compiled.json:/usr/lib/dashboards/Prometheus-static/dashboard.json
77+
- ./tests/Prometheus/dashboard_static_with_instance_variable_compiled.json:/usr/lib/dashboards/Prometheus-static-var/dashboard.json
78+
- ./tests/InfluxDB/dashboard_compiled.json:/usr/lib/dashboards/InfluxDB-common/dashboard.json
79+
- ./tests/InfluxDB/dashboard_static_compiled.json:/usr/lib/dashboards/InfluxDB-static/dashboard.json
80+
- ./tests/InfluxDB/dashboard_static_with_instance_variable_compiled.json:/usr/lib/dashboards/InfluxDB-static-var/dashboard.json
81+
82+
networks:
83+
tarantool_dashboard_dev:
84+
driver: bridge
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM golang:1.22-bullseye
2+
3+
WORKDIR /app
4+
5+
RUN DEBIAN_FRONTEND=noninteractive apt update
6+
RUN DEBIAN_FRONTEND=noninteractive apt install -y git \
7+
cmake \
8+
make \
9+
gcc \
10+
g++ \
11+
unzip \
12+
curl
13+
COPY . .
14+
RUN mkdir -p tmp
15+
16+
RUN curl -L https://tarantool.io/release/3/installer.sh | bash
17+
RUN DEBIAN_FRONTEND=noninteractive apt install -y tarantool tarantool-dev tt
18+
19+
RUN tt init
20+
# Need tt log
21+
RUN DEBIAN_FRONTEND=noninteractive apt install -y git patch
22+
RUN git clone https://github.com/magefile/mage && \
23+
cd mage && \
24+
go run bootstrap.go
25+
RUN tt install tt master
26+
27+
RUN tt rocks make
28+
ENTRYPOINT tt start && tt log -f
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
credentials:
2+
users:
3+
admin:
4+
password: 'secret'
5+
roles: [super]
6+
replicator:
7+
password: 'secret'
8+
roles: [replication]
9+
storage:
10+
password: 'secret'
11+
roles: [sharding]
12+
13+
sharding:
14+
bucket_count: 3000
15+
16+
groups:
17+
routers:
18+
sharding:
19+
roles: [router]
20+
app:
21+
module: router
22+
roles:
23+
- roles.crud-router
24+
- roles.pseudoapp
25+
roles_cfg:
26+
roles.crud-router:
27+
stats: true
28+
stats_driver: metrics
29+
stats_quantiles: true
30+
replicasets:
31+
routers:
32+
instances:
33+
router:
34+
roles_cfg:
35+
roles.pseudoapp:
36+
listen: 0.0.0.0:8081
37+
iproto:
38+
listen:
39+
- uri: 0.0.0.0:13301
40+
advertise:
41+
peer:
42+
login: replicator
43+
uri: localhost:13301
44+
sharding:
45+
login: storage
46+
uri: localhost:13301
47+
client: localhost:13301
48+
storages:
49+
sharding:
50+
roles: [storage]
51+
roles:
52+
- roles.crud-storage
53+
- roles.pseudoapp
54+
replication:
55+
failover: manual
56+
replicasets:
57+
storages_1:
58+
leader: storage_1_master
59+
instances:
60+
storage_1_master:
61+
roles_cfg:
62+
roles.pseudoapp:
63+
listen: 0.0.0.0:8082
64+
iproto:
65+
listen:
66+
- uri: 0.0.0.0:13302
67+
advertise:
68+
peer:
69+
login: replicator
70+
uri: localhost:13302
71+
sharding:
72+
login: storage
73+
uri: localhost:13302
74+
client: localhost:13302
75+
storage_1_replica:
76+
roles_cfg:
77+
roles.pseudoapp:
78+
listen: 0.0.0.0:8083
79+
iproto:
80+
listen:
81+
- uri: 0.0.0.0:13303
82+
advertise:
83+
peer:
84+
login: replicator
85+
uri: localhost:13303
86+
sharding:
87+
login: storage
88+
uri: localhost:13303
89+
client: localhost:13303
90+
storages_2:
91+
leader: storage_2_master
92+
instances:
93+
storage_2_master:
94+
roles_cfg:
95+
roles.pseudoapp:
96+
listen: 0.0.0.0:8084
97+
iproto:
98+
listen:
99+
- uri: 0.0.0.0:13304
100+
advertise:
101+
peer:
102+
login: replicator
103+
uri: localhost:13304
104+
sharding:
105+
login: storage
106+
uri: localhost:13304
107+
client: localhost:13304
108+
storage_2_replica:
109+
roles_cfg:
110+
roles.pseudoapp:
111+
listen: 0.0.0.0:8085
112+
iproto:
113+
listen:
114+
- uri: 0.0.0.0:13305
115+
advertise:
116+
peer:
117+
login: replicator
118+
uri: localhost:13305
119+
sharding:
120+
login: storage
121+
uri: localhost:13305
122+
client: localhost:13305

0 commit comments

Comments
 (0)