CentOS 安装并运行Kafka
1、下载Kafka
http://mirrors.hust.edu.cn/apache/kafka/2.1.1/
2、定位到/usr/local,创建kafka文件夹,进入此文件夹后解压kafka(可自行选择安装目录)
tar -xzf kafka_2.11-2.1.1.tgz
3、运行内置zookeeper
cd /usr/local/kafka/kafka_2.11-2.1.1/bin/
./zookeeper-server-start.sh ../config/zookeeper.properties &
4、配置伪分布式kafka
复制三份server.properties(自选数量),每份修改如下几个配置
# Kafka broker节点唯一标识. broker.id=0 # 端口号(伪分布式不能冲突) port=9092 # 对客户端提供的服务地址和端口号 advertised.listeners=PLAINTEXT://192.168.56.20:9092 # Kafka日志存放路径(路径自行创建) log.dirs=/home/hadoop/kafka/broker-0
# Kafka broker节点唯一标识. broker.id=1 # 端口号(伪分布式不能冲突) port=9093 # 对客户端提供的服务地址和端口号 advertised.listeners=PLAINTEXT://192.168.56.20:9093 # Kafka日志存放路径(路径自行创建) log.dirs=/home/hadoop/kafka/broker-1
# Kafka broker节点唯一标识. broker.id=2 # 端口号(伪分布式不能冲突) port=9094 # 对客户端提供的服务地址和端口号 advertised.listeners=PLAINTEXT://192.168.56.20:9094 # Kafka日志存放路径(路径自行创建) log.dirs=/home/hadoop/kafka/broker-2
5、运行Kafka
./kafka-server-start.sh ../config/server0.properties &
./kafka-server-start.sh ../config/server1.properties &
./kafka-server-start.sh ../config/server2.properties &
相关推荐
Kafka 2020-09-18
yanghuashuiyue 2020-11-14
liuxingen 2020-11-13
wangying 2020-11-13
王谦 2020-11-03
huangwei00 2020-10-14
shenzhenzsw 2020-10-09
guicaizhou 2020-09-30
jiaomrswang 2020-09-23
jyj0 2020-09-21
guicaizhou 2020-09-15
hannuotayouxi 2020-08-20
amwayy 2020-08-03
yangyutong00 2020-08-01
weikaixxxxxx 2020-08-01
PoppyEvan 2020-08-01
guicaizhou 2020-08-01
PoppyEvan 2020-07-29