Kafka代理端口在server.properties中被重新连接,但在同一端口中执行

qoefvg9y  于 6个月前  发布在  Apache
关注(0)|答案(1)|浏览(70)

我尝试在Kafka中使用多个代理,但是例如在端口9093中运行第一个代理id=1之后,然后在端口9092中运行第二个代理id=0,第一个被关闭,第二个使用端口9093。
serve.properties

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

#
# This configuration file is intended for use in ZK-based mode, where Apache ZooKeeper is required.
# 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=0
delete.topic.enable = true

############################# Socket Server Settings #############################

# The address the socket server listens on. If not configured, the host name will be equal to the value of
# java.net.InetAddress.getCanonicalHostName(), with PLAINTEXT listener name, and port 9092.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE
#listeners = PLAINTEXT://your.host.name:9092
listeners=PLAINTEXT://localhost:9092
log.dirs=/tmp/broker0

字符串
server_1.properties

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

#
# This configuration file is intended for use in ZK-based mode, where Apache ZooKeeper is required.
# 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 #############################

listeners=PLAINTEXT://localhost:9093
log.dirs=/tmp/broker1


在不同的端口使用多个代理在Kafka,我热这个错误:
第一经纪人:[2023-12-22 03:31:35,058] WARN [Controller id=1,targetBrokerId=0]无法建立到节点0(localhost/127.0.0.1:9092)的连接。代理可能不可用。(org.apache.Kafka.clients.NetworkClient)[2023-12-22 03:31:35,058] INFO [Controller id=1,targetBrokerId=0]客户端请求从节点0(org.apache.Kafka.clients.NetworkClient)关闭连接
第二经纪人:[2023-12-22 03:31:35,110] INFO Kafka版本:3.5.1(org.apache.Kafka.common.utils.AppInfoParser)[2023-12-22 03:31:35,111] INFO Kafka commitId:2c6fb6c54472e90a(org.apache.Kafka.common.utils.AppInfoParser)[2023-12-22 03:31:35,111] INFO Kafka startTimeMs:1703212295107(org.apache.Kafka.common.utils.AppInfoParser)[2023-12-22 03:31:35,112] INFO [KafkaServer id=0]已启动(Kafka.server.KafkaServer)[2023-12-22 03:31:35,244] INFO [zk-broker-0-to-controller-alter-partition-channel-manager]:记录了新的控制器,从现在开始将使用节点localhost:9093(id:1 rack:null)(Kafka.server.BrokerToControllerRequestThread)[2023-12-22 03:31:35,279] INFO [zk-broker-0-to-controller-forwarding-channel-manager]:已记录新控制器,从现在开始将使用节点localhost:9093(id:1 rack:null)(Kafka.server.BrokerToControllerRequestThread)

相关问题