Skip to content

Commit af96e67

Browse files
feat: support run script by setting postgres version and decode plugin
1 parent 0e0583c commit af96e67

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

demo-consumer.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
export PG_VERSION=${PG_VERSION:-14}
4+
export DECODE_PLUGIN=${DECODE_PLUGIN:-pgoutput}
5+
36
docker-compose run --rm wait-demo-consumer-deps
47

58
docker exec pulsar sh -c "bin/pulsar-admin namespaces create public/pgcapture; bin/pulsar-admin topics create persistent://public/pgcapture/postgres"

demo-scheduler.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
export PG_VERSION=${PG_VERSION:-14}
4+
export DECODE_PLUGIN=${DECODE_PLUGIN:-pgoutput}
5+
36
docker-compose run --rm wait-demo-scheduler-deps
47
docker exec pulsar sh -c "bin/pulsar-admin namespaces create public/pgcapture; bin/pulsar-admin topics create persistent://public/pgcapture/postgres"
58

docker-compose.yml

+23-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
version: "3.8"
22
services:
33
postgres_source:
4-
build: postgres
5-
image: "kennychenfight/postgres:11-logical"
4+
build:
5+
context: postgres
6+
dockerfile: ${PG_VERSION}/Dockerfile
7+
image: "kennychenfight/postgres:${PG_VERSION}-logical"
68
container_name: "postgres_source"
79
ports:
810
- "5432:5432"
@@ -13,7 +15,10 @@ services:
1315
- ./postgres:/pgc
1416

1517
postgres_sink:
16-
image: "kennychenfight/postgres:11-logical"
18+
build:
19+
context: postgres
20+
dockerfile: ${PG_VERSION}/Dockerfile
21+
image: "kennychenfight/postgres:${PG_VERSION}-logical"
1722
container_name: "postgres_sink"
1823
ports:
1924
- "5433:5432"
@@ -28,8 +33,8 @@ services:
2833
container_name: pulsar
2934
command: ["bin/pulsar", "standalone"]
3035
ports:
31-
- 6650:6650
32-
- 8080:8080
36+
- "6650:6650"
37+
- "8080:8080"
3338

3439
pulsar-ui:
3540
image: apachepulsar/pulsar-manager:v0.2.0
@@ -45,36 +50,42 @@ services:
4550
- ./pulsar/application.properties:/pulsar-manager/pulsar-manager/application.properties
4651

4752
pg2pulsar:
48-
image: rueian/pgcapture:v0.0.40
53+
image: rueian/pgcapture:latest
4954
container_name: "pg2pulsar"
50-
command: [ "pg2pulsar", "--PGConnURL=postgres://postgres@postgres_source:5432/postgres?sslmode=disable", "--PGReplURL=postgres://postgres@postgres_source:5432/postgres?sslmode=disable&replication=database", "--PulsarURL=pulsar://pulsar:6650", "--PulsarTopic=persistent://public/pgcapture/postgres"]
55+
command:
56+
- "pg2pulsar"
57+
- "--PGConnURL=postgres://postgres@postgres_source:5432/postgres?sslmode=disable"
58+
- "--PGReplURL=postgres://postgres@postgres_source:5432/postgres?sslmode=disable&replication=database"
59+
- "--PulsarURL=pulsar://pulsar:6650"
60+
- "--PulsarTopic=persistent://public/pgcapture/postgres"
61+
- "--DecodePlugin=$DECODE_PLUGIN"
5162

5263
pulsar2pg:
53-
image: rueian/pgcapture:v0.0.40
64+
image: rueian/pgcapture:latest
5465
container_name: "pulsar2pg"
5566
command: [ "pulsar2pg", "--PGConnURL=postgres://postgres@postgres_sink:5432/postgres?sslmode=disable", "--PulsarURL=pulsar://pulsar:6650", "--PulsarTopic=persistent://public/pgcapture/postgres" ]
5667

5768
gateway:
58-
image: rueian/pgcapture:v0.0.40
69+
image: rueian/pgcapture:latest
5970
container_name: "gateway"
6071
ports:
6172
- 10001:10001
6273
command: gateway --ControllerAddr=controller:10000 --ResolverConfig='{"postgres_cdc":{"PulsarURL":"pulsar://pulsar:6650","PulsarTopic":"persistent://public/pgcapture/postgres","PulsarSubscription":"postgres_cdc","AgentURL":"agent:10000"}}'
6374

6475
controller:
65-
image: rueian/pgcapture:v0.0.40
76+
image: rueian/pgcapture:latest
6677
container_name: "controller"
6778
command: [ "controller" ]
6879
ports:
6980
- 10000:10000
7081

7182
agent:
72-
image: rueian/pgcapture:v0.0.40
83+
image: rueian/pgcapture:latest
7384
container_name: "agent"
7485
command: [ "agent" ]
7586

7687
configure:
77-
image: rueian/pgcapture:v0.0.40
88+
image: rueian/pgcapture:latest
7889
container_name: configure
7990
command: ["configure", "--AgentAddr=agent:10000", "--AgentCommand=pulsar2pg", "--PGConnURL=postgres://postgres@postgres_sink:5432/postgres?sslmode=disable", "--PulsarURL=pulsar://pulsar:6650", "--PulsarTopic=persistent://public/pgcapture/postgres"]
8091

0 commit comments

Comments
 (0)