kafka (1) -----kafka installation and deployment

kafka installation and deployment

Unzip the kafka archive

$ tar -zxvf kafka_2.11-0.11.0.0.tgz -C /usr/local/src/

Enter the kafka directory and create a logs folder

$ cd /usr/local/src/kafka_2.11-0.11.0.0/

$ mkdir logs

Enter the config directory to modify the configuration file

server.properties file

  • delete.topic.enable=true
    #删除topic功能使能
  • log.dirs=/usr/local/src/kafka_2.11-0.11.0.0/logs
    #kafka运行日志存放的路径
  • zookeeper.connect=master:2181,slave1:2181,slave2:2181
    #配置连接Zookeeper集群地址
  • broker.id=0
    broker的全局唯一编号,不能重复

Distribute the entire kafkad directory to other machine nodes

注意:分发完成之后修改server.properties文件中broker.id属性

add variable environment

export KAFKA_HOME=/usr/local/src/kafka_2.11-0.11.0.0
export PATH=$PATH:$KAFKA_HOME/bin

Start the kafka cluster

  • First start the zk cluster

  • kafka cluster start and stop
  • 启动
    master:$ bin/kafka-server-start.sh config/server.properties &

    slave1:$ bin/kafka-server-start.sh config/server.properties &

    slave2:$ bin/kafka-server-start.sh config/server.properties &

  • Stop
    $ bin / kafka-server-stop.sh

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325536956&siteId=291194637