-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
192 lines (142 loc) · 7.9 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
all: build
# These commands download connectors
connector-download:
mkdir -p connector-plugins
wget https://d1i4a15mxbxib1.cloudfront.net/api/plugins/confluentinc/kafka-connect-jdbc/versions/10.2.0/confluentinc-kafka-connect-jdbc-10.3.2.zip
unzip confluentinc-kafka-connect-jdbc-10.3.2.zip -d connector-plugins
rm confluentinc-kafka-connect-jdbc-10.3.2.zip
wget https://d1i4a15mxbxib1.cloudfront.net/api/plugins/confluentinc/kafka-connect-datagen/versions/0.5.3/confluentinc-kafka-connect-datagen-0.5.3.zip
unzip confluentinc-kafka-connect-datagen-0.5.3.zip -d connector-plugins
rm confluentinc-kafka-connect-datagen-0.5.3.zip
# These commands get set up your local CP cluster
up:
CCLOUD_CLUSTER=${CCLOUD_CLUSTER} \
CCLOUD_BOOTSTRAP_SERVERS=${CCLOUD_BOOTSTRAP_SERVERS} \
CCLOUD_EXPORTER_API_KEY=${CCLOUD_EXPORTER_API_KEY} \
CCLOUD_EXPORTER_API_SECRET=${CCLOUD_EXPORTER_API_SECRET} \
CCLOUD_API_KEY=${CCLOUD_CONNECT_API_KEY} \
CCLOUD_API_SECRET=${CCLOUD_CONNECT_API_SECRET} \
CCLOUD_SR_URL=${CCLOUD_SR_URL} \
CCLOUD_SR_API_KEY=${CCLOUD_CONNECT_SR_API_KEY} \
CCLOUD_SR_API_SECRET=${CCLOUD_CONNECT_SR_API_SECRET} \
CP_VERSION=${CP_VERSION} \
docker-compose up -d
down:
docker-compose down --remove-orphans
local-topology:
docker-compose exec julie-ops kafka-topology-builder.sh --brokers kafka1:19092 --clientConfig /topologies/local.properties --topology /topologies/local.yml
make local-topic:
kafka-topics --create --topic test1 --bootstrap-server kafka1:19092
# The following commands are for connectors that are RW to the local CP cluster
local-datagen-commercials:
curl -X PUT --data @connectors/local/datagen-commercials.json -H "Content-type: application/json" http://localhost:8084/connectors/datagen-commercials/config | jq
local-datagen-inventory:
curl -X PUT --data @connectors/local/datagen.json -H "Content-type: application/json" http://localhost:8084/connectors/datagen-inventory/config | jq
local-jdbc-mysql:
curl -X PUT --data @connectors/local/jdbc-mysql.json -H "Content-type: application/json" http://localhost:8084/connectors/jdbc-mysql/config | jq
local-jdbc-mysql-custom-query:
curl -X PUT --data @connectors/local/jdbc-mysql-custom-query.json -H "Content-type: application/json" http://localhost:8084/connectors/jdbc-mysql-custom-query/config | jq
local-jdbc-sink:
curl -X PUT --data @connectors/ccloud/jdbc-sink-schema.json -H "Content-type: application/json" http://localhost:8084/connectors/jdbc-sink-schema/config | jq
local-get-connectors:
curl http://localhost:8084/connectors/ | jq
local-remove-connector:
curl -X DELETE http://localhost:8084/connectors/| jq
logs-connect:
docker logs -f connect1
# Run these commands to set up your connect cluster and authentication credentials for Confluent Cloud
include env
ccloud-exporter-api-key: ccloud-pre
ccloud api-key create --resource cloud
ccloud-topology:
docker-compose exec julie-ops kafka-topology-builder.sh \
--brokers ${CCLOUD_BOOTSTRAP_SERVERS} \
--clientConfig /topologies/ccloud.properties \
--topology /topologies/ccloud.yml
ccloud-pre:
confluent environment use ${CCLOUD_ENV}
confluent kafka cluster use ${CCLOUD_CLUSTER}
ccloud-connect-api-key: ccloud-pre
confluent api-key create --resource ${CCLOUD_CLUSTER} --description "Cloud API-Key for Connect Monitoring Demo"
confluent api-key create --resource ${CCLOUD_SR} --description "Cloud API-Key for Connect Monitoring Demo"
ccloud-app-service-account: ccloud-pre
confluent service-account create connect-sandbox --description "Connect Monitoring PoC Topology Builder"
ccloud-app-acl: ccloud-pre
confluent kafka acl create --allow --service-account ${CCLOUD_SERVICE_ACCOUNT} \
--operation DESCRIBE --operation CREATE --operation READ --operation WRITE \
--topic demo-test-topic --prefix
confluent kafka acl create --allow --service-account ${CCLOUD_SERVICE_ACCOUNT} \
--operation DESCRIBE --operation READ \
--consumer-group demo-test-topic --prefix
ccloud-app-api-key: ccloud-pre
confluent api-key create --service-account ${CCLOUD_SERVICE_ACCOUNT} --resource ${CCLOUD_CLUSTER} --description "Confluent Cloud Connect Monitoring Service Account"
confluent api-key create --service-account ${CCLOUD_SERVICE_ACCOUNT} --resource ${CCLOUD_SR} --description "Confluent Cloud Connect Monitoring Service Accoun - SR"
# These commands deploy connectors that RW to your Confluent Cloud cluster
ccloud-topic: ccloud-pre
confluent kafka topic create test-topic
ccloud-datagen-users:
curl -X PUT --data @connectors/ccloud/datagen-users.json -H "Content-type: application/json" http://localhost:8083/connectors/datagen-users/config | jq
ccloud-dbz:
curl -X PUT --data @connectors/ccloud/dbz-sqlserver.json -H "Content-type: application/json" http://localhost:8084/connectors/dbz-sqlserver/config | jq
ccloud-datagen-users-schema:
curl -X PUT --data @connectors/ccloud/datagen-users-schema.json -H "Content-type: application/json" http://localhost:8084/connectors/datagen-users-schema/config | jq
ccloud-jdbc-mysql:
curl -X PUT --data @connectors/ccloud/jdbc-mysql.json -H "Content-type: application/json" http://localhost:8084/connectors/jdbc-mysql/config | jq
ccloud-jdbc-mysql-custom-query:
curl -X PUT --data @connectors/ccloud/jdbc-mysql-custom-query.json -H "Content-type: application/json" http://localhost:8084/connectors/jdbc-mysql-custom-query/config | jq
ccloud-jdbc-bulk-mode-source:
curl -X PUT --data @connectors/ccloud/jdbc-bulk-mode-source.json -H "Content-type: application/json" http://localhost:8083/connectors/jdbc-bulk-mode-source/config | jq
ccloud-jdbc-incremental-mode-source:
curl -X PUT --data @connectors/ccloud/jdbc-incremental-mode-source.json -H "Content-type: application/json" http://localhost:8083/connectors/jdbc-incremental-mode-source/config | jq
ccloud-jdbc-timestamp-mode-source:
curl -X PUT --data @connectors/ccloud/jdbc-timestamp-mode-source.json -H "Content-type: application/json" http://localhost:8083/connectors/jdbc-timestamp-mode-source/config | jq
ccloud-jdbc-incremental-timestamp-source:
curl -X PUT --data @connectors/ccloud/jdbc-incremental-timestamp-source.json -H "Content-type: application/json" http://localhost:8083/connectors/jdbc-incremental-timestamp-source/config | jq
ccloud-jdbc-sink:
curl -X PUT --data @connectors/ccloud/jdbc-sink.json -H "Content-type: application/json" http://localhost:8083/connectors/jdbc-sink/config | jq
ccloud-get-connectors:
curl http://localhost:8083/connectors/ | jq
ccloud-remove-connector:
curl -X DELETE http://localhost:8083/connectors/| jq
ccloud-perf: ccloud-pre
confluent kafka topic create demo-test-topic
# Below are perf test commands. If you want to send some data to the CC cluster for monitoring without deploying a connector, use this
perf-producer:
kafka-producer-perf-test \
--producer-props bootstrap.servers=${CCLOUD_BOOTSTRAP_SERVERS} \
--topic demo-test-topic \
--num-records 1000000 --record-size 1000 --throughput 500 \
--producer.config perf/ccloud.properties
perf-producer-throughput:
kafka-producer-perf-test \
--producer-props bootstrap.servers=${CCLOUD_BOOTSTRAP_SERVERS} \
--topic demo-test-topic \
--num-records 1000000 --record-size 1000 --throughput -1 \
--producer.config perf/throughput.properties
perf-consumer:
kafka-consumer-perf-test \
--bootstrap-server ${CCLOUD_BOOTSTRAP_SERVERS} \
--topic demo-test-topic --group g1 \
--messages 100000 --threads 10 \
--show-detailed-stats \
--consumer.config perf/client.properties
ccloud-consumer:
kafka-console-consumer \
--bootstrap-server ${CCLOUD_BOOTSTRAP_SERVERS} \
--topic MOCK_DATA_VIEW --group v1 \
--consumer.config perf/throughput.properties \
--from-beginning
local-consumer:
kafka-console-consumer \
--bootstrap-server http://localhost:19092 \
--topic users-schema --group poc1 \
--from-beginning
# broker_list topic num_messages producer_acks message_size_bytes
perf-e2e-latency:
kafka-run-class kafka.tools.EndToEndLatency \
${CCLOUD_BOOTSTRAP_SERVERS} \
perf1 \
1000 \
all \
100 \
perf/client.properties