1、安装JDK
vi /etc/profile
#set jdk
JAVA_HOME=/root/jdk1.8.0_221
CLASSPATH=$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
source /etc/profile
2、下载并解压kafka安装包
3、修改 Kafka 存储数据目录
mkdir /home/kafka-logs
cd /data/kafka_2.13-2.8.1/config
vi server.properties
log.dirs=/data/kafka-logs
listeners=PLAINTEXT://192.168.1.181:9092
4、关防火墙
systemctl stop firewalld
systemctl disable firewalld
查看状态
ps -ef|grep kafka
jps
启动 Kafka 步骤为先启动 zookeeper,再启动 Kafka。
cd /root/kafka_2.13-2.8.1/
nohup bin/zookeeper-server-start.sh config/zookeeper.properties > zk.log 2>&1 &
nohup bin/kafka-server-start.sh config/server.properties > kafka.log 2>&1 &
关闭 Kafka 步骤为先关闭 Kafka,再关闭 zookeeper。
cd /root/kafka_2.13-2.8.1/
bin/kafka-server-stop.sh
bin/zookeeper-server-stop.sh
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net