[英]Confluent Control Center on a cluster
I've set up a basic three-server cluster of zookeeper and kafka version 5.4.0 using docker.我已经使用 docker 设置了一个基本的 Zookeeper 和 kafka 版本 5.4.0 的三服务器集群。 For zookeeper and kafka, I've specified all three of the bootstrap servers.
对于 zookeeper 和 kafka,我已经指定了所有三个引导服务器。 I'm trying to set this up in a manner that allows for one server to go down and the cluster will still operate correctly.
我试图以一种允许一台服务器宕机而集群仍能正常运行的方式进行设置。 I'm trying to get control center working and I'm running into problems.
我正在尝试让控制中心正常工作,但遇到了问题。 First, it seems as though only one of the servers is successfully able to run control center, and only when i specify the bootstrap server it's running on rather than all three.
首先,似乎只有一个服务器能够成功运行控制中心,并且只有当我指定引导服务器时,它才运行而不是所有三个服务器。 If I try to start control center on the other two servers, they fail to start and they continually log the following:
如果我尝试在其他两台服务器上启动控制中心,它们将无法启动并不断记录以下内容:
INFO unable to get command store (io.confluent.command.CommandStore)
I'm not certain how best to get this done.我不确定如何最好地完成这项工作。 Since it may be helpful, I'm posting below my docker-compose files for the zookeeper/broker pair as well as the file for control center.
由于它可能会有所帮助,我将在我的 docker-compose 文件下方发布 Zookeeper/broker 对以及控制中心的文件。 Please let me know if I've got anything misspecified or if you think a change is in order.
如果我有任何错误指定的内容,或者您认为需要进行更改,请告诉我。
zookeeper/kafka broker docker-compose.yml (the others differ only by advertised listener IP): zookeeper/kafka 代理 docker-compose.yml(其他的仅因公布的侦听器 IP 不同而不同):
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.4.0
hostname: zookeeper
container_name: zookeeper
network_mode: host
restart: always
ports:
- "2181:2181"
environment:
ZOOKEEPER_SERVER_ID: 2
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_SERVERS: "10.100.1.1:2888:3888;10.100.1.2:2888:3888;10.100.1.3:2888:3888"
volumes:
- ./zk-data:/var/lib/zookeeper/data
- ./zk-txn-logs:/var/lib/zookeeper/log
broker:
image: confluentinc/cp-enterprise-kafka:5.4.0
hostname: broker
container_name: broker
depends_on:
- zookeeper
network_mode: host
restart: always
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: '10.100.1.1:2181,10.100.1.2:2181,10.100.1.3:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://10.100.1.1:9092"
KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: 10.100.1.1:9092,10.100.1.2:9092,10.100.1.3:9092
CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: 10.100.1.1:2181,10.100.1.2:2181,10.100.1.3:2181
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 2
CONFLUENT_METRICS_ENABLE: 'true'
CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'
volumes:
- ./kafka-data:/var/lib/kafka/data
control center docker-compose.yml:控制中心 docker-compose.yml:
---
version: '2'
services:
control-center:
image: confluentinc/cp-enterprise-control-center:5.4.0
hostname: control-center
container_name: control-center
network_mode: host
restart: always
ports:
- "9021:9021"
environment:
CONTROL_CENTER_BOOTSTRAP_SERVERS: '10.100.1.1:9092'
CONTROL_CENTER_ZOOKEEPER_CONNECT: '10.100.1.1:2181'
CONTROL_CENTER_REPLICATION_FACTOR: 1
CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
CONFLUENT_METRICS_TOPIC_REPLICATION: 1
PORT: 9021
volumes:
- ./control-center:/var/lib/confluent-control-center
1) remove network_mode: host
1)删除
network_mode: host
2l Add control center to the same compose file 2l 将控制中心添加到同一个撰写文件中
3) use zookeeper:2181
for the Zookeeper connection strings and kafka:9092
for the bootstrap servers. 3) Zookeeper 连接字符串使用
zookeeper:2181
,引导服务器使用kafka:9092
。 I don't think metrics reporters or control center have a Zookeeper property我认为指标记者或控制中心没有 Zookeeper 属性
If you want to create a cluster of containers, then you probably want to take a look at the Confluent Helm Charts rather than the Docker compose files如果你想创建一个容器集群,那么你可能想看看 Confluent Helm Charts 而不是 Docker compose files
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.