wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz tar zxvf zookeeper-3.4.6.tar.gz cd zookeeper-3.4.6 cp -rf conf/zoo_sample.cfg conf/zoo.cfg cd conf vim zoo.cfg
修改zook.cfg裏頭的dataDirhtml
cd bin sh zkServer.sh start
wget http://apache.fayea.com/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz tar -zxf kafka_2.10-0.8.2.1.tgz cd kafka_2.10-0.8.2.1 sh bin/kafka-server-start.sh config/server.properties
sh kafka-topics.sh --create --topic kafkatopic --replication-factor 1 --partitions 1 --zookeeper localhost:2181
sh kafka-console-producer.sh --broker-list localhost:9092 --sync --topic kafkatopic
sh kafka-console-consumer.sh --zookeeper localhost:2181 --topic kafkatopic --from-beginning