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 \ --broker-list localhost:19092, localhost:29092, localhost:39092 \
--topic MultiBrokerTopic; done --topic MultiBrokerTopic; done
$KAFKA_HOME/bin/kafka-console-producer.sh \ # $KAFKA_HOME/bin/kafka-console-producer.sh \
--broker-list localhost:9092 \ # --broker-list localhost:9092 \
--topic my-topic \ # --topic my-topic \
--property "parse.key=true" \ # --property "parse.key=true" \
--property "key.separator=:" # --property "key.separator=:"
key1:value1 # key1:value1
key2:value2 # key2:value2
key3:value3 # key3:value3
usr/bin/kafka-topics \ usr/bin/kafka-topics \
--create \ --create \
@ -121,7 +121,13 @@ usr/bin/kafka-topics \
usr/bin/kafka-topics --list --zookeeper localhost:22181 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-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 --list
usr/bin/kafka-consumer-groups --bootstrap-server localhost:39092 --describe --group consumer_group_01 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 --topic KeyedTopic
\
for k in {a,b,c}; do \ 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" \ echo "$k:Hello $i times using key $k" \
| usr/bin/kafka-console-producer \ | usr/bin/kafka-console-producer \
--request-required-acks 1 \ --request-required-acks 1 \
@ -192,7 +199,7 @@ topic="MultiBrokerTopic"}
--entity-type topics \ --entity-type topics \
--entity-name KeyedTopic \ --entity-name KeyedTopic \
--alter \ --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 \ /usr/bin/kafka-configs \
--zookeeper localhost:22181 \ --zookeeper localhost:22181 \

98
docker-compose.yml

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