Skip to content

Commit

Permalink
Add nodes to distribute
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckPachot authored and oskardudycz committed Jul 12, 2024
1 parent 97f91b9 commit 0a4ac89
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
6 changes: 4 additions & 2 deletions samples/simple-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ with PostgreSQL:
```bash
docker-compose up
```
Alternatively, with YugabyteDB (PostgreSQL-compatible distributed SQL)
Alternatively, with YugabyteDB (PostgreSQL-compatible distributed SQL) starting 3 nodes:
```bash
docker-compose -f docker-compose-yugabytedb.yml up
docker-compose -f docker-compose-yugabytedb.yml up -d --scale dist=0
docker-compose -f docker-compose-yugabytedb.yml up -d --scale dist=1
docker-compose -f docker-compose-yugabytedb.yml up -d --scale dist=2
```

You need to install packages with
Expand Down
21 changes: 19 additions & 2 deletions samples/simple-ts/docker-compose-yugabytedb.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
version: "3.8" # Specify Docker Compose version

services:
postgres:
yugabytedb:
image: yugabytedb/yugabyte:latest
command: yugabyted start --background=false --ysql_port=5432
ports:
- "5432:5432"
- "15433:15433"
healthcheck:
interval: 15s
timeout: 3s
test: postgres/bin/pg_isready -h yugabytedb -p 5432

dist:
image: yugabytedb/yugabyte:latest
command: yugabyted start --join yugabytedb --background=false --ysql_port=5432
deploy:
replicas: 0
restart_policy:
condition: on-failure
depends_on:
yugabytedb:
condition: service_healthy

pgadmin:
container_name: pgadmin_container
Expand All @@ -23,5 +39,6 @@ services:
- ./docker/pgAdmin/pgpass:/pgpass
- ./docker/pgAdmin/servers.json:/pgadmin4/servers.json
depends_on:
- postgres
yugabytedb:
condition: service_healthy
restart: unless-stopped

0 comments on commit 0a4ac89

Please sign in to comment.