Skip to content

Commit

Permalink
capitalization and minor name fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pokharelbinayak committed Nov 21, 2024
1 parent 886c607 commit 5e56190
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ Note:
* The term "VM" in environment of script `cluster_collector.sh` means if running in kernel.

# Design info:
There are two scripts used in instacollector tool for kafka.
There are two scripts used in instacollector tool for Kafka.

1. `node_collector.sh`: supposed to be executed on each Kafka node. It executes Linux and Kafka commands and copies configuration and log files required for cluster health checks. The user needs to modify the `KAFKA_HOME` path inside the script as per their configurations, the default value used is:
```
KAFKA_HOME=/opt/kafka
```
2. `cluster_collector.sh`: to be executed on a machine connected to Kafka cluster e.g. user laptop with a running docker or a running VM. It executes node_collector.sh on each Kafka node using ssh. The cluster_collector.sh requires 4 user inputs :
2. `cluster_collector.sh`: to be executed on a machine connected to Kafka cluster e.g. user laptop with a running Docker or a running VM. It executes node_collector.sh on each Kafka node using ssh. The cluster_collector.sh requires 4 user inputs :
```
* Enter your kafka environment (vm/docker) :
* Enter your kafka environment (VM/Docker) :
* [If VM]
* Enter username for login on Kafka cluster nodes (Press Enter for default admin) :
* Enter Identity file path: (the ssh key file in your local machine which is used to connect to the VMs)
* [If docker]
* Enter docker home directory:
* Enter path of the command config file: (kafka command-config file location on the kafka brokers)
* [If Docker]
* Enter Docker home directory:
* Enter path of the command config file: (Kafka command-config file location on the Kafka brokers)
* Enter file containing ip addresses/host/container names of Kafka cluster nodes: (the hosts file in your local machine)
```
*******************
Expand Down
22 changes: 11 additions & 11 deletions kafka/cluster_collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ clear
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INFO_DIR=/tmp/InstaCollection_$(date +%Y%m%d%H%M)

#Collect environment info (VM/docker)
read -p "Enter your kafka environment (vm/docker) :" kenv
#Collect environment info (VM/Docker)
read -p "Enter your Kafka environment (SSH/Docker) :" kenv

if [[ "${kenv}" == "vm" ]]; then
if [[ "${kenv}" == "SSH" ]]; then
#Collect user info.
read -p "Enter username for login on Kafka cluster nodes (Press Enter for default admin) :" user
read -p "Enter SSH username for login on Kafka cluster nodes (Press Enter for default admin) :" user
[ -z "${user}" ] && user='admin'

#user='rahulchakrabarty'
Expand All @@ -73,11 +73,11 @@ if [[ "${kenv}" == "vm" ]]; then
fi

#id_file='/Users/rahulchakrabarty-instaclustr/.ssh/rahulchakrabarty-instaclustr'
elif [[ "${kenv}" == "docker" ]]; then
read -p "Enter docker home directory :" docker_home
elif [[ "${kenv}" == "Docker" ]]; then
read -p "Enter directory path to store the output:" docker_home

if [ -z "$docker_home" ]; then
echo "Docker home directory cannot be empty"
if [ -z "docker_directory" ]; then
echo "Provided directory cannot be empty"
exit 1
fi
else
Expand All @@ -98,7 +98,7 @@ fi
echo "environment $kenv"

#Execute the node_collector on each node or container
if [ "$kenv" == "vm" ]; then
if [ "$kenv" == "SSH" ]; then
while read peer
do
if [[ -z "$peer" ]]; then
Expand All @@ -113,8 +113,8 @@ else
break
fi
echo "Copying file node_collector.sh to container"
docker cp ./node_collector.sh $peer:$docker_home/
docker exec $peer /bin/bash -c "sh $docker_home/node_collector.sh $peer $config_file" &
docker cp ./node_collector.sh $peer:docker_directory/
docker exec $peer /bin/bash -c "sh docker_directory/node_collector.sh $peer $config_file" &
done < "$peers_file"
fi

Expand Down

0 comments on commit 5e56190

Please sign in to comment.