以前的博文中涉及到了Kerberos的内容,这里对Kerberos ticket lifetime相关的内容作一个补充。java
Kerberos ticket具备lifetime,超过此时间则ticket就会过时,须要从新申请或renew。ticket lifetime取决于如下5项设置中的最小值:程序员
ticket过时后,若是想延长,一种方法是从新申请(须要输入密码),另外一种是renew(不须要输入密码),每renew一次,就延长一个lifetime。不过renew操做自己也有lifetime,即在ticket renew lifetime,在此lifetime以内,才能进行renew操做。与上面的很类似,ticket renew lifetime取决于如下5项设置中的最小值:apache
HBase须要长时间运行,它对ticket过时问题的处理见org.apache.hadoop.hbase.ipc.RpcClient,方法handleSaslConnectionFailure(),方法注释中提到HBase是尝试自动relogin,从代码上看应该是直接获取一个新的ticket,而不是进行renew。less
The other problem is to do with ticket expiry. To handle that, a relogin is attempted.
The retry logic is governed by the shouldAuthenticateOverKrb method. In case when the user doesn't have valid credentials, we don't need to retry (from cache or ticket). In such cases, it is prudent to throw a runtime exception when we receive a SaslException from the underlying authentication implementation, so there is no retry from other high level (for eg, HCM or HBaseAdmin).dom
另外: maven
[org.apache.hadoop.security.UserGroupInformation] Not attempting to re-login since the last re-login was attempted less than 600 seconds before. oop
这个错误实际是因为UserGroupInformation中的一个hard code值引发的,MIN_TIME_BEFORE_RELOGIN=10*60*1000L,是hadoop本身作出的限制,即不容许过于频繁地relogin,须要将ticket_lifetime设置为大于10分钟便可。大数据
keytab文件实际只是一个密码文件,显然,修改lifetime相关设置跟密码是没有关系的,不须要去从新生成现有的keytab文件。spa
送书了,送书了,关注公众号“程序员杂书馆”,就送出O'Reilly《Spark快速大数据分析》纸质书(亦有一批PDF分享)! —— 2018年12月命令行
![]() |
![]() |