Hi 请教下目标端的 kafka 开启了 sasl,其中 kafka 有个选项叫做 security.protocol 是一个用于配置客户端与 Kafka 集群之间通信安全协议的参数,我在配置 ticdc 没有发现相关参数,麻烦帮忙看下如何配置,如果不配置则无法验证通过,我们的版本为 6.5.3 麻烦帮忙看下
kafka server: The client is not authorized to send this request type
参考链接:
https://docs.pingcap.com/zh/tidb/v6.5/ticdc-sink-to-kafka/#sink-uri-配置-kafka
WalterWj
(王军 - PingCAP)
2025 年8 月 7 日 03:13
2
SASL ? 我们支持啊。类似这种:
cdc cli changefeed create \
--pd=http://pd-server:2379 \
--sink-uri="kafka://kafka-broker:9092/topic-name?enable-tls=true&sasl-mechanism=SCRAM-SHA-256&sasl-user=your-username&sasl-password=your-password&insecure-skip-verify=true" \
--changefeed-id="kafka-sink-task"
你发的官网链接里面就有。。。。
我指的是 security.protocol 这个参数在文档里没有找到对应的配置
这是我的完整配置:
tiup cdc:v6.5.3 cli changefeed create -c xxxx --pd=http://xxx:2379 --sink-uri=“kafka://xxx/xxx?protocol=canal-json&enable-tidb-extension=false&kafka-version=2.5.1&sasl-user=xxx&sasl-password=xxxxxx&sasl-mechanism=SCRAM-SHA-256&partition-num=40&kafka-client-id=xxx&max-message-bytes=8388608&replication-factor=3” --sort-engine=“unified” --config=xxx.yaml
WalterWj
(王军 - PingCAP)
2025 年8 月 7 日 04:01
4
GreenGuan:
security.protocol
他们 kafka 怎么配置的。是不知道和 cdc 的映射关系?
我们 kafka 线上配置如下:
security.protocol: “SASL_PLAINTEXT”
sasl.mechanism: “SCRAM-SHA-256”
sasl.jaas.config: “org.apache.kafka.common.security.scram.ScramLoginModule required username=“xxx” password=“xxx”;”
ticdc 的参数中只有一个 protocol,没有找到 security.protocol 的配置
1 个赞
WalterWj
(王军 - PingCAP)
2025 年8 月 7 日 06:27
6
tiup ctl:v6.5.3 cdc changefeed create \
--pd="pd.example.com:2379" \
--sink-uri="kafka://10.0.0.1:9092,10.0.0.2:9092/tidb_cdc_data?kafka-version=2.7.1&sasl-user=xxx&sasl-password=xxx&sasl-mechanism=SCRAM-SHA-256&security-protocol=SASL_PLAINTEXT" \
--changefeed-id="tidb-to-kafka-task" \
--sortengine="unified" \
--config="./changefeed.toml"
试试类似这种。
1 个赞
TiDBer_wk
(Ti D Ber Os7emy Bg)
2025 年8 月 7 日 11:16
7
试试调整 enable-tls 和 insecure-skip-verify 这两个参数
TiDBer_wk
(Ti D Ber Os7emy Bg)
2025 年8 月 8 日 06:25
9
WalterWj
(王军 - PingCAP)
2025 年8 月 11 日 08:04
10
@GreenGuan 这个回复解决了你的问题了么?
没有,文档中提及的权限我都有,但还是报这个错误
kafka server: The client is not authorized to send this request type
TiDBer_wk
(Ti D Ber Os7emy Bg)
2025 年8 月 11 日 08:32
12
有试过其他软件访问 kafka 吗?这里在不配置 security.protocol 的时候,使用 ticdc 能够成功访问吗?
TiDBer_wk
(Ti D Ber Os7emy Bg)
2025 年8 月 11 日 10:19
14
感觉还是优先查下 ACL 吧,高版本可能加了其他资源类型
host=*, operation=ALL, permissionType=ALLOW
权限是最大了,报错如下:
Error: [CDC:ErrKafkaNewSaramaProducer]new sarama producer: kafka: client has run out of available brokers to talk to: 3 errors occurred:
* EOF
* EOF
* EOF
TiDBer_wk
(Ti D Ber Os7emy Bg)
2025 年8 月 18 日 07:56
17
我这边确认了 kafka 的版本是正确的,我能通过什么手段读到 api 里用到的是那个版本吗?
TiDBer_wk
(Ti D Ber Os7emy Bg)
2025 年8 月 18 日 08:06
19
可以尝试把 kafka-version 降低试试,这里用到了 sarama 这个库,他是向下兼容的
请问下,你们有尝试过用其他 client ,相同的用户名密码,连接过 kafka 吗?