Clickhouse goes to kafka on a port different from the one specified in the settings

128 Views Asked by At

The config does not specify the port, but only the credits for the connection. The port is specified in the clickhouse table, which is needed to access the kafka topic, I set port 9093 there.

/etc/clickhouse-server/config.xml

<kafka>
            <debug>all</debug>
            <sasl_username>kafkauser</sasl_username>
            <sasl_password>Kafkapassword</sasl_password>
            <security_protocol>SASL_PLAINTEXT</security_protocol>
            <sasl_mechanisms>PLAIN</sasl_mechanisms>
</kafka>

And after creating the table, nothing happens, the data does not go. In the clickhouse logs it says that there is nothing to pull, but there is data in the topic, and in the errors, the clickhouse at the same time writes that at 9092 time on the connection everything is bad and the broker is falling

CREATE TABLE test_kafka.tasks_queue
(

    `data` String
)
ENGINE = Kafka
SETTINGS kafka_broker_list = '10.10.10.22:9093',
 kafka_group_name = 'test',
 kafka_num_consumers = '1',
 kafka_format = 'JSONEachRow',
 kafka_topic_list = 'test2';

At the same time, in the logs, the clickhouse writes that there is nothing to pull, but there is data in the topic, and in the click errors, at the same time, it writes that at 9092 time on the connection everything is bad and the broker is falling, but the port 9093 is indicated in the table

tail -f /var/log/clickhouse-server/clickhouse-server.err.log

2023.07.20 11:36:27.064262 [ 1281 ] {} <Error> StorageKafka (github_queue): [rdk:FAIL] [thrd:sasl_plaintext://10.10.10.22:9092/bootstrap]: sasl_plaintext://10.10.10.22:9092/bootstrap: Connect to ipv4#10.10.10.22:9092 failed: Connection refused (after 0ms in state CONNECT, 31 identical error(s) suppressed)
1

There are 1 best solutions below

4
OneCricketeer On

How do you know Clickhouse is the problem? Try any other Kafka client to test the network address you've provided is correct?

"Bootstrapping" is only the initial connection to kafka. The brokers return addresses from their own configured properties of advertised.listeners. Check your server.properties files for a typo

https://www.confluent.io/blog/kafka-listeners-explained/