-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
69 lines (55 loc) · 1.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
include ../Makefile
infra: helper
docker compose \
-f ../pinot-compose.yml \
-f ../kafka-compose.yml \
-f ../postgres-compose.yml \
-f docker-compose.yml up -d
kafka:
-docker exec -it kafka \
kafka-topics.sh \
--bootstrap-server kafka:9092 \
--create \
--topic debezium_REALTIME
postgres:
curl -O https://www.postgresqltutorial.com/wp-content/uploads/2019/05/dvdrental.zip
unzip dvdrental.zip
docker cp sql/init.sql postgres:.
docker cp sql/cdc.sql postgres:.
docker cp dvdrental.tar postgres:.
docker exec -it postgres psql -h localhost -U postgres -f init.sql
sleep 5
docker exec -it postgres pg_restore -h localhost -U postgres -d dvdrental dvdrental.tar
sleep 5
docker exec -it postgres psql -h localhost -U postgres -d dvdrental -f cdc.sql
sleep 5
connect:
-curl -X DELETE http://localhost:8083/connectors/dvdrental-connector | jq
curl http://localhost:8083/connectors | jq
curl -X POST http://localhost:8083/connectors \
-H 'Content-Type: application/json' \
-d @debezium/register-postgres.json | jq
docker exec -it kafka kafka-topics.sh --bootstrap-server localhost:9092 --list
tables:
docker cp config/rental.json pinot-controller:/opt/pinot/
docker cp config/rental.table.config.json pinot-controller:/opt/pinot/
docker exec -it pinot-controller ./bin/pinot-admin.sh DeleteSchema \
-schemaName rental
-exec
docker exec -it pinot-controller ./bin/pinot-admin.sh DeleteTable \
-tableName rental
-exec
sleep 5
docker exec -it pinot-controller ./bin/pinot-admin.sh AddTable \
-tableConfigFile rental.table.config.json \
-schemaFile rental.json \
-exec
@TABLE=rental make check_table
recipe: infra check kafka postgres connect tables
clean:
-rm dvdrental*
-docker compose \
-f ../pinot-compose.yml \
-f ../kafka-compose.yml \
-f ../postgres-compose.yml \
-f docker-compose.yml down