安装KAFKA

三世轮回 提交于 2020-03-26 17:26:30

3 月,跳不动了?>>>

安装 ifconfig 这样的命令
yum -y install net-tools 

在外部访问CentOS中部署应用时,需要关闭防火墙。

关闭防火墙命令:systemctl stop firewalld.service

开启防火墙:systemctl start firewalld.service

关闭开机自启动:systemctl disable firewalld.service

开启开机启动:systemctl enable firewalld.service

 

 

从下边正式开始

yum -y install wget
安装 kafka

    1,wget  路径
    wget http://mirror.bit.edu.cn/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
    2,解压
    3,启动zookeeper 
    ./bin/zookeeper-server-start.sh  ./config/zookeeper.properties
    4 启动kafka
     ./bin/kafka-server-start.sh ./config/server.properties
    5.创建topic
    ./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
    通过list 查看刚才创建的topic
    ./bin/kafka-topics.sh -list -zookeeper localhost:2181
    6.启动producer 发送消息
    ./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
    
    
    
    
    主要的测试
    创建topic
    ./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
    消费者列表查询
    ./bin/kafka-topics.sh -list -zookeeper localhost:2181
    给这个topic下发送消息
     ./bin/kafka-console-producer.sh --broker-list 192.168.111.137:9092 --topic liuda
     查看消息
     ./bin/kafka-console-consumer.sh --bootstrap-server 192.168.111.137:9092 --topic li --from-beginning

重启kafka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!