-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.sh
More file actions
21 lines (16 loc) · 763 Bytes
/
proxy.sh
File metadata and controls
21 lines (16 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# Download the latest Toxiproxy binaries.
wget -O toxiproxy https://github.com/Shopify/toxiproxy/releases/download/v2.1.2/toxiproxy-server-linux-amd64
wget -O toxiproxy-cli https://github.com/Shopify/toxiproxy/releases/download/v2.1.2/toxiproxy-cli-linux-amd64
chmod +x toxiproxy toxiproxy-cli
# Start the toxiproxy server.
nohup ./toxiproxy "-host=0.0.0.0" > toxiproxy.log 2>&1 &
sleep 5
# Create a Proxy for Kafka.
echo "Creating a proxy for Kafka at port 9092."
./toxiproxy-cli create kafka --listen 0.0.0.0:9092 --upstream kafka:9092
# Create a Proxy for Zookeeper.
echo "Creating a proxy for Zookeeper at port 2181."
./toxiproxy-cli create zookeeper --listen 0.0.0.0:2181 --upstream kafka:2181
# Tail the Toxiproxy logs.
tail -f toxiproxy.log