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

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

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

  1. curl "localhost:8083/connectors/my-s3-sink/status" | jq '.'
  2. {
  3. "name": "my-s3-sink",
  4. "connector": {
  5. "state": "RUNNING",
  6. "worker_id": "127.0.1.1:8083"
  7. },
  8. "tasks": [
  9. {
  10. "state": "RUNNING",
  11. "id": 0,
  12. "worker_id": "127.0.1.1:8083"
  13. }
  14. ],
  15. "type": "sink"
  16. }

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值)

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

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

  1. listeners=PLAINTEXT://0.0.0.0:9092
  2. # EC2 public hostname
  3. advertised.listeners=PLAINTEXT://ec2-34-x-x-x.us-west-2.compute.amazonaws.com:9092
  4. # EC2 internal/private hostnames. localhost entry will resolve to 127.0.1.1
  5. 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 配置为:

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

xuo3flqw1#

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

  1. # Hostname & Port for the REST API to listen on. If this is set,
  2. # it will bind to the interface used to listen to requests.
  3. # rest.host.name=
  4. # rest.port=8083

相关问题