kafka_2.9.2-0.8.1.tgz
zookeeper-3.4.8.tar.gz


安装 zookeeper
1 export PATH=$PATH:/usr/local/zookeeper/bin
1 新增zookeeper service 启动服务
cp /usr/local/zookeeper/src/packages/rpm/init.d/zookeeper /etc/init.d/zookeeper
修改文件前缀
source /usr/local/zookeeper/bin/zkEnv.sh
daemon --user root /usr/local/zookeeper/bin/zkServer.sh start
daemon --user root /usr/local/zookeeper/bin/zkServer.sh stop
2修改zoo
cd /usr/local/zookeeper/conf
cp zoo_sample.cfg zoo.cfg
dataDir=/opt/zookeeper/data
tickTime=20000
3 启动zookeeper
chmod 755 /etc/init.d/zookeeper
service zookeeper start

安装Kafka
1 设置kafka/conf/zookeeper.properties zoodata
2 server.properties 设置 advertised.host.name=192.168.100.240
2 bin/kafka-server-start.sh config/server.properties&
3 test
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic tes
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic logfile --from-beginning