1.下載安裝包並解壓
kafka_2.11-2.1.0.tgz 詳解: https://blog.csdn.net/lingbo229/article/details/80761778
2. 配置kafka集羣
cd /usr/local/kafka_2.11-2.1.0/config ############################# Server Basics ############################# # The id of the broker. This must be set to a unique integer for each broker. broker.id=0 # 這個標識是kafka這臺服務器 ############################# Socket Server Settings ############################# # The address the socket server listens on. It will get the value returned from # java.net.InetAddress.getCanonicalHostName() if not configured. # FORMAT: # listeners = listener_name://host_name:port # EXAMPLE: # listeners = PLAINTEXT://your.host.name:9092 #listeners=PLAINTEXT://:9092 # kafka 監聽地址端口 ############################# Log Basics ############################# # A comma separated list of directories under which to store log files log.dirs=/tmp/kafka-logs # 日誌存儲目錄 & 保存kafka數據(維護消息持久化) # The default number of log partitions per topic. More partitions allow greater # parallelism for consumption, but this will also result in more files across # the brokers. num.partitions=1 #存儲kafka每條消息的分區數量