zookeeper和kafka安装

Bertha 。 2023-03-14 08:09 132阅读 0赞

目录

一、zookeeper

1st 上传包到待安装位置,解压

2nd 添加配置

3rd 启动

4th 停止

二、kafka

1st 上传包到待安装位置,解压

2nd 启动kafka

3rd 测试验证

4th 停止kafka


一、zookeeper

1st 上传包到待安装位置,解压

最终效果如下

20200516175751570.png

2nd 添加配置

在conf中,创建zoo.cfg.

或者以zoo_sample.cfg为蓝本修改,并重命名为zoo.cfg

zoo.cfg内容如下

  1. # The number of milliseconds of each tick
  2. tickTime=2000
  3. # The number of ticks that the initial
  4. # synchronization phase can take
  5. initLimit=10
  6. # The number of ticks that can pass between
  7. # sending a request and getting an acknowledgement
  8. syncLimit=5
  9. # the directory where the snapshot is stored.
  10. # do not use /tmp for storage, /tmp here is just
  11. # example sakes.
  12. dataDir=/data/kafka/zookeeper/data
  13. # the port at which the clients will connect
  14. clientPort=2181
  15. # the maximum number of client connections.
  16. # increase this if you need to handle more clients
  17. #maxClientCnxns=60
  18. #
  19. # Be sure to read the maintenance section of the
  20. # administrator guide before turning on autopurge.
  21. #
  22. # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
  23. #
  24. # The number of snapshots to retain in dataDir
  25. #autopurge.snapRetainCount=3
  26. # Purge task interval in hours
  27. # Set to "0" to disable auto purge feature
  28. #autopurge.purgeInterval=1

3rd 启动

  1. ./bin/zkServer.sh start

4th 停止

  1. ./bin/zkServer.sh stop

二、kafka

1st 上传包到待安装位置,解压

最终效果如下

20200516182105187.png

2nd 启动kafka

  1. ./bin/kafka-server-start.sh -daemon ./config/server.properties

注意:kafka中zookeeper相关配置是否正确。

3rd 测试验证

  1. ./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

20200516182403710.png

4th 停止kafka

  1. ./kafka-server-stop.sh

发表评论

表情:
评论列表 (有 0 条评论,132人围观)

还没有评论,来说两句吧...

相关阅读