我已经下载了合流版本5.4。
和我的连接器在独立模式下运行良好。
wget /usr/local http://packages.confluent.io/archive/5.4/confluent-5.4.0-2.11.tar.gz -P ~/Downloads/
tar -zxvf ~/Downloads/confluent-5.4.0-2.11.tar.gz -C ~/Downloads/
sudo mv ~/Downloads/confluent-5.4.0 /usr/local/然后我尝试在分布式模式下运行Kafak,所以我修改了我的connect分布。
bootstrap.servers=b-***.eu-west-1.amazonaws.com:9092,b-***.eu-west-1.amazonaws.com:9092,b-***.eu-west-1.amazonaws.com:9092
group.id=connect-cluster
key.converter=org.apache.kafka.connect.storage.StringConverter
value.converter=org.apache.kafka.connect.storage.StringConverter
offset.storage.topic=connect-offsets
offset.storage.replication.factor=1
config.storage.topic=connect-configs
config.storage.replication.factor=1
status.storage.topic=connect-status
status.storage.replication.factor=1
offset.flush.interval.ms=10000
plugin.path=/usr/local/confluent/share/java然后启动连接器,如下所示
/usr/local/confluent/bin/connect-distributed /usr/local/confluent/etc/kafka/connect-distributed.properties看来它成功地启动了2020-02-02 05:22:33,860 INFO加入了小组并得到了分配:
Assignment{error=0, leader='connect-1-c99d50a9-faf0-4b15-8a3d-3add55b7e206', leaderUrl='http://10.97.49.217:8083/', offset=-1, connectorIds=[], taskIds=[]} (org.apache.kafka.connect.runtime.distributed.DistributedHerder:1216)
[2020-02-02 05:22:33,861] INFO Starting connectors and tasks using config offset -1 (org.apache.kafka.connect.runtime.distributed.DistributedHerder:850)
[2020-02-02 05:22:33,861] INFO Finished starting connectors and tasks (org.apache.kafka.connect.runtime.distributed.DistributedHerder:860)最后,我使用curl命令来创建我的接收器连接器。
curl -X POST -H "Content-Type: application/json" --data '{"name":"elastic-search-sink-audit","config":{"connector.class":"io.confluent.connect.elasticsearch.ElasticsearchSinkConnector","tasks.max":"2","topics":"fsp-AUDIT_EVENT_DEMO","key.ignore":"true","connection.url":"https://**.amazonaws.com","type.name":"kafka-connect","name":"elastic-search-sink-audit","errors.tolerance":"all","errors.deadletterqueue.topic.name":"fsp-dlq-audit-event"}}' http://localhost:8083/connectors | jq使用EC2 IP地址
curl -X POST -H "Content-Type: application/json" --data '{"name":"elastic-search-sink-audit-distributed","config":{"connector.class":"io.confluent.connect.elasticsearch.ElasticsearchSinkConnector","tasks.max":"2","topics":"audit_event_distributed","key.ignore":"true","connection.url":"https://***.us-east-1.es.amazonaws.com","type.name":"kafka-connect","name":"elastic-search-sink-audit-distributed","errors.tolerance":"all","errors.deadletterqueue.topic.name":"dlq_distributed"}}' http://10.67.39.217:8083/connectors | jq在1分钟后运行此命令后,我将得到以下响应
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 498 0 48 100 450 0 4 0:01:52 0:01:30 0:00:22 10
{
"error_code": 500,
"message": "Request timed out"
}然后我继续得到它,但这只是警告,因为我有足够的副本在我的主题。
NOT_ENOUGH_REPLICAS (org.apache.kafka.clients.producer.internals.Sender:598)
^C[2020-02-03 08:05:54,890] WARN [Producer clientId=producer-3] Got error produce response with correlation id 7185 on topic-partition connect-configs-0, retrying (2147476495 attempts left). Error: NOT_ENOUGH_REPLICAS (org.apache.kafka.clients.producer.internals.Sender:598)
^C[2020-02-03 08:05:54,991] WARN [Producer clientId=producer-3] Got error produce response with correlation id 7186 on topic-partition connect-configs-0, retrying (2147476494 attempts left). Error: NOT_ENOUGH_REPLICAS (org.apache.kafka.clients.producer.internals.Sender:598)当我描述我的主题时
Topic:fsp-AUDIT_EVENT_DEMO PartitionCount:1 ReplicationFactor:3 Configs:
Topic: fsp-AUDIT_EVENT_DEMO Partition: 0 Leader: 1 Replicas: 1,6,2 Isr: 1,6,2所以我有足够的复制品来做我的主题。
更新
描述结果
Topic:connect-configs PartitionCount:1 ReplicationFactor:1 Configs:cleanup.policy=compact
Topic: connect-configs Partition: 0 Leader: 6 Replicas: 6 Isr: 6
Topic:connect-status PartitionCount:5 ReplicationFactor:1 Configs:cleanup.policy=compact
Topic: connect-status Partition: 0 Leader: 6 Replicas: 6 Isr: 6
Topic: connect-status Partition: 1 Leader: 1 Replicas: 1 Isr: 1
Topic: connect-status Partition: 2 Leader: 2 Replicas: 2 Isr: 2
Topic: connect-status Partition: 3 Leader: 4 Replicas: 4 Isr: 4
Topic: connect-status Partition: 4 Leader: 5 Replicas: 5 Isr: 5
Topic:connect-offsets PartitionCount:25 ReplicationFactor:1 Configs:cleanup.policy=compact请帮我解决这个问题。
发布于 2020-02-03 23:44:58
这三个主题都是由卡夫卡连接-补偿连接-信任连接状态创建的。
他们确实是
offset.storage.topic=connect-offsets
offset.storage.replication.factor=1
config.storage.topic=connect-configs
config.storage.replication.factor=1
status.storage.topic=connect-status
status.storage.replication.factor=1,你建议我改变这个吗?
不是名字,而是复制因素,没错。1副本意味着如果任何一个代理被关闭,那么主题基本上是脱机的。
您还在哪里寻找代理id?
来自主题描述的第3-5栏。
https://stackoverflow.com/questions/60023497
复制相似问题