Browse Source

Phase IV task 10 complete

master
yutsuo 7 years ago
parent
commit
72f9ea2b2e
  1. 29
      cheatsheet.sh
  2. 98
      docker-compose.yml

29
cheatsheet.sh

@ -96,14 +96,14 @@ for i in {1..1000}; do echo "Hello $i times" | usr/bin/kafka-console-producer \
--broker-list localhost:19092, localhost:29092, localhost:39092 \
--topic MultiBrokerTopic; done
$KAFKA_HOME/bin/kafka-console-producer.sh \
--broker-list localhost:9092 \
--topic my-topic \
--property "parse.key=true" \
--property "key.separator=:"
key1:value1
key2:value2
key3:value3
# $KAFKA_HOME/bin/kafka-console-producer.sh \
# --broker-list localhost:9092 \
# --topic my-topic \
# --property "parse.key=true" \
# --property "key.separator=:"
# key1:value1
# key2:value2
# key3:value3
usr/bin/kafka-topics \
--create \
@ -121,7 +121,13 @@ usr/bin/kafka-topics \
usr/bin/kafka-topics --list --zookeeper localhost:22181
usr/bin/kafka-console-producer --broker-list localhost:19092, localhost:29092, localhost:39092 --topic KeyedTopic
usr/bin/kafka-console-consumer --bootstrap-server localhost:39092 --from-beginning --group consumer_group_01 --topic KeyedTopic
usr/bin/kafka-console-consumer \
--bootstrap-server localhost:39092 \
--from-beginning \
--group consumer_group_02 \
--topic KeyedTopic
usr/bin/kafka-consumer-groups --bootstrap-server localhost:39092 --list
usr/bin/kafka-consumer-groups --bootstrap-server localhost:39092 --describe --group consumer_group_01
@ -132,8 +138,9 @@ usr/bin/kafka-console-consumer \
--topic KeyedTopic
\
for k in {a,b,c}; do \
for i in {1..5}; do \
for i in {1..100}; do \
echo "$k:Hello $i times using key $k" \
| usr/bin/kafka-console-producer \
--request-required-acks 1 \
@ -192,7 +199,7 @@ topic="MultiBrokerTopic"}
--entity-type topics \
--entity-name KeyedTopic \
--alter \
--add-config 'cleanup.policy=compact, delete.retention.ms=10000, segment.ms=100, segment.bytes=20000, min.cleanable.dirty.ratio=0.01, min.compaction.lag.ms=100, cleaner.min.compaction.lag.ms=100'
--add-config 'cleanup.policy=compact, delete.retention.ms=10000, segment.ms=100, min.cleanable.dirty.ratio=0.01, min.compaction.lag.ms=100, min.compaction.lag.ms=100'
/usr/bin/kafka-configs \
--zookeeper localhost:22181 \

98
docker-compose.yml

@ -100,56 +100,56 @@ services:
extra_hosts:
- "moby:127.0.0.1"
prometheus:
image: prom/prometheus
network_mode: host
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
depends_on:
- kafka-1
- kafka-2
- kafka-3
# prometheus:
# image: prom/prometheus
# network_mode: host
# ports:
# - "9090:9090"
# volumes:
# - ./prometheus.yml:/etc/prometheus/prometheus.yml
# depends_on:
# - kafka-1
# - kafka-2
# - kafka-3
burrow:
image: artemz/burrow
network_mode: host
volumes:
- ./burrow.toml:/etc/burrow/burrow.toml
- burrow_data:/var/tmp/burrow
ports:
- "8000:8000"
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
- kafka-1
- kafka-2
- kafka-3
restart: always
# burrow:
# image: artemz/burrow
# network_mode: host
# volumes:
# - ./burrow.toml:/etc/burrow/burrow.toml
# - burrow_data:/var/tmp/burrow
# ports:
# - "8000:8000"
# depends_on:
# - zookeeper-1
# - zookeeper-2
# - zookeeper-3
# - kafka-1
# - kafka-2
# - kafka-3
# restart: always
dashboard:
image: joway/burrow-dashboard
network_mode: host
ports:
- "80:80"
environment:
BURROW_BACKEND: http://localhost:8000
depends_on:
- burrow
restart: always
# dashboard:
# image: joway/burrow-dashboard
# network_mode: host
# ports:
# - "80:80"
# environment:
# BURROW_BACKEND: http://localhost:8000
# depends_on:
# - burrow
# restart: always
grafana:
image: grafana/grafana
network_mode: host
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
# grafana:
# image: grafana/grafana
# network_mode: host
# ports:
# - "3000:3000"
# volumes:
# - grafana_data:/var/lib/grafana
# depends_on:
# - prometheus
volumes:
grafana_data:
burrow_data:
# volumes:
# grafana_data:
# burrow_data:
Loading…
Cancel
Save