kafka connect“worker\u id”设置为环回“127.0.1.1:8083”?

zpqajqem  于 2021-06-06  发布在  Kafka
关注(0)|答案(1)|浏览(363)

我有一个三节点融合的Kafka簇。每个节点都运行zookeeper、kafka broker、schema registry和kafka connect。
我已经配置了一个s3接收器。它似乎在运行,但是 worker_id 设置为环回ip地址而不是唯一ip,这看起来是错误的:

curl "localhost:8083/connectors/my-s3-sink/status" | jq '.'

{
  "name": "my-s3-sink",
  "connector": {
    "state": "RUNNING",
    "worker_id": "127.0.1.1:8083"
  },
  "tasks": [
    {
      "state": "RUNNING",
      "id": 0,
      "worker_id": "127.0.1.1:8083"
    }
  ],
  "type": "sink"
}

Kafka如何获得 127.0.1.1:8083 环回地址?我认为这对于生产三节点集群是不正确的。
如何检查群集配置以找到问题?
我通过systemd via启动kafka connect /usr/bin/connect-distributed /etc/kafka/connect-distributed.properties 以及 bootstrap.servers 在该属性中,文件被设置为不解析为环回ip的三节点ip(我 x 输出隐私的实际ip值)

bootstrap.servers=172.x.x.x:9092,172.x.x.x:9092,172.x.x.x:9092

我的Kafka经纪人配置了 /etc/kafka/server.properties 设置:

listeners=PLAINTEXT://0.0.0.0:9092

# EC2 public hostname

advertised.listeners=PLAINTEXT://ec2-34-x-x-x.us-west-2.compute.amazonaws.com:9092

# EC2 internal/private hostnames. localhost entry will resolve to 127.0.1.1

zookeeper.connect=ip-172-x-x-x.us-west-2.compute.internal:2181,ip-172-x-x-x.us-west-2.compute.internal:2181,ip-172-x-x-x.us-west-2.compute.internal:2181

以及 /etc/kafka/zookeeper.properties 配置为:

server.1=172.x.x.x:2888:3888
server.2=172.x.x.x:2888:3888
server.3=172.x.x.x:2888:3888
xuo3flqw

xuo3flqw1#

财产 rest.host.name 需要配置为中每个示例的ip或主机名 connect-distributed.properties . 集群领导者使用restapi来平衡集群中的任务,因此也需要更新 rest.host.port 如果您不使用8083。


# Hostname & Port for the REST API to listen on. If this is set,

# it will bind to the interface used to listen to requests.

# rest.host.name=

# rest.port=8083

相关问题