Kafka安装与配置

Kafka介绍

Kafka是一款流行分布式消息分布订阅系统,除Kafka之外还有MQ、Redis等。我们可以把消息队列视为一个管道,管道的两端分别是消息生产者(producer)和消息消费者(consumer),消息生产者产生日志等消息后可以发送到管道中,这时消息队列可以驻留在内存或者磁盘上,直到消费者来把它读走为止。

  • Producer:消息生产者,负责把产生的消息发送到Kafka服务器上。
  • Consumer:消息消费者,从Kafka服务器读取消息。
  • Consumer Group:消费者群组,每个消息消费者可以划分为一个特定的群组。
  • Topic:这是Kafka使用中非常重要的一个术语,它相当于消息的"身份标识",消息生产者产生消息时会给它贴上一个Topic标签,当消息消费者需要读取消息时,可以根据这个Topic读取特定的数据。
  • Broker:Kafka集群中包含的服务器。

环境

操作系统:Centos 7
Hadoop版本:2.9.2
JDK版本:1.8.0_221
Kafka版本:2.4.0
集群规划:

主机名IP
master192.168.1.121
slave1192.168.1.122
slave2192.168.1.123

下载

下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.4.0/

在这里插入图片描述

安装

下载完成之后,将压缩包解压到/home/apps/目录下,将解压之后的文件名改为kafka

[root@master dev]# tar - zxvf kafka_2.11-2.4.0.tgz
[root@master dev]# mkdir - p /home/apps
[root@master dev]# mv kafka_2.11-2.4.0 kafka
[root@master dev]# mv kafka /home/apps/
[root@master dev]# cd /home/apps/
[root@master apps]# ll
total 16
drwxr-xr-x. 7 root   root   4096 Jan 21 17:13 hbase
drwxr-xr-x. 7 root   root   4096 Jan 22 15:04 kafka
drwxr-xr-x. 9 centos centos 4096 Dec 19  2017 sqoop
drwxr-xr-x. 8 root   root   4096 Jan 15 20:58 zookeeper

配置

Kafka配置只需要修改Kafka/config/目录下的server.properties文件即可

新建日志文件目录

[root@master apps]# mkdir -p /home/apps/kafka/logs

进入config目录下,查看文件详细信息

[root@master apps]# cd kafka/config
[root@master config]# ll
total 72
-rw-r--r--. 1 root root  906 Jan 22 15:31 connect-console-sink.properties
-rw-r--r--. 1 root root  909 Jan 22 15:31 connect-console-source.properties
-rw-r--r--. 1 root root 5321 Jan 22 15:31 connect-distributed.properties
-rw-r--r--. 1 root root  883 Jan 22 15:31 connect-file-sink.properties
-rw-r--r--. 1 root root  881 Jan 22 15:31 connect-file-source.properties
-rw-r--r--. 1 root root 2247 Jan 22 15:31 connect-log4j.properties
-rw-r--r--. 1 root root 1539 Jan 22 15:31 connect-mirror-maker.properties
-rw-r--r--. 1 root root 2262 Jan 22 15:31 connect-standalone.properties
-rw-r--r--. 1 root root 1221 Jan 22 15:31 consumer.properties
-rw-r--r--. 1 root root 4675 Jan 22 15:31 log4j.properties
-rw-r--r--. 1 root root 1925 Jan 22 15:31 producer.properties
-rw-r--r--. 1 root root 6914 Jan 22 16:57 server.properties
-rw-r--r--. 1 root root 1032 Jan 22 15:31 tools-log4j.properties
-rw-r--r--. 1 root root 1169 Jan 22 15:31 trogdor.conf
-rw-r--r--. 1 root root 1441 Jan 22 15:31 zookeeper.properties

修改server.properties文件

[root@master config]# vi server.properties
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# see kafka.server.KafkaConfig for additional details and defaults

############################# Server Basics #############################

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=1

############################# 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

# Hostname and port the broker will advertise to producers and consumers. If not set,
# it uses the value for "listeners" if configured.  Otherwise, it will use the value
# returned from java.net.InetAddress.getCanonicalHostName().
#advertised.listeners=PLAINTEXT://you.host.name:9092
host.name=master
# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details
#listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL

# The number of threads that the server uses for receiving requests from the network and sending responses to the network
num.network.threads=3

# The number of threads that the server uses for processing requests, which may include disk I/O
num.io.threads=8

# The send buffer (SO_SNDBUF) used by the socket server
socket.send.buffer.bytes=102400

# The receive buffer (SO_RCVBUF) used by the socket server
socket.receive.buffer.bytes=102400

# The maximum size of a request that the socket server will accept (protection against OOM)
socket.request.max.bytes=104857600


############################# Log Basics #############################

# A comma separated list of directories under which to store log files
log.dirs=/home/apps/kafka/logs

# 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

# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
# This value is recommended to be increased for installations with data dirs located in RAID array.
num.recovery.threads.per.data.dir=1

############################# Internal Topic Settings  #############################
# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"
# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3.
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1

############################# Log Flush Policy #############################

# Messages are immediately written to the filesystem but by default we only fsync() to sync
# the OS cache lazily. The following configurations control the flush of data to disk.
# There are a few important trade-offs here:
#    1. Durability: Unflushed data may be lost if you are not using replication.
#    2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.
#    3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks.
# The settings below allow one to configure the flush policy to flush data after a period of time or
# every N messages (or both). This can be done globally and overridden on a per-topic basis.

# The number of messages to accept before forcing a flush of data to disk
#log.flush.interval.messages=10000

# The maximum amount of time a message can sit in a log before we force a flush
#log.flush.interval.ms=1000

############################# Log Retention Policy #############################

# The following configurations control the disposal of log segments. The policy can
# be set to delete segments after a period of time, or after a given size has accumulated.
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
# from the end of the log.

# The minimum age of a log file to be eligible for deletion due to age
log.retention.hours=168

# A size-based retention policy for logs. Segments are pruned from the log unless the remaining

# The maximum size of a log segment file. When this size is reached a new log segment will be created.
# The interval at which log segments are checked to see if they can be deleted according
# to the retention policies
log.retention.check.interval.ms=300000

############################# Zookeeper #############################

# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
zookeeper.connect=192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181

# Timeout in ms for connecting to zookeeper
zookeeper.connection.timeout.ms=6000


############################# Group Coordinator Settings #############################

# The following configuration specifies the time, in milliseconds, that the GroupCoordinator will delay the initial consumer rebalance.
# The rebalance will be further delayed by the value of group.initial.rebalance.delay.ms as new members join the group, up to a maximum of max.poll.interval.ms.
# The default value for this is 3 seconds.
# We override this to 0 here as it makes for a better out-of-the-box experience for development and testing.
# However, in production environments the default value of 3 seconds is more suitable as this will help to avoid unnecessary, and potentially expensive, rebalances during application startup.
group.initial.rebalance.delay.ms=0

博主的服务器集群

主机名(IP地址)broker.id
master(192.168.1.121)1
slave1(192.168.1.122)2
slave2(192.168.1.123)3

添加配置

host.name=master(主机名)

修改配置

broker.id=1(每个节点都需要设置id)
zookeeper.connect=192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181

master节点配置成功之后,将Kafka文件传输到其他节点上

[root@master apps]# scp -r /home/apps/kafka/ root@slave1:/home/apps/
[root@master apps]# scp -r /home/apps/kafka/ root@slave2:/home/apps/

修改其他节点server.properties配置文件
slave1

broker.id=2
host.name=slave1(主机名)

slave2

broker.id=3
host.name=slave2(主机名)

启动Kafka

启动Kafka之前需要启动zookeeper;如果没有安装zookeeper,可以使用下面链接安装配置。
zookeeper安装与配置

[root@master ~]# cd /home/apps/kafka/bin
[root@master bin]# ./kafka-server-start.sh ../config/server.properties
[2021-01-22 16:59:19,731] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2021-01-22 16:59:20,116] INFO Registered signal handlers for TERM, INT, HUP (org.apache.kafka.common.utils.LoggingSignalHandler)
[2021-01-22 16:59:20,117] INFO starting (kafka.server.KafkaServer)
[2021-01-22 16:59:20,118] INFO Connecting to zookeeper on 192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181 (kafka.server.KafkaServer)
[2021-01-22 16:59:20,154] INFO [ZooKeeperClient Kafka server] Initializing a new session to 192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:20,160] INFO Client environment:zookeeper.version=3.5.6-c11b7e26bc554b8523dc929761dd28808913f091, built on 10/08/2019 20:18 GMT (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:host.name=XAA01 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:java.version=1.8.0_221 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:java.home=/usr/local/jdk/jdk1.8.0_221/jre (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:java.class.path=.:.::/usr/local/jdk/jdk1.8.0_221/lib:/usr/local/jdk/jdk1.8.0_221/jre/lib:/usr/local/jdk/jdk1.8.0_221/lib:/usr/local/jdk/jdk1.8.0_221/jre/lib:/home/apps/kafka/bin/../libs/activation-1.1.1.jar:/home/apps/kafka/bin/../libs/aopalliance-repackaged-2.5.0.jar:/home/apps/kafka/bin/../libs/argparse4j-0.7.0.jar:/home/apps/kafka/bin/../libs/audience-annotations-0.5.0.jar:/home/apps/kafka/bin/../libs/commons-cli-1.4.jar:/home/apps/kafka/bin/../libs/commons-lang3-3.8.1.jar:/home/apps/kafka/bin/../libs/connect-api-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-basic-auth-extension-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-file-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-json-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-mirror-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-mirror-client-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-runtime-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-transforms-2.4.0.jar:/home/apps/kafka/bin/../libs/guava-20.0.jar:/home/apps/kafka/bin/../libs/hk2-api-2.5.0.jar:/home/apps/kafka/bin/../libs/hk2-locator-2.5.0.jar:/home/apps/kafka/bin/../libs/hk2-utils-2.5.0.jar:/home/apps/kafka/bin/../libs/jackson-annotations-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-core-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-databind-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-dataformat-csv-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-datatype-jdk8-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-jaxrs-base-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-jaxrs-json-provider-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-jaxb-annotations-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-paranamer-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-scala_2.11-2.10.0.jar:/home/apps/kafka/bin/../libs/jakarta.activation-api-1.2.1.jar:/home/apps/kafka/bin/../libs/jakarta.annotation-api-1.3.4.jar:/home/apps/kafka/bin/../libs/jakarta.inject-2.5.0.jar:/home/apps/kafka/bin/../libs/jakarta.ws.rs-api-2.1.5.jar:/home/apps/kafka/bin/../libs/jakarta.xml.bind-api-2.3.2.jar:/home/apps/kafka/bin/../libs/javassist-3.22.0-CR2.jar:/home/apps/kafka/bin/../libs/javax.servlet-api-3.1.0.jar:/home/apps/kafka/bin/../libs/javax.ws.rs-api-2.1.1.jar:/home/apps/kafka/bin/../libs/jaxb-api-2.3.0.jar:/home/apps/kafka/bin/../libs/jersey-client-2.28.jar:/home/apps/kafka/bin/../libs/jersey-common-2.28.jar:/home/apps/kafka/bin/../libs/jersey-container-servlet-2.28.jar:/home/apps/kafka/bin/../libs/jersey-container-servlet-core-2.28.jar:/home/apps/kafka/bin/../libs/jersey-hk2-2.28.jar:/home/apps/kafka/bin/../libs/jersey-media-jaxb-2.28.jar:/home/apps/kafka/bin/../libs/jersey-server-2.28.jar:/home/apps/kafka/bin/../libs/jetty-client-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-continuation-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-http-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-io-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-security-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-server-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-servlet-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-servlets-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-util-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jopt-simple-5.0.4.jar:/home/apps/kafka/bin/../libs/kafka_2.11-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka_2.11-2.4.0-sources.jar:/home/apps/kafka/bin/../libs/kafka-clients-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-log4j-appender-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-examples-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-scala_2.11-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-test-utils-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-tools-2.4.0.jar:/home/apps/kafka/bin/../libs/log4j-1.2.17.jar:/home/apps/kafka/bin/../libs/lz4-java-1.6.0.jar:/home/apps/kafka/bin/../libs/maven-artifact-3.6.1.jar:/home/apps/kafka/bin/../libs/metrics-core-2.2.0.jar:/home/apps/kafka/bin/../libs/netty-buffer-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-codec-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-common-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-handler-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-resolver-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-native-epoll-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-native-unix-common-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/osgi-resource-locator-1.0.1.jar:/home/apps/kafka/bin/../libs/paranamer-2.8.jar:/home/apps/kafka/bin/../libs/plexus-utils-3.2.0.jar:/home/apps/kafka/bin/../libs/reflections-0.9.11.jar:/home/apps/kafka/bin/../libs/rocksdbjni-5.18.3.jar:/home/apps/kafka/bin/../libs/scala-collection-compat_2.11-2.1.2.jar:/home/apps/kafka/bin/../libs/scala-java8-compat_2.11-0.9.0.jar:/home/apps/kafka/bin/../libs/scala-library-2.11.12.jar:/home/apps/kafka/bin/../libs/scala-logging_2.11-3.9.2.jar:/home/apps/kafka/bin/../libs/scala-reflect-2.11.12.jar:/home/apps/kafka/bin/../libs/slf4j-api-1.7.28.jar:/home/apps/kafka/bin/../libs/slf4j-log4j12-1.7.28.jar:/home/apps/kafka/bin/../libs/snappy-java-1.1.7.3.jar:/home/apps/kafka/bin/../libs/validation-api-2.0.1.Final.jar:/home/apps/kafka/bin/../libs/zookeeper-3.5.6.jar:/home/apps/kafka/bin/../libs/zookeeper-jute-3.5.6.jar:/home/apps/kafka/bin/../libs/zstd-jni-1.4.3-1.jar (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,161] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:os.version=3.10.0-1127.19.1.el7.x86_64 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:user.name=root (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:user.dir=/home/apps/kafka/bin (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:os.memory.free=1014MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:os.memory.max=1024MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,162] INFO Client environment:os.memory.total=1024MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,164] INFO Initiating client connection, connectString=192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181 sessionTimeout=6000 watcher=kafka.zookeeper.ZooKeeperClient$ZooKeeperClientWatcher$@443118b0 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:20,170] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
[2021-01-22 16:59:20,176] INFO jute.maxbuffer value is 4194304 Bytes (org.apache.zookeeper.ClientCnxnSocket)
[2021-01-22 16:59:20,182] INFO zookeeper.request.timeout value is 0. feature enabled= (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:20,184] INFO [ZooKeeperClient Kafka server] Waiting until connected. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:20,188] INFO Opening socket connection to server XAA01/192.168.1.121:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:20,192] INFO Socket connection established, initiating session, client: /192.168.1.121:52146, server: XAA01/192.168.1.121:2181 (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:20,215] INFO Session establishment complete on server XAA01/192.168.1.121:2181, sessionid = 0x10001c75e82000c, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:20,218] INFO [ZooKeeperClient Kafka server] Connected. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:20,541] INFO Cluster ID = 78fsL1r5Tn2UwfldnhakFQ (kafka.server.KafkaServer)
[2021-01-22 16:59:20,543] WARN No meta.properties file under dir /home/apps/kafka/logs/meta.properties (kafka.server.BrokerMetadataCheckpoint)
[2021-01-22 16:59:20,592] INFO KafkaConfig values: 

slave1节点

[root@slave1 bin]# ./kafka-server-start.sh ../config/server.properties 
[2021-01-22 16:59:35,504] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2021-01-22 16:59:35,854] INFO Registered signal handlers for TERM, INT, HUP (org.apache.kafka.common.utils.LoggingSignalHandler)
[2021-01-22 16:59:35,854] INFO starting (kafka.server.KafkaServer)
[2021-01-22 16:59:35,855] INFO Connecting to zookeeper on 192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181 (kafka.server.KafkaServer)
[2021-01-22 16:59:35,891] INFO [ZooKeeperClient Kafka server] Initializing a new session to 192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:35,897] INFO Client environment:zookeeper.version=3.5.6-c11b7e26bc554b8523dc929761dd28808913f091, built on 10/08/2019 20:18 GMT (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:host.name=XAA02 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:java.version=1.8.0_221 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:java.home=/usr/local/jdk/jdk1.8.0_221/jre (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:java.class.path=.::/usr/local/jdk/jdk1.8.0_221/lib:/usr/local/jdk/jdk1.8.0_221/jre/lib:/home/apps/kafka/bin/../libs/activation-1.1.1.jar:/home/apps/kafka/bin/../libs/aopalliance-repackaged-2.5.0.jar:/home/apps/kafka/bin/../libs/argparse4j-0.7.0.jar:/home/apps/kafka/bin/../libs/audience-annotations-0.5.0.jar:/home/apps/kafka/bin/../libs/commons-cli-1.4.jar:/home/apps/kafka/bin/../libs/commons-lang3-3.8.1.jar:/home/apps/kafka/bin/../libs/connect-api-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-basic-auth-extension-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-file-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-json-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-mirror-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-mirror-client-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-runtime-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-transforms-2.4.0.jar:/home/apps/kafka/bin/../libs/guava-20.0.jar:/home/apps/kafka/bin/../libs/hk2-api-2.5.0.jar:/home/apps/kafka/bin/../libs/hk2-locator-2.5.0.jar:/home/apps/kafka/bin/../libs/hk2-utils-2.5.0.jar:/home/apps/kafka/bin/../libs/jackson-annotations-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-core-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-databind-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-dataformat-csv-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-datatype-jdk8-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-jaxrs-base-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-jaxrs-json-provider-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-jaxb-annotations-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-paranamer-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-scala_2.11-2.10.0.jar:/home/apps/kafka/bin/../libs/jakarta.activation-api-1.2.1.jar:/home/apps/kafka/bin/../libs/jakarta.annotation-api-1.3.4.jar:/home/apps/kafka/bin/../libs/jakarta.inject-2.5.0.jar:/home/apps/kafka/bin/../libs/jakarta.ws.rs-api-2.1.5.jar:/home/apps/kafka/bin/../libs/jakarta.xml.bind-api-2.3.2.jar:/home/apps/kafka/bin/../libs/javassist-3.22.0-CR2.jar:/home/apps/kafka/bin/../libs/javax.servlet-api-3.1.0.jar:/home/apps/kafka/bin/../libs/javax.ws.rs-api-2.1.1.jar:/home/apps/kafka/bin/../libs/jaxb-api-2.3.0.jar:/home/apps/kafka/bin/../libs/jersey-client-2.28.jar:/home/apps/kafka/bin/../libs/jersey-common-2.28.jar:/home/apps/kafka/bin/../libs/jersey-container-servlet-2.28.jar:/home/apps/kafka/bin/../libs/jersey-container-servlet-core-2.28.jar:/home/apps/kafka/bin/../libs/jersey-hk2-2.28.jar:/home/apps/kafka/bin/../libs/jersey-media-jaxb-2.28.jar:/home/apps/kafka/bin/../libs/jersey-server-2.28.jar:/home/apps/kafka/bin/../libs/jetty-client-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-continuation-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-http-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-io-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-security-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-server-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-servlet-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-servlets-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-util-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jopt-simple-5.0.4.jar:/home/apps/kafka/bin/../libs/kafka_2.11-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka_2.11-2.4.0-sources.jar:/home/apps/kafka/bin/../libs/kafka-clients-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-log4j-appender-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-examples-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-scala_2.11-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-test-utils-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-tools-2.4.0.jar:/home/apps/kafka/bin/../libs/log4j-1.2.17.jar:/home/apps/kafka/bin/../libs/lz4-java-1.6.0.jar:/home/apps/kafka/bin/../libs/maven-artifact-3.6.1.jar:/home/apps/kafka/bin/../libs/metrics-core-2.2.0.jar:/home/apps/kafka/bin/../libs/netty-buffer-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-codec-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-common-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-handler-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-resolver-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-native-epoll-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-native-unix-common-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/osgi-resource-locator-1.0.1.jar:/home/apps/kafka/bin/../libs/paranamer-2.8.jar:/home/apps/kafka/bin/../libs/plexus-utils-3.2.0.jar:/home/apps/kafka/bin/../libs/reflections-0.9.11.jar:/home/apps/kafka/bin/../libs/rocksdbjni-5.18.3.jar:/home/apps/kafka/bin/../libs/scala-collection-compat_2.11-2.1.2.jar:/home/apps/kafka/bin/../libs/scala-java8-compat_2.11-0.9.0.jar:/home/apps/kafka/bin/../libs/scala-library-2.11.12.jar:/home/apps/kafka/bin/../libs/scala-logging_2.11-3.9.2.jar:/home/apps/kafka/bin/../libs/scala-reflect-2.11.12.jar:/home/apps/kafka/bin/../libs/slf4j-api-1.7.28.jar:/home/apps/kafka/bin/../libs/slf4j-log4j12-1.7.28.jar:/home/apps/kafka/bin/../libs/snappy-java-1.1.7.3.jar:/home/apps/kafka/bin/../libs/validation-api-2.0.1.Final.jar:/home/apps/kafka/bin/../libs/zookeeper-3.5.6.jar:/home/apps/kafka/bin/../libs/zookeeper-jute-3.5.6.jar:/home/apps/kafka/bin/../libs/zstd-jni-1.4.3-1.jar (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,897] INFO Client environment:os.version=3.10.0-1127.19.1.el7.x86_64 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,898] INFO Client environment:user.name=root (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,898] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,898] INFO Client environment:user.dir=/home/apps/kafka/bin (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,898] INFO Client environment:os.memory.free=1014MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,898] INFO Client environment:os.memory.max=1024MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,898] INFO Client environment:os.memory.total=1024MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,900] INFO Initiating client connection, connectString=192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181 sessionTimeout=6000 watcher=kafka.zookeeper.ZooKeeperClient$ZooKeeperClientWatcher$@443118b0 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:35,905] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
[2021-01-22 16:59:35,910] INFO jute.maxbuffer value is 4194304 Bytes (org.apache.zookeeper.ClientCnxnSocket)
[2021-01-22 16:59:35,917] INFO zookeeper.request.timeout value is 0. feature enabled= (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:35,918] INFO [ZooKeeperClient Kafka server] Waiting until connected. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:35,923] INFO Opening socket connection to server XAA02/192.168.1.122:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:35,927] INFO Socket connection established, initiating session, client: /192.168.1.122:40128, server: XAA02/192.168.1.122:2181 (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:35,966] INFO Session establishment complete on server XAA02/192.168.1.122:2181, sessionid = 0x2000008af200006, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:35,970] INFO [ZooKeeperClient Kafka server] Connected. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:36,359] INFO Cluster ID = 78fsL1r5Tn2UwfldnhakFQ (kafka.server.KafkaServer)
[2021-01-22 16:59:36,362] WARN No meta.properties file under dir /home/apps/kafka/logs/meta.properties (kafka.server.BrokerMetadataCheckpoint)
[2021-01-22 16:59:36,409] INFO KafkaConfig values: 

slave2节点

[root@slave2 bin]# ./kafka-server-start.sh ../config/server.properties 
[2021-01-22 16:59:56,133] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2021-01-22 16:59:56,458] INFO Registered signal handlers for TERM, INT, HUP (org.apache.kafka.common.utils.LoggingSignalHandler)
[2021-01-22 16:59:56,458] INFO starting (kafka.server.KafkaServer)
[2021-01-22 16:59:56,459] INFO Connecting to zookeeper on 192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181 (kafka.server.KafkaServer)
[2021-01-22 16:59:56,484] INFO [ZooKeeperClient Kafka server] Initializing a new session to 192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:56,491] INFO Client environment:zookeeper.version=3.5.6-c11b7e26bc554b8523dc929761dd28808913f091, built on 10/08/2019 20:18 GMT (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,491] INFO Client environment:host.name=XAA03 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,491] INFO Client environment:java.version=1.8.0_221 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:java.home=/usr/local/jdk/jdk1.8.0_221/jre (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:java.class.path=.::/usr/local/jdk/jdk1.8.0_221/lib:/usr/local/jdk/jdk1.8.0_221/jre/lib:/home/apps/kafka/bin/../libs/activation-1.1.1.jar:/home/apps/kafka/bin/../libs/aopalliance-repackaged-2.5.0.jar:/home/apps/kafka/bin/../libs/argparse4j-0.7.0.jar:/home/apps/kafka/bin/../libs/audience-annotations-0.5.0.jar:/home/apps/kafka/bin/../libs/commons-cli-1.4.jar:/home/apps/kafka/bin/../libs/commons-lang3-3.8.1.jar:/home/apps/kafka/bin/../libs/connect-api-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-basic-auth-extension-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-file-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-json-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-mirror-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-mirror-client-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-runtime-2.4.0.jar:/home/apps/kafka/bin/../libs/connect-transforms-2.4.0.jar:/home/apps/kafka/bin/../libs/guava-20.0.jar:/home/apps/kafka/bin/../libs/hk2-api-2.5.0.jar:/home/apps/kafka/bin/../libs/hk2-locator-2.5.0.jar:/home/apps/kafka/bin/../libs/hk2-utils-2.5.0.jar:/home/apps/kafka/bin/../libs/jackson-annotations-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-core-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-databind-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-dataformat-csv-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-datatype-jdk8-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-jaxrs-base-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-jaxrs-json-provider-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-jaxb-annotations-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-paranamer-2.10.0.jar:/home/apps/kafka/bin/../libs/jackson-module-scala_2.11-2.10.0.jar:/home/apps/kafka/bin/../libs/jakarta.activation-api-1.2.1.jar:/home/apps/kafka/bin/../libs/jakarta.annotation-api-1.3.4.jar:/home/apps/kafka/bin/../libs/jakarta.inject-2.5.0.jar:/home/apps/kafka/bin/../libs/jakarta.ws.rs-api-2.1.5.jar:/home/apps/kafka/bin/../libs/jakarta.xml.bind-api-2.3.2.jar:/home/apps/kafka/bin/../libs/javassist-3.22.0-CR2.jar:/home/apps/kafka/bin/../libs/javax.servlet-api-3.1.0.jar:/home/apps/kafka/bin/../libs/javax.ws.rs-api-2.1.1.jar:/home/apps/kafka/bin/../libs/jaxb-api-2.3.0.jar:/home/apps/kafka/bin/../libs/jersey-client-2.28.jar:/home/apps/kafka/bin/../libs/jersey-common-2.28.jar:/home/apps/kafka/bin/../libs/jersey-container-servlet-2.28.jar:/home/apps/kafka/bin/../libs/jersey-container-servlet-core-2.28.jar:/home/apps/kafka/bin/../libs/jersey-hk2-2.28.jar:/home/apps/kafka/bin/../libs/jersey-media-jaxb-2.28.jar:/home/apps/kafka/bin/../libs/jersey-server-2.28.jar:/home/apps/kafka/bin/../libs/jetty-client-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-continuation-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-http-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-io-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-security-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-server-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-servlet-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-servlets-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jetty-util-9.4.20.v20190813.jar:/home/apps/kafka/bin/../libs/jopt-simple-5.0.4.jar:/home/apps/kafka/bin/../libs/kafka_2.11-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka_2.11-2.4.0-sources.jar:/home/apps/kafka/bin/../libs/kafka-clients-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-log4j-appender-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-examples-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-scala_2.11-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-streams-test-utils-2.4.0.jar:/home/apps/kafka/bin/../libs/kafka-tools-2.4.0.jar:/home/apps/kafka/bin/../libs/log4j-1.2.17.jar:/home/apps/kafka/bin/../libs/lz4-java-1.6.0.jar:/home/apps/kafka/bin/../libs/maven-artifact-3.6.1.jar:/home/apps/kafka/bin/../libs/metrics-core-2.2.0.jar:/home/apps/kafka/bin/../libs/netty-buffer-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-codec-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-common-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-handler-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-resolver-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-native-epoll-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/netty-transport-native-unix-common-4.1.42.Final.jar:/home/apps/kafka/bin/../libs/osgi-resource-locator-1.0.1.jar:/home/apps/kafka/bin/../libs/paranamer-2.8.jar:/home/apps/kafka/bin/../libs/plexus-utils-3.2.0.jar:/home/apps/kafka/bin/../libs/reflections-0.9.11.jar:/home/apps/kafka/bin/../libs/rocksdbjni-5.18.3.jar:/home/apps/kafka/bin/../libs/scala-collection-compat_2.11-2.1.2.jar:/home/apps/kafka/bin/../libs/scala-java8-compat_2.11-0.9.0.jar:/home/apps/kafka/bin/../libs/scala-library-2.11.12.jar:/home/apps/kafka/bin/../libs/scala-logging_2.11-3.9.2.jar:/home/apps/kafka/bin/../libs/scala-reflect-2.11.12.jar:/home/apps/kafka/bin/../libs/slf4j-api-1.7.28.jar:/home/apps/kafka/bin/../libs/slf4j-log4j12-1.7.28.jar:/home/apps/kafka/bin/../libs/snappy-java-1.1.7.3.jar:/home/apps/kafka/bin/../libs/validation-api-2.0.1.Final.jar:/home/apps/kafka/bin/../libs/zookeeper-3.5.6.jar:/home/apps/kafka/bin/../libs/zookeeper-jute-3.5.6.jar:/home/apps/kafka/bin/../libs/zstd-jni-1.4.3-1.jar (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:os.version=3.10.0-1127.19.1.el7.x86_64 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:user.name=root (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,492] INFO Client environment:user.dir=/home/apps/kafka/bin (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,493] INFO Client environment:os.memory.free=1014MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,493] INFO Client environment:os.memory.max=1024MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,493] INFO Client environment:os.memory.total=1024MB (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,496] INFO Initiating client connection, connectString=192.168.1.121:2181,192.168.1.122:2181,192.168.1.123:2181 sessionTimeout=6000 watcher=kafka.zookeeper.ZooKeeperClient$ZooKeeperClientWatcher$@443118b0 (org.apache.zookeeper.ZooKeeper)
[2021-01-22 16:59:56,501] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
[2021-01-22 16:59:56,506] INFO jute.maxbuffer value is 4194304 Bytes (org.apache.zookeeper.ClientCnxnSocket)
[2021-01-22 16:59:56,512] INFO zookeeper.request.timeout value is 0. feature enabled= (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:56,514] INFO [ZooKeeperClient Kafka server] Waiting until connected. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:56,518] INFO Opening socket connection to server XAA03/192.168.1.123:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:56,523] INFO Socket connection established, initiating session, client: /192.168.1.123:57660, server: XAA03/192.168.1.123:2181 (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:56,544] INFO Session establishment complete on server XAA03/192.168.1.123:2181, sessionid = 0x3000008fd580004, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
[2021-01-22 16:59:56,547] INFO [ZooKeeperClient Kafka server] Connected. (kafka.zookeeper.ZooKeeperClient)
[2021-01-22 16:59:56,874] INFO Cluster ID = 78fsL1r5Tn2UwfldnhakFQ (kafka.server.KafkaServer)
[2021-01-22 16:59:56,877] WARN No meta.properties file under dir /home/apps/kafka/logs/meta.properties (kafka.server.BrokerMetadataCheckpoint)
[2021-01-22 16:59:56,924] INFO KafkaConfig values: 

到此启动成功

可以使用后台启动
master

[root@master bin]# ./kafka-server-start.sh -daemon ../config/server.properties

slave1

[root@slave1 bin]# ./kafka-server-start.sh -daemon ../config/server.properties

slave2

[root@slave2 bin]# ./kafka-server-start.sh  -daemon ../config/server.properties

查看启动是否成功
使用jps命令

master

[root@master config]# jps
4050 NameNode
12804 QuorumPeerMain
9141 HRegionServer
20663 Jps
4503 SecondaryNameNode
28712 Kafka
4248 DataNode
8985 HMaster
4892 NodeManager
4751 ResourceManager

slave1

[root@slave1 ~]# jps
5601 QuorumPeerMain
23553 Jps
2983 DataNode
18332 Kafka
3278 NodeManager

slave2

[root@slave2 ~]# jps
5601 QuorumPeerMain
23553 Jps
2983 DataNode
18332 Kafka
3278 NodeManager

结语:大数据Hadoop笔记 Kafka 安装与配置

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 1024 设计师:白松林 返回首页