kafka单机安装部署
1、下载安装包并解压
cd /usr/local/src
wget https://archive.apache.org/dist/kafka/2.6.0/kafka_2.13-2.6.0.tgz
tar zxvf kafka_2.13-2.6.0.tgz
ln -s /usr/local/src/kafka_2.13-2.6.0 /usr/local/kafka
2、安装jdk
yum install java-1.8.0-openjdk* -y
3、修改/usr/local/kafka/config目录中zookeeper.properties配置文件
#日志地址
log.dirs=/usr/local/kafka/logs
4、修改/usr/local/kafka/config目录中server.properties配置文件
[root@10-52-63-84 config]# cat server.properties
broker.id=0
listeners=PLAINTEXT://10.52.63.84:9092
#配置公网地址
#advertised.listeners=PLAINTEXT://152.32.141.145:9092
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=/usr/local/kafka/logs
num.partitions=1
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connect=localhost:2181
zookeeper.connection.timeout.ms=18000
group.initial.rebalance.delay.ms=0
auto.create.topics.enable = true
5、启动kafka自带的zookeeper
cd /usr/local/kafka
./bin/zookeeper-server-start.sh ./config/zookeeper.properties &
6、启动kafka
./bin/kafka-server-start.sh ./config/server.properties &