Skip to content

Commit 82969c7

Browse files
authored
init cockroach cluster settings in indexer docker-compose (#175)
1 parent 567b0ae commit 82969c7

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

indexer/docker-compose.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "3.4"
1+
version: "3.8"
22

33
services:
44
db:
@@ -11,9 +11,21 @@ services:
1111
volumes:
1212
- /cockroach/cockroach-data
1313

14-
ingest:
14+
db-init:
1515
depends_on:
1616
- db
17+
image: cockroachdb/cockroach:v22.2.2
18+
19+
volumes:
20+
- ./setup_db.sh:/setup_db.sh
21+
entrypoint: "/bin/bash"
22+
command: /setup_db.sh
23+
restart: on-failure
24+
25+
ingest:
26+
depends_on:
27+
db-init:
28+
condition: service_completed_successfully
1729
restart: on-failure
1830
image: subsquid/substrate-ingest:1
1931
volumes:
@@ -34,7 +46,8 @@ services:
3446

3547
gateway:
3648
depends_on:
37-
- db
49+
db-init:
50+
condition: service_completed_successfully
3851
image: subsquid/substrate-gateway:2.5.0
3952
environment:
4053
DATABASE_MAX_CONNECTIONS: 5
@@ -44,6 +57,9 @@ services:
4457
- "8888:8000"
4558

4659
explorer:
60+
depends_on:
61+
db-init:
62+
condition: service_completed_successfully
4763
image: subsquid/substrate-explorer:firesquid
4864
environment:
4965
DB_TYPE: cockroach

indexer/setup_db.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
sleep 2
3+
echo "Set sql.conn.max_read_buffer_message_size to 32 MiB"
4+
5+
HOSTPARAMS="--host db --insecure"
6+
SQL="/cockroach/cockroach.sh sql $HOSTPARAMS"
7+
8+
# https://github.com/threefoldtech/tfchain_graphql/issues/130#issuecomment-1689987550
9+
$SQL -e "SET CLUSTER SETTING sql.conn.max_read_buffer_message_size = '32MiB';"

0 commit comments

Comments
 (0)