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邮件归档
之前在使用hadoop client时设置了一个系统变量, 当这个变量没设置的时候就会报之前的错误 System.setProperty("java.security.krb5.conf", "C:\Users\86177\Desktop\tmp\5\krb5.conf" ); 但flink on yarn 没有提供这个参数的设置。*来自志愿者整理的FLINK邮件归档
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。