当前位置:   article > 正文

kafka单台单节点安装配置_springcloud kafka单节点配置

springcloud kafka单节点配置

kafka单台单节点安装配置

       一台Debian-8_系统(基本安装+SSH)

       JDK环境jdk-8u191-linux-x64

       zookeeper-3.4.10

       kafka_2.11-2.1.0

       https://img-blog.csdn.net/20180126163645556?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvSEdfSGFydmV5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast

  • Debian系统安装(略)
  • JDK环境:
    • 上传JDK包
    • 配置JDK

mkdir -p /usr/java                                                         #创建java存放目录

tar -zxvf jdk-8u191-linux-x64.tar.gz -C /usr/java/          #解压jdk并存放到java目录

vim /etc/profile                                                              #编辑全局环境变量添加以下缩进处

export JAVA_HOME=/usr/java/jdk1.8.0_191    

export JRE_HOME=$JAVA_HOME/jre

export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib

export PATH=$JAVA_HOME/bin:$PATH

source /etc/profile                                                         #刷新环境变量

java -version                                                                #查看java是否成功

  • 安装zookeeper(注:kafka强依赖zk,当然kafka包里有zk,但是不建议使用)
    • 上传zookeeper-3.4.10.tar.gz
    • 安装配置zookeeper

mkdir -p /opt/hadoop/                                          #创建zookeeper存放目录

tar -zxvf zookeeper-3.4.10.tar.gz -C /opt/hadoop   #解压zookeeper

cd /opt/hadoop/zookeeper-3.4.10/conf/                 #进入zookeeper配置存放目录

mv zoo_sample.cfg zoo.cfg                                     #把配置文件改名

vim zoo.cfg                                                            #编辑配置文件(缩进处)

       dataDir=/home/hadoop/zkdata                #数据存放目录(topic/消费偏移信息/kafka集群信息)

       clientPort=2181                                               #端口

mkdir -p /home/hadoop/zkdata                             #创建存储目录

vim /etc/profile                                                       #编辑全局环境变量添加以下缩进处

# Zookeeper Environment Variable

export ZOOKEEPER_HOME=/opt/hadoop/zookeeper-3.4.10

export PATH=$PATH:$ZOOKEEPER_HOME/bin

              source /etc/profile                                                  #刷新环境变量

zkServer.sh start                                                     #启动zookeeper

zkServer.sh stop                                                     #关闭zookeeper

  • 安装kafka
  • 上传kafka_2.11-2.1.0.tgz
  • 安装配置kafka

tar -zxvf kafka_2.11-2.1.0.tgz -C /opt/hadoop/       #解压kafka

cd /opt/hadoop/kafka_2.11-2.1.0/conf                    #进入kafka配置目录

vim server.properties                                                #编辑配置文件

broker.id=0                                                       #broker的全局唯一标识

listeners=PLAINTEXT://9092                                    #监听

log.dirs=/home/hadoop/kafka-logs                 #日志目录

zookeeper.connect=localhost:2181                   #配置zookeeper的连接(IP或主机名)

vim /etc/profile                                                       #添加环境变量

export KAFKA_HOME=/opt/hadoop/kafka_2.11-2.1.0

export PATH=$PATH:$KAFKA_HOME/bin

source /etc/profile                                                  #刷新全局环境变量

zkServer.sh status                                                   #查看zookeeper的状态

kafka-server-start.sh /opt/hadoop/kafka_2.11-2.1.0/config/server.properties

                                                                             #启动kafka

                                                                             #成功的标识信息

但是并不能保证Kafka已经启动成功,输入jps查看进程如果可以看到Kafka进程,表示启动成功

至此kafka单台单节点部署完成

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/78616
推荐阅读
相关标签
  

闽ICP备14008679号