kafka 安装配置

本文详细介绍了Apache Kafka 2.3.0的安装步骤和配置过程,包括下载Kafka,创建应用目录,配置Zookeeper和Kafka,设置服务器参数,启动服务以及创建和管理topics。同时,还涉及到SASL认证和安全配置,确保了Kafka集群的安全运行。
摘要由CSDN通过智能技术生成

下载地址:Apache Kafka

#创建应用目录 mkdir -p /storage
# wget -P /storage https://archive.apache.org/dist/kafka/2.3.0/kafka_2.11-2.3.0.tgz
#解压kafka应用包 tar -zxf kafka_2.11-2.3.0.tgz 修改目录名 mv kafka_2.11-2.3.0 kafka
根据实际情况创建需要的目录

修改配置文件:cd /storage/kafka/config

[root@test config]# cat zookeeper.properties
# limitations under the License.
# the directory where the snapshot is stored.
dataDir=/storage/zookeeper/data/zookeeper
dataLogDir=/storage/zookeeper/logs/zookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
#maxClientCnxns=0
#为zk的基本时间单元,毫秒
tickTime=2000
#Leader-Follower初始通信时限 tickTime*10
initLimit=10
#Leader-Follower同步通信时限 tickTime*5
syncLimit=5

#设置broker Id的服务地址
server.1=192.168.19.128:2888:3888


根据server.id,创建zookeeper的myid
echo 1 > /storage/kafka/data/zookeeper/myid

[root@test config]# cat server.properties
# broker 的全局唯一编号,不能重复,每台机器递增设置
broker.id=1
#服务器监听地址
listeners=SASL_PLAINTEXT://192.168.19.128:9092,client2://192.168.19.128:9093
#外部访问监听地址,根据服务器监听地址映射端口
advertised.listeners=SASL_PLAINTEXT://192.168.19.128:9092,client2://192.168.19.128:9093
listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL,client2:SASL_PLAINTEXT,client3:SASL_PLAINTEXT

# 使用的认证协议
security.inter.broker.protocol=SASL_PLAINTEXT 

#SASL机制 
sasl.enabled.mechanisms=PLAIN 
sasl.mechanism.inter.broker.prot

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值