wget https://github.com/prometheus/prometheus/releases/download/v2.23.0/prometheus-2.23.0.linux-amd64.tar.gz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.provision "shell", inline: <<-SHELL | |
#GERAL | |
echo "127.0.0.1 localhost | |
192.168.99.10 broker1 | |
192.168.99.11 broker2 | |
192.168.99.13 ansible" > /etc/hosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.provision "shell", inline: <<-SHELL | |
#GERAL | |
echo "127.0.0.1 localhost | |
192.168.99.10 broker1 | |
192.168.99.11 broker2 | |
192.168.99.12 broker3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Prometheus | |
After=network-online.target | |
[Service] | |
Type=simple | |
User=prometheus | |
Group=prometheus | |
ExecReload=/bin/kill -HUP $MAINPID | |
ExecStart=/srv/prometheus-2.23.0.linux-amd64/prometheus --config.file=/srv/prometheus-2.23.0.linux-amd64/prometheus.yml --storage.tsdb.path=/srv/prometheus-2.23.0.linux-amd64/data --web.listen-address=0.0.0.0:9090 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
productor: | |
image: alvarobacelar/productor-kafka-java:latest | |
container_name: producer-kafka | |
environment: | |
- KAFKA_SERVER=<ip-seu-broker>:9092 | |
- KAFKA_TOPIC=meu-primeiro-topico | |
- KAFKA_COUNT_MSG=1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: install zookeeper | |
hosts: zookeeper | |
user: root | |
become: true | |
roles: | |
- role: alvarobacelar.ansible_role_zookeeper | |
- name: install kafka broker | |
hosts: kafka_broker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
all: | |
zookeeper: | |
hosts: | |
ip-172-31-34-246.us-east-2.compute.internal: | |
ip-172-31-37-15.us-east-2.compute.internal: | |
ip-172-31-34-231.us-east-2.compute.internal: | |
kafka_broker: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
while (true) { | |
ConsumerRecords<String, String> records = consumer.poll(100); | |
for (ConsumerRecord<String, String> record : records) { | |
System.out.printf("topic = %s, partition = %s, offset = %d, | |
customer = %s, country = %s\n", | |
record.topic(), record.partition(), | |
record.offset(), record.key(), record.value()); | |
} | |
consumer.commitAsync(); 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HELP jvm_info JVM version info | |
# TYPE jvm_info gauge | |
jvm_info{version="1.8.0_111-internal-alpine-r0-b14",vendor="Oracle Corporation",runtime="OpenJDK Runtime Environment",} 1.0 | |
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. | |
# TYPE process_cpu_seconds_total counter | |
process_cpu_seconds_total 9.7 | |
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds. | |
# TYPE process_start_time_seconds gauge | |
process_start_time_seconds 1.571597655537E9 | |
# HELP process_open_fds Number of open file descriptors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Metric Name Value | |
app-info:commit-id:{client-id=producer-1} : 9aa84c2aaa91e392 | |
app-info:version:{client-id=producer-1} : 2.1.1-cp1 | |
kafka-metrics-count:count:{client-id=producer-1} : 142.000 | |
producer-metrics:batch-size-avg:{client-id=producer-1} : 270.000 | |
producer-metrics:batch-size-max:{client-id=producer-1} : 270.000 | |
producer-metrics:batch-split-rate:{client-id=producer-1} : 0.000 | |
producer-metrics:batch-split-total:{client-id=producer-1} : 0.000 | |
producer-metrics:buffer-available-bytes:{client-id=producer-1} : 33554432.000 | |
producer-metrics:buffer-exhausted-rate:{client-id=producer-1} : 0.000 |
NewerOlder