Huawei warehouse ZooKeeper download Kafka used to live
https://mirrors.huaweicloud.com/apache/kafka
zookeeper Related:
- Decompression: tar -zxvf zookeeper-3.4.10.tar.gz
- Create a folder: mkdir -vp / usr / local / kafka
- Switch to conf directory: cd zookeeper-3.4.10 / conf /
- Modify zoo.cfg cp zoo_sample.cfg zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/usr/local/zookeeper/data
clientPort=2181
- zookeeper environment variables vi / etc / profile
export ZOOKEEPER_HOME=/usr/local/zookeeper/zookeeper-3.4.10
export PATH=.:$ZOOKEEPER_HOME/bin:$JAVA_HOME/bin:$PATH
启动:sh zkServer.sh start
关闭:sh zkServer.sh stop
Description: zookeeper why you need to configure the environment variable, because the zookeeper do not need to start. When kafka configuration configures the zookeeper, zookeeper at that time will start in kafka.
kafka related
-zxvf kafka_2.12-1.0.0.tgz the tar
Kafka / kafka_2.12-1.0.0 / config folder below four modified configuration file:
Configure the server.properties:
broker.id 0 =
Port = 9092
host.name = localhost
/usr/local/kafka/kafka_2.12-1.0.0/log (folder path may cause problems)
arranged zookeeper.properties:
dataDir = / usr / local / Kafka / kafka_2.12-1.0.0 / ZooKeeper / Data
the clientPort 2181 =
host.name = localhost
maxClientCnxns = 0
configuration producer.properties:
zookeeper.connect = localhost: 2181
configured consumer.properties:
zookeeper.connect = localhost: 2181
启动zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
启动kafka
bin/kafka-server-start.sh config/server.properties