This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
setup.sh
executable file
·70 lines (64 loc) · 2.33 KB
/
setup.sh
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
#!/bin/bash
printf "Starting cluster\n"
docker-compose up -d
sleep 1
printf "Configuring mongo replica set\n"
docker-compose exec mongo1 mongo --eval 'rs.initiate({_id : "r0", members: [{ _id : 0, host : "mongo1:27017", priority : 1 },{ _id : 1, host :"mongo2:27017", priority : 0 },{ _id : 2, host : "mongo3:27017", priority : 0, arbiterOnly: true }]})'
printf "Waiting 30 seconds for connect to be ready...\n"
sleep 30
printf "Configuring photo-connector\n"
curl -X POST \
http://localhost:8083/connectors \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 558' \
-H 'Content-Type: application/json' \
-H 'Host: localhost:8083' \
-H 'User-Agent: PostmanRuntime/7.20.1' \
-H 'cache-control: no-cache,no-cache' \
-d '{
"name": "photo-connector",
"config": {
"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
"tasks.max": "1",
"topics": "photo",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false",
"schema.ignore": "true",
"connection.url": "http://elastic:9200",
"type.name": "kafka-connect",
"behavior.on.malformed.documents": "warn",
"name": "photo-connector"
}
}'
printf "Configuring long-exposure-connector\n"
curl -X POST \
http://localhost:8083/connectors \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 582' \
-H 'Content-Type: application/json' \
-H 'Host: localhost:8083' \
-H 'User-Agent: PostmanRuntime/7.20.1' \
-H 'cache-control: no-cache,no-cache' \
-d '{
"name": "long-exposure-connector",
"config": {
"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
"tasks.max": "1",
"topics": "long-exposure",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false",
"schema.ignore": "true",
"connection.url": "http://elastic:9200",
"type.name": "kafka-connect",
"behavior.on.malformed.documents": "warn",
"name": "long-exposure-connector"
}
}'
printf "Connecting to server\n"
docker-compose logs -f server