当前位置:   article > 正文

FlinkSql配置Kerberos环境下的Kafka Source&Sink_flinksql连接kafka, kerberos

flinksql连接kafka, kerberos

1、配置flink-conf.yaml配置文件,将kerberos相关配置放开

  1. security.kerberos.login.use-ticket-cache: true
  2. security.kerberos.login.keytab: /path/to/kerberos/keytab
  3. security.kerberos.login.principal: flink-user
  4. # The configuration below defines which JAAS login contexts
  5. security.kerberos.login.contexts: Client,KafkaClient

2、kafka flinksql配置

新增这三个配置

  'connector.properties.security.protocol' = 'SASL_PLAINTEXT',
   'connector.properties.sasl.mechanism' = 'GSSAPI',
   'connector.properties.sasl.kerberos.service.name' = 'kafka',

  1. CREATE TABLE person (
  2. address VARCHAR COMMENT '家庭住址',
  3. age VARCHAR COMMENT '年龄',
  4. city VARCHAR COMMENT '所在城市',
  5. name VARCHAR COMMENT '姓名'
  6. )
  7. WITH (
  8. 'connector.type' = 'kafka',
  9. 'connector.topic' = 'test1',
  10. 'connector.version' = 'universal',
  11. 'connector.startup-mode' = 'earliest-offset',
  12. 'connector.properties.zookeeper.connect' = 'cdh1:2181,cdh2:2181,cdh3:2181',
  13. 'connector.properties.bootstrap.servers' = 'cdh1:9092,cdh2:9092,cdh3:9092',
  14. 'connector.properties.security.protocol' = 'SASL_PLAINTEXT',
  15. 'connector.properties.sasl.mechanism' = 'GSSAPI',
  16. 'connector.properties.sasl.kerberos.service.name' = 'kafka',
  17. 'update-mode' = 'append',
  18. 'format.type' = 'csv',
  19. 'format.derive-schema' = 'true'
  20. );

 

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

闽ICP备14008679号