Skip to content

Commit 0a4ac89

Browse files
FranckPachotoskardudycz
authored andcommitted
Add nodes to distribute
1 parent 97f91b9 commit 0a4ac89

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

samples/simple-ts/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ with PostgreSQL:
1414
```bash
1515
docker-compose up
1616
```
17-
Alternatively, with YugabyteDB (PostgreSQL-compatible distributed SQL)
17+
Alternatively, with YugabyteDB (PostgreSQL-compatible distributed SQL) starting 3 nodes:
1818
```bash
19-
docker-compose -f docker-compose-yugabytedb.yml up
19+
docker-compose -f docker-compose-yugabytedb.yml up -d --scale dist=0
20+
docker-compose -f docker-compose-yugabytedb.yml up -d --scale dist=1
21+
docker-compose -f docker-compose-yugabytedb.yml up -d --scale dist=2
2022
```
2123

2224
You need to install packages with

samples/simple-ts/docker-compose-yugabytedb.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
version: "3.8" # Specify Docker Compose version
22

33
services:
4-
postgres:
4+
yugabytedb:
55
image: yugabytedb/yugabyte:latest
66
command: yugabyted start --background=false --ysql_port=5432
77
ports:
88
- "5432:5432"
9+
- "15433:15433"
10+
healthcheck:
11+
interval: 15s
12+
timeout: 3s
13+
test: postgres/bin/pg_isready -h yugabytedb -p 5432
14+
15+
dist:
16+
image: yugabytedb/yugabyte:latest
17+
command: yugabyted start --join yugabytedb --background=false --ysql_port=5432
18+
deploy:
19+
replicas: 0
20+
restart_policy:
21+
condition: on-failure
22+
depends_on:
23+
yugabytedb:
24+
condition: service_healthy
925

1026
pgadmin:
1127
container_name: pgadmin_container
@@ -23,5 +39,6 @@ services:
2339
- ./docker/pgAdmin/pgpass:/pgpass
2440
- ./docker/pgAdmin/servers.json:/pgadmin4/servers.json
2541
depends_on:
26-
- postgres
42+
yugabytedb:
43+
condition: service_healthy
2744
restart: unless-stopped

0 commit comments

Comments
 (0)