开发者社区> 问答> 正文

Flink on YARN 使用Kerboros认证失败

Flink 提交作业到有kerboros认证的集群报以下异常 

java.lang.Exception: unable to establish the security context  at org.apache.flink.runtime.security.SecurityUtils.install(SecurityUtils.java:73)  at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1124)  Caused by: java.lang.IllegalArgumentException: Can't get Kerberos realm  at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:65)  at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:276)  at org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:312)  at org.apache.flink.runtime.security.modules.HadoopModule.install(HadoopModule.java:70)  at org.apache.flink.runtime.security.SecurityUtils.install(SecurityUtils.java:67)  ... 1 more  Caused by: java.lang.reflect.InvocationTargetException  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  at java.lang.reflect.Method.invoke(Method.java:498)  at org.apache.hadoop.security.authentication.util.KerberosUtil.getDefaultRealm(KerberosUtil.java:84)  at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:63)  ... 5 more  Caused by: KrbException: Cannot locate default realm  at sun.security.krb5.Config.getDefaultRealm(Config.java:1029)  ... 11 more 

使用了官网提供的四个参数,配置在了flink-conf.yaml里 

security.kerberos.login.use-ticket-cache: false  security.kerberos.login.keytab: /home/flink-1.8.0/conf/flink.keytab  security.kerberos.login.principal: flink/hadoop0@EXAMPLE.COM  security.kerberos.login.realm: EXAMPLE.COM  security.kerberos.login.contexts: KafkaClient 

/home/flink-1.8.0/conf/flink.keytab 文件已放好,*来自志愿者整理的flink邮件归档

展开
收起
玛丽莲梦嘉 2021-12-02 16:40:29 1545 0
1 条回答
写回答
取消 提交回答
  • 之前在使用hadoop client时设置了一个系统变量, 当这个变量没设置的时候就会报之前的错误  System.setProperty("java.security.krb5.conf", "C:\Users\86177\Desktop\tmp\5\krb5.conf" );  但flink on yarn 没有提供这个参数的设置。*来自志愿者整理的FLINK邮件归档

    2021-12-02 17:36:30
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
深度学习+大数据 TensorFlow on Yarn 立即下载
Docker on Yarn 微服务实践 立即下载
深度学习+大数据-TensorFlow on Yarn 立即下载