forked from supermy/mytools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
FROM myjre7_base | ||
FROM jamesmo/jre:7 | ||
|
||
MAINTAINER jamesmo | ||
|
||
RUN apt-get update; apt-get install -y unzip wget git | ||
RUN apt-get update && apt-get install -y unzip | ||
|
||
RUN wget -q http://mirror.gopotato.co.uk/apache/kafka/0.8.2.0/kafka_2.11-0.8.2.0.tgz -O /tmp/kafka_2.11-0.8.2.0.tgz | ||
RUN tar xfz /tmp/kafka_2.11-0.8.2.0.tgz -C /opt | ||
RUN wget http://mirrors.cnnic.cn/apache/kafka/0.8.2.1/kafka_2.11-0.8.2.1.tgz -O /tmp/kafka_2.11-0.8.2.1.tgz | ||
RUN tar xfz /tmp/kafka_2.11-0.8.2.1.tgz -C /opt | ||
|
||
RUN rm /tmp/kafka_2.11-0.8.2.0.tgz | ||
RUN rm /tmp/kafka_2.11-0.8.2.1.tgz | ||
|
||
VOLUME ["/kafka"] | ||
|
||
ENV KAFKA_HOME /opt/kafka_2.11-0.8.2.0 | ||
ENV KAFKA_HOME /opt/kafka_2.11-0.8.2.1 | ||
|
||
ADD shell/start-kafka.sh /usr/bin/start-kafka.sh | ||
ADD shell/broker-list.sh /usr/bin/broker-list.sh | ||
|
||
RUN chmod a+x /usr/bin/start-kafka.sh | ||
RUN chmod a+x /usr/bin/broker-list.sh | ||
|
||
|
||
CMD start-kafka.sh |
This file contains 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
This file contains 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
Binary file added
BIN
+20.5 MB
common/mykafka/spring-kafka-demo-0.2.0-SNAPSHOT-jar-with-dependencies.jar
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
fig up -d && fig ps | ||
|
||
#tese1 | ||
kafka-topics.sh --create --zookeeper 192.168.59.103:2181 --replication-factor 1 --partitions 1 --topic mykafka | ||
telnet 192.168.59.103 44447 | ||
kafka-console-consumer.sh --zookeeper 192.168.59.103:2181 --topic mykafka --from-beginning | ||
|
||
#test2 | ||
kafka-topics.sh --create --zookeeper 192.168.59.103:2181 --replication-factor 1 --partitions 1 --topic metadata | ||
kafka-topics.sh --create --zookeeper 192.168.59.103:2181 --replication-factor 1 --partitions 1 --topic test | ||
java -cp spring-kafka-demo-0.2.0-SNAPSHOT-jar-with-dependencies.jar com.colobu.spring_kafka_demo.Producer | ||
java -cp spring-kafka-demo-0.2.0-SNAPSHOT-jar-with-dependencies.jar com.colobu.spring_kafka_demo.Consumer | ||
|
||
fig stop && fig rm --force | ||
|
||
echo "test over!" |