1、安装包下载到/usr/local/src 2、解压至安装路径/usr/localcd
cd /usr/local/src/
tar -xvf zookeeper-3.4.9.tar.gz -C /usr/local/
cd /usr/local
ln -s zookeeper-3.4.9/ zookeeper
3、修改配置文件
cd cd /usr/local/zookeeper/conf/
cp zoo_sample.cfg zoo.cfg
配置文件(每台zookeeper的配置文件都一样)
[root@master conf]# cat zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/local/zookeeper/data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
1、解压至安装目录
tar -xvf kafka_2.11-0.10.1.0.tgz -C /usr/local/
cd /usr/local/
ln -s kafka_2.11-0.10.1.0/ kafka
2、修改配置文件
cd /usr/local/kafka/config
vim server.properties
需要修改的项目:
# The id of the broker. This must be set to a unique integer for each broker
broker.id=1
# A comma seperated list of directories under which to store log files
log.dirs=/usr/local/kafka/logs
# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
zookeeper.connect=192.168.100.10:2181,192.168.100.13:2181,192.168.100.20:2181