美文网首页
Kafka的安装

Kafka的安装

作者: 薛落花随泪绽放 | 来源:发表于2018-01-03 19:52 被阅读11次
    #cd training
    # tar -zxvf kafka_2.9.2-0.8.1.1.tgz 
    # rm -rf kafka_2.9.2-0.8.1.1.tgz
    # mv kafka_2.9.2-0.8.1.1/ kafka
    #cd kafka
    # mkdir -p logs/broker1
    # mkdir -p logs/broker2
    cd logs/broker1
    #pwd
    /root/training/kafka/logs/broker1
    #cd ../../config
    # vi server.properties 
    log.dirs=/root/training/kafka/logs/broker1
    zookeeper.connect=192.168.56.11:2181,192.168.56.12:2181,192.168.56.13:2181
    # cp server.properties server1.properties
    #vi server1.properties 
    broker.id=1
    port=9093
    #cd ..
    #jps
    # bin/kafka-server-start.sh config/server.properties &
    # bin/kafka-server-start.sh config/server2.properties &
    # vi config/server1.properties 
    log.dirs=/root/training/kafka/logs/broker2
    # bin/kafka-server-start.sh config/server2.properties &
    #jps
    17413 Jps
    17240 Kafka
    17374 Kafka
    # bin/kafka-topics.sh --create --zookeeper 192.168.56.11:2181 --replication-factor 1 --partitions 3 --topic mydemo2
    
    # cd training/kafka_2.9.2-0.8.1/
    # ls bin/
    # bin/kafka-console-producer.sh --broker-list 192.168.56.102:9092 --topic mydemo2
    
    # bin/kafka-console-consumer.sh --zookeeper 192.168.56.11:2181 --topic mydemo2
    

    相关文章

      网友评论

          本文标题:Kafka的安装

          本文链接:https://www.haomeiwen.com/subject/ocsknxtx.html