-
Server: c6a.2xlarge
-
OS: ubuntu 22.04lts
-
Tags:
Tag Name | Value |
---|---|
Name | Riven_Test_Kafka |
Owner | jturner |
CostCenter | SE |
Project | Riven_Test |
- Key Pair: xxxxx
- Storage: 256G
ssh -i $HOME/Downloads/xxxxx.pem ubuntu@yyyyy.compute-1.amazonaws.com
sudo apt update
sudo apt upgrade -y
ssh -i $HOME/Downloads/xxxxx.pem ubuntu@yyyyy.compute-1.amazonaws.com
sudo apt install docker.io docker-compose nmon kafkacat -y
sudo usermod -a -G docker ubuntu
exit
ssh -i $HOME/Downloads/xxxxx.pem ubuntu@yyyyy.compute-1.amazonaws.com
git clone https://github.com/JohnRTurner/riviandatagen.git
cp riviandatagen/kafkasetup/docker-compose.yml .
mkdir -p ~/data1 ~/data2 ~/data3 ~/data4 ~/zoo1/data ~/zoo1/log ~/zoo2/data ~/zoo2/log
export MNAME=$(curl http://checkip.amazonaws.com 2>/dev/null |nslookup| grep "name =" |sed "s/.*name = //"|sed "s/.$//")
docker-compose up -d
Variable | Value | Example |
---|---|---|
Command | kafka-topics | |
topic | Name of the topic that you wish to create | test |
partitions | Should be 1x, 2x, or 4x the number of db partitions | 128 |
docker exec -it ubuntu_kafka-1_1 kafka-topics --bootstrap-server localhost:29092,localhost:29093,localhost:29094,localhost:29095 --topic test --create --partitions 128 --replication-factor 1 --config retention.ms=-1
docker-compose stop
- Issue the start command to restart the cluster
docker-compose start
- Watch the cluster come up and check status.
docker ps -a
- If any of the docker processes show "Exited" in the status, simply retry. Note may take multiple attempts.
docker-compose start
- After all kafka and zookeeper procs have successfully started, check to see if data is still present
kafkacat -C -b localhost:29092,localhost:29093,localhost:29094,localhost:29095 -t test -o beginning -e -q| wc -l
kafkacat -C -b localhost:29092,localhost:29093,localhost:29094,localhost:29095 -t test -o beginning -e -q| wc -l
docker exec -it ubuntu_kafka-1_1 kafka-topics --bootstrap-server localhost:29092,localhost:29093,localhost:29094,localhost:29095 --list
docker exec -it ubuntu_kafka-1_1 kafka-topics --bootstrap-server localhost:29092,localhost:29093,localhost:29094,localhost:29095 --delete --topic test
kafkacat -C -b localhost:29092,localhost:29093,localhost:29094,localhost:29095 -t test -o beginning -e -q| wc -l
docker exec -it ubuntu_kafka-1_1 bash
- Login, drop old dockers and create new ones with the correct IP.
ssh -i $HOME/Downloads/xxxxx.pem ubuntu@yyyyy.compute-1.amazonaws.com
export MNAME=$(curl http://checkip.amazonaws.com 2>/dev/null |nslookup| grep "name =" |sed "s/.*name = //"|sed "s/.$//")
docker-compose down
docker-compose up -d
- Watch the cluster come up and check status.
docker ps -a
- If any of the docker processes show "Exited" in the status, simply retry. Note may take multiple attempts.
docker-compose start
- After all kafka and zookeeper procs have successfully started, check to see if data is still present
kafkacat -C -b localhost:29092,localhost:29093,localhost:29094,localhost:29095 -t test -o beginning -e -q| wc -l