Skip to content

Commit

Permalink
Experimental scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol Vijaywargiya committed Feb 25, 2021
1 parent f3e6dc1 commit a6e79cc
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
3 changes: 0 additions & 3 deletions docker-compose-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ services:
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_BROKER_ID: 1
SOCKET_REQUEST_MAX_BYTES: 5000000000
volumes:
- /tmp/data/kafka1/data:/var/lib/kafka/data
depends_on:
Expand All @@ -55,7 +54,6 @@ services:
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_BROKER_ID: 2
SOCKET_REQUEST_MAX_BYTES: 5000000000
volumes:
- /tmp/data/kafka2/data:/var/lib/kafka/data
depends_on:
Expand All @@ -75,7 +73,6 @@ services:
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_BROKER_ID: 3
SOCKET_REQUEST_MAX_BYTES: 50000000000

volumes:
- /tmp/data/kafka3/data:/var/lib/kafka/data
Expand Down
5 changes: 5 additions & 0 deletions experiment_scripts/start_broker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

brokerid=$1
container_id=`docker ps -aqf "name=ziggurat_kafka${brokerid}_1"`
docker start $container_id
5 changes: 5 additions & 0 deletions experiment_scripts/stop_broker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

brokerid=$1
container_id=`docker ps -aqf "name=ziggurat_kafka${brokerid}_1"`
docker stop $container_id
15 changes: 15 additions & 0 deletions experiment_scripts/zookeeper_access_disable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh


brokerid=`/Users/1mole/Documents/Softwares/kafka_2.12-2.4.0/bin/zookeeper-shell.sh localhost:2181 <<< "get /controller" | grep brokerid|jq '.brokerid'`
container_id=`docker ps -aqf "name=ziggurat_kafka${brokerid}_1"`

echo "Disabling zookeeper access on broker kafka${brokerid}"

docker exec -it $container_id /bin/bash -c "apt-get update && apt-get install -y iptables && iptables -A INPUT -s ziggurat_zookeeper_1.ziggurat_default -j DROP"






9 changes: 9 additions & 0 deletions experiment_scripts/zookeeper_access_enable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

brokerid=`/Users/1mole/Documents/Softwares/kafka_2.12-2.4.0/bin/zookeeper-shell.sh localhost:2181 <<< "get /controller" | grep brokerid|jq '.brokerid'`
container_id=`docker ps -aqf "name=ziggurat_kafka${brokerid}_1"`

echo "Enabling zookeeper access on broker kafka${brokerid}"
docker exec -it $container_id /bin/bash -c "iptables -D INPUT -s ziggurat_zookeeper_1.ziggurat_default -j DROP"


0 comments on commit a6e79cc

Please sign in to comment.