New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rack Awareness doesn't work with Strimzi Connect #6492
Comments
You should check your Connect logs to see if the client rack configuration is correctly set in the clients. |
hi @scholzj client.rack did shown up with expected value in Connect logs at the beginning. $ kubectl logs odf-connect-cluster-connect-fc7744f96-dkg5x | head -n100
Preparing truststore
Preparing truststore is complete
Starting Kafka Connect with configuration:
# Bootstrap servers
bootstrap.servers=odf-cluster-kafka-bootstrap:9092
# REST Listeners
rest.port=8083
rest.advertised.host.name=X.X.X.X
rest.advertised.port=8083
# Plugins
plugin.path=/opt/kafka/plugins
# Provided configuration
offset.storage.topic=connect-cluster-offsets
value.converter=org.apache.kafka.connect.json.JsonConverter
config.storage.topic=connect-cluster-configs
key.converter=org.apache.kafka.connect.json.JsonConverter
group.id=connect-cluster
status.storage.topic=connect-cluster-status
config.storage.replication.factor=1
connector.client.config.override.policy=All
offset.storage.replication.factor=1
replica.selector.class=org.apache.kafka.common.replica.RackAwareReplicaSelector
status.storage.replication.factor=1
value.converter.schema.registry.url=http://odf-cluster-schema-registry:8081
security.protocol=PLAINTEXT
producer.security.protocol=PLAINTEXT
consumer.security.protocol=PLAINTEXT
admin.security.protocol=PLAINTEXT
# Additional configuration
client.rack=ip-10-65-205-21
2022-03-10 05:54:38,842 INFO WorkerInfo values:
jvm.args = -Xms128M, -XX:+UseG1GC, -XX:MaxGCPauseMillis=20, -XX:InitiatingHeapOccupancyPercent=35, -XX:+ExplicitGCInvokesConcurrent, -XX:MaxInlineLevel=15, -Djava.awt.headless=true, -Dcom.sun.management.jmxremote, -Dcom.sun.management.jmxremote.authenticate=false, -Dcom.sun.management.jmxremote.ssl=false, -Dkafka.logs.dir=/opt/kafka, -Dlog4j.configuration=file:/opt/kafka/custom-config/log4j.properties
jvm.spec = Red Hat, Inc., OpenJDK 64-Bit Server VM, 11.0.12, 11.0.12+7-LTS |
That looks good ... But in the actual Kafka logs, it is printing the configurations used for the different consumers it creates ... that would be more interesting to see if it is there. |
I don't see any consumer configurations printed in Kafka logs. But I do see them in Connect logs. From Connect logs below, I notice there is 4 ConsumerConfig printed. The first 3 consumer config I believe is internal consumers which have the client.rack with expected value. But last consumer config which is my sink connector configuration showing no client.rack configure.
|
Yeah, sorry. I meant Kafka Connect logs. But I'm afraid I have no clue why Kafka passes the configuration to 3 out of 4 consumers but not in the 4th one. |
Signed-off-by: Jakub Scholz <www@scholzj.com>
Ok, you are right, it does not seem to work. I opened a PR which should fix it. |
Describe the bug
By following Strimzi Documentation, I enabled rack awareness in Connect but I notice my Sink Connector still consuming from leader according the consumer logs in Connect.
Example by refer cluster and connect logs below, consumer in Connect "odf-connect-cluster-connect-5db9446969-29mxp" which deployed on node label "ip-10-65-202-151", consumed topic "streams-output-sbsb" partition 2 from Kafka 0 which deployed on node label "ip-10-65-201-163" where the partition 2 leader located.
What I refer:
https://strimzi.io/docs/operators/0.25.0/using.html#proc-kafka-connect-config-str
https://strimzi.io/docs/operators/0.25.0/using.html#type-Rack-reference (The example for KafkaConnect looks wrong, we don't have 'kafka' configuration for KafkaConnect kind.)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Connector task consumers should consume the topic partition from Kafka where the same node KafkaConnect deployed.
Example by refer cluster below, consumer in Connect "odf-connect-cluster-connect-5db9446969-29mxp" which deployed on node label "ip-10-65-202-151", consumed topic "streams-output-sbsb" partition 2 from Kafka 0 which deployed on same node label "ip-10-65-202-151".
Environment:
YAML files and logs
Kafka Deployment
Connect Deployment
Cluster Allocation
Connect "odf-connect-cluster-connect-5db9446969-29mxp" logs
Additional context
I did try add "consumer.override.client.rack" with hardcoded value in my Sink Connector and it work as expected. No sure why rack.topologyKey in KafkaConnect not able to control connector task consumer to consume from the Kafka on same rack label.
The text was updated successfully, but these errors were encountered: