1、軟件環(huán)境
用三臺機(jī)器馒铃,系統(tǒng)CentOS7 64位
192.168.0.241
192.168.0.242
192.168.0.243
注釋:三臺機(jī)器都需要安裝
#yum -y install jdk
wget http://mirror-hk.koddos.net/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
注釋:三臺機(jī)器都需要執(zhí)行
#tar -zxvf kafka_2.12-2.3.0.tgz
#mv kafka_2.12-2.3.0 /data/zookeeper
注釋:三臺機(jī)器都需要修改配置
#vim /data/kafka/config/server.properties
broker.id=1
listeners=PLAINTEXT://192.168.0.241:9092 ##設(shè)置本機(jī)IP
num.network.threads=2
num.io.threads=16
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=/data/kafka/logs/kafka-logs
num.partitions=120
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=2
transaction.state.log.replication.factor=2
transaction.state.log.min.isr=2
log.flush.interval.messages=10000
log.flush.interval.ms=1000
log.retention.hours=72
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connect=192.168.0.241:2181,192.168.0.242:2181,192.168.0.243:2181
zookeeper.connection.timeout.ms=6000
group.initial.rebalance.delay.ms=0
auto.create.topics.enable=true
delete.topic.enable=true
mkdir -p /data/kafka/logs
cd /data/kafka/bin
./kafka-server-start.sh -daemon ../config/server.properties
#ps -ef |grep java
#netstat -anp |grep 9092
#jps
6213 Kafka
6393 Jps
5757 QuorumPeerMain
http://www.reibang.com/p/5297773fcc1b