-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
32 lines (23 loc) · 799 Bytes
/
start.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
#!/bin/bash
SINK_CONNECTOR_PATH=$PWD/kafka/sink/elasticsearch-sink.json
if [ ! -f "$SINK_CONNECTOR_PATH" ]; then
echo "File not found!"
exit 1
fi
# Start the services
docker-compose up -d
response=$(curl -s -X GET http://localhost:8083/connectors/elasticsearch-sink/status)
if [[ $response == *"RUNNING"* ]]; then
break
fi
echo "waiting for kafka connector to be up and running"
sleep 10
done
curl -s -X POST -H "Content-Type: application/json" --data @"$SINK_CONNECTOR_PATH" http://localhost:8083/connectors
response=$(curl -s -X GET http://localhost:8083/connectors/elasticsearch-sink/status)
while [[ $response != *"RUNNING"* ]]; do
sleep 5
response=$(curl -s -X GET http://localhost:8083/connectors/elasticsearch-sink/status)
done
echo "Connector is running!"
air