以前的博文中涉及到了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月命令行