1. 下载zookeeper-3.4.10.tar.gz
2.tar zxvf zoo*.tar.gz
3. cd /usr/local/zookeeper/zookeeper-3.4.10/conf
4.cp zoo_sample.cfg zoo.cfg
5. vi zoo.cfg
dataDir=/usr/local/zookeeper/data
dataLogDir=/usr/local/zookeeper/log
server.1=ip1:2888:3888
server.2=ip2:2888:3888
server.3=ip3:2888:3888
6. cd /usr/local/zookeeper/data
7. vi myid 插入1 对应server.*
8. cd /usr/local/zookeeper ln -s zookeeper-3.4.10 inuse
9 vi /etc/profile
10. export zookeeper_home/usr/local/zookeeper/inuse
11. export path=$PATH:$zookeeper_home/bin
12 . source /etc/profile
kafka应用:
1. mv kafka_2.11.tgz /usr/local/kafka/.
2. tar zxvf kaf*.tgz
3. cd /usr/local/kafka
4. ln -s kafka_2.11 inuse
vi /etc/profile
export kafka_home=/usr/local/kafka/inuse
export PATH=$PATH:$kafka_home/bin
source /etc/profile
5. cd /usr/local/kafka/inuse/config
6. vim server.properties
broker.id=25
port=9092
num.partitions=2
zookeeper.connect=ip1:2181,ip2:2181,ip3:2181
message.max.byte=5048576
default.replication.factor=1
replica.fetch.max.bytes=5048576
host.name=ip1
log.dirs=/usr/local/kafka/log
6. mkdir /usr/local/kafka/log
7. 启动 ./kafka-server-start.sh -daemon ../config/server.properties