作者:互联网-小啊宇
简介: CSDN 运维领域创作者、阿里云专家博主。目前从事 Kubernetes运维相关工作,擅长Linux系统运维、开源监控软件维护、Kubernetes容器技术、CI/CD持续集成、自动化运维、开源软件部署维护等领域。
博客首页:CSDN【互联网-小阿宇】 、阿里云【互联网-小阿宇】
欢迎小伙伴们点赞、收藏⭐、留言
IP地址 | 操作环境 | 运行资源 | 备注 |
---|---|---|---|
192.168.8.10 | Centos7.5 | 2C8G | JDK、Kafka |
[root@localhost packages]# tar -zxf jdk-8u171-linux-x64.tar.gz -C /usr/local/
[root@localhost packages]# cd /usr/local
[root@localhost local]# mv jdk1.8.0_171/ java
[root@localhost local]# vim /etc/profile
#尾部添加
export JAVA_HOME=/usr/local/java
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
[root@localhost local]# source /etc/profile
[root@localhost local]# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
mkdir /data
[root@localhost ~]# tar -zxf kafka_2.13-2.4.0.tgz -C /data/
[root@localhost ~]# mv /data/kafka_2.13-2.4.0/ /data/kafka
[root@localhost ~]# mkdir -p /data/kafka/zookeeper/data
[root@localhost ~]# vim /data/kafka/config/zookeeper.properties
[root@localhost ~]# cd /data/kafka/
[root@localhost kafka]# ./bin/zookeeper-server-start.sh -daemon config/zookeeper.properties
[root@localhost kafka]# mkdir -p /data/kafka/kafka-log
[root@localhost kafka]# vim /data/kafka/config/server.properties
将文件的内容清空,替换为一下内容
注意IP、端口等其他配置
broker.id=0
listeners=PLAINTEXT://192.168.8.10:9092
port=9092
host.name=192.168.8.10
advertised.host.name=192.168.8.10
advertised.port=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=/data/kafka/kafka-log
num.partitions=5
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=24
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connect=192.168.8.10:2181
zookeeper.connection.timeout.ms=6000
group.initial.rebalance.delay.ms=0
[root@localhost kafka]# cd /data/kafka/
[root@localhost kafka]# ./bin/kafka-server-start.sh -daemon config/server.properties