当前位置:   article > 正文

Debezium + kafka connect SASL实现sqlserver CDC

Debezium + kafka connect SASL实现sqlserver CDC

在项目中使用SASL_PLAINTEXT协议配置了用户名密码,启动connect的时候,一直报disconnect

启动的时候一直报错授权失败,或者是disconnected

需要在connect的配置文件connect-distributed.properties和插件的配置文件里同时添加相关的配置项

Kafka安装路径/kafka/config/connect-distributed.properties

# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors,
plugin.path=

# 1.配置Connect workers去使用SASL/PLAIN
sasl.mechanism=PLAIN
# Configure SASL_SSL if SSL encryption is enabled, otherwise configure SASL_PLAINTEXT
security.protocol=SASL_SSL

# 2.配置JAAS参数,Connect的生产者和消费者去连接Kafka
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
  username="connect" \
  password="connect-secret";
  
# 3.Source连接器配置相同的参数,加上producer前缀
producer.sasl.mechanism=PLAIN
# Configure SASL_SSL if SSL encryption is enabled, otherwise configure SASL_PLAINTEXT
producer.security.protocol=SASL_SSL
producer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
  username="connect" \
  password="connect-secret";

# 4.Sink连接器配置相同的参数,加上consumer前缀
consumer.sasl.mechanism=PLAIN
# Configure SASL_SSL if SSL encryption is enabled, otherwise configure SASL_PLAINTEXT
consumer.security.protocol=SASL_SSL
consumer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
  username="connect" \
  password="connect-secret";

sqlserver-cdc-source.json

{
    "name": "sqlserver-cdc-source",
    "config": {
        "connector.class" : "io.debezium.connector.sqlserver.SqlServerConnector",
        "tasks.max" : "1",
        "database.server.name" : "db",
        "database.hostname" : "192.168.1.1&

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/583782
推荐阅读
相关标签
  

闽ICP备14008679号