wget http://www-eu.apache.org/dist/kafka/1.1.0/kafka_2.11-1.1.0.tgz -P /tmp/
sudo tar -zxvf /tmp/kafka_2.11–1.1.0.tgz -C /opt/
sudo ln -s /opt/kafka_2.11–1.1.0 /opt/kafka
cp ./kafka-server-start.sh /opt/kafka/bin/
git clone https://github.com/onuryartasi/kafka-monitoring
cd kafka-monitoring
cp -r ./prometheus /opt/kafka/
#prometheus jvm
EXTRA_ARGS="-javaagent:/opt/kafka/prometheus/jmx_prometheus_javaagent-0.9.jar=7071:/opt/kafka/prometheus/kafka-2_0_0.yml"
EXTRA_ARGS=${EXTRA_ARGS-'-name kafkaServer -loggc'}
sudo mkdir /etc/prometheus /var/lib/prometheus /var/log/prometheus /var/run/prometheus
wget https://github.com/prometheus/prometheus/releases/download/v2.10.0/prometheus-2.10.0.linux-amd64.tar.gz -P /tmp/
sudo tar -zxvf /tmp/prometheus-2.10.0.linux-amd64.tar.gz -C /tmp/
sudo cp /tmp/prometheus-2.10.0.linux-amd64/{prometheus,promtool} /usr/local/bin/
sudo chmod +x /usr/local/bin/{prometheus,promtool}
sudo cp /tmp/prometheus-2.10.0.linux-amd64/prometheus.yml /etc/prometheus/
sudo cp -r /tmp/prometheus-2.10.0.linux-amd64/{consoles,console_libraries} /etc/prometheus/
cp ./prometheus.yml /etc/prometheus/
cp ./prometheus.service /etc/systemd/system/
sudo systemctl enable prometheus.service && sudo systemctl start prometheus