前言

之前的博文中涉及到了Kerberos的内容,这里对Kerberos ticket lifetime相关的内容做一个补充。

ticket lifetime

Kerberos ticket具有lifetime,超过此时间则ticket就会过期,需要重新申请或renew。ticket lifetime取决于以下5项设置中的最小值:

  • Kerberos server上/var/kerberos/krb5kdc/kdc.conf中max_life
  • 内置principal krbtgt的maximum ticket life,可在kadmin命令行下用getprinc命令查看
  • 你的principal的maximum ticket life,可在kadmin命令行下用getprinc命令查看
  • Kerberos client上/etc/krb5.conf的ticket_lifetime
  • kinit -l 参数后面指定的时间

ticket renew lifetime

ticket过期后,如果想延长,一种方法是重新申请(需要输入密码),另一种是renew(不需要输入密码),每renew一次,就延长一个lifetime。不过renew操作本身也有lifetime,即在ticket renew lifetime,在此lifetime之内,才能进行renew操作。与上面的很相似,ticket renew lifetime取决于以下5项设置中的最小值:

  • Kerberos server上/var/kerberos/krb5kdc/kdc.conf中max_renewable_life
  • 内置principal krbtgt的maximum renewable life,可在kadmin命令行下用getprinc命令查看
  • 你的principal的maximum renewable life,可在kadmin命令行下用getprinc命令查看
  • Kerberos client上/etc/krb5.conf的renew_lifetime
  • kinit -r 参数后面指定的时间

HBase与ticket lifetime

HBase需要长时间运行,它对ticket过期问题的处理见org.apache.hadoop.hbase.ipc.RpcClient,方法handleSaslConnectionFailure(),方法注释中提到HBase是尝试自动relogin,从代码上看应该是直接获取一个新的ticket,而不是进行renew。

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).

另外:

[org.apache.hadoop.security.UserGroupInformation] Not attempting to re-login since the last re-login was attempted less than 600 seconds before.

这个错误实际是由于UserGroupInformation中的一个hard code值引起的,MIN_TIME_BEFORE_RELOGIN=10*60*1000L,是hadoop自己做出的限制,即不允许过于频繁地relogin,需要将ticket_lifetime设置为大于10分钟即可。

keytab与ticket lifetime

keytab文件实际只是一个密码文件,显然,修改lifetime相关设置跟密码是没有关系的,不需要去重新生成现有的keytab文件。

一些命令

  • kadmin: modprinc -maxrenewlife 11days +allow_renewable {principal}
  • kadmin: modprinc -maxlife 6minutes {principal}
  • kadmin: getprinc {principal} //retrieve the detail info of principal
  • kinit -R //renew current ticket
  • kinit {principal} -kt {keytab file} //init a principal via keytab file

Kerberos ticket lifetime及其它的更多相关文章

  1. CLIENT_0004:Unable to find valid Kerberos ticket cache (kinit)

    背景 今天在使用JavaAPI来连接sqoop1.99.7的时候,遇到了个错误. 错误信息如下: 0 [main] WARN org.apache.hadoop.util.NativeCodeLoad ...

  2. Kerberos Ticket管理

    Kerberos Ticket管理 本章介绍如何管理您的Kerberos Ticket,这里的Ticket是指Ticket-Granting-Ticket(TGT),是您访问集群中服务的凭证.我们假设 ...

  3. [Kerberos] User Ticket Management

    Kerberos客户端常用命令包括 kinit, klist, kdestroy, and kpasswd,用户使用这些命令管理自己的 ticket. 此外,每台运行Kerberos的机器应该都配置/ ...

  4. HBase + Kerberos 配置示例(二)

    接上篇<HBase + Kerberos配置示例(一)>,我们继续剩下的配置工作. 环境准备 Hadoop配置 Zookeeper配置 HBase配置 Java测试程序 环境准备 安装ha ...

  5. mimikazhi Kerberos Modules

    Kerberos Modules 1.   .#####.   mimikatz 2.0 alpha (x64) release "Kiwi en C" (Oct  9201500 ...

  6. Kerberos简介及常见问题

    基本描述 Kerberos使用Needha-Schroeder协议作为它的基础.它使用了一个由两个独立的逻辑部分:认证服务器和票据授权服务器组成的"可信赖的第三方",术语称为密钥分 ...

  7. 为CDH 5.7集群添加Kerberos身份验证及Sentry权限控制

    转载请注明出处:http://www.cnblogs.com/xiaodf/ 4. 为CDH 5集群添加Kerberos身份验证 4.1 安装sentry1.点击“操作”,“添加服务”:2.选择sen ...

  8. FIM 2010: Kerberos Authentication Setup

    The goal of this article is to provide some background information regarding the Kerberos related co ...

  9. 【管理工具】Kerberos简单应用

    Kerberos这一名词来源于希腊神话“三个头的狗——地狱之门守护者”系统设计上采用客户端/服务器结构与DES加密技术,并且能够进行相互认证,即客户端和服务器端均可对对方进行身份认证.可以用于防止窃听 ...

随机推荐

  1. unreal3的viewport和client

    名字里带viewport/client的类不少,以及相关的类: FViewportFrame.FViewport FViewportClient/UScriptViewportClient/UGame ...

  2. Mysql --分区表(6)Hash分区

    HASH分区 HASH分区主要用来分散热点读,确保数据在预先确定个数的分区中尽可能平均分布.对一个表执行HASH分区时,MySQL会对分区键应用一个散列函数,以此确定数据应当放在N个分区中的哪个分区 ...

  3. gromacs, quake III和vrsqrtps

    看标题大家可能觉得三个词汇风马牛不相及,第一个是解蛋白质分子动力学的软件,第二个是上三代宅男最爱雷神之锤,第三个则是一个存在于IntelSSE及AVX中的一个指令,他的作用是快速求平方根的倒数. 起因 ...

  4. Sublime Text3开发工具安装emmet插件

    第一步:Sublime Text导入Package Control 自动安装: 1.打开Sublime Text -->View --> Show Console 菜单打开控制台 2.粘贴 ...

  5. SQL Server优化技巧之SQL Server中的"MapReduce"

    日常的OLTP环境中,有时会涉及到一些统计方面的SQL语句,这些语句可能消耗巨大,进而影响整体运行环境,这里我为大家介绍如何利用SQL Server中的”类MapReduce”方式,在特定的统计情形中 ...

  6. We have detected that MySQL products under the Commercial license are installed. In order to proceed with this GPL installation these Commercial

    下载了MySQL 5.6.15,在安装时,出现了下面的提示信息: 按提示信息的要求单击“是”,结果安装就无法进行下去. 从提示信息上看,意思是指电脑中原来安装有商业版的许可,现在要转换成为GPL许可. ...

  7. 撰写合格的REST API

    原文 : http://mp.weixin.qq.com/s?__biz=MzA3NDM0ODQwMw==&mid=208060670&idx=1&sn=ce67b889698 ...

  8. C++11 并发指南三(Lock 详解)

    在 <C++11 并发指南三(std::mutex 详解)>一文中我们主要介绍了 C++11 标准中的互斥量(Mutex),并简单介绍了一下两种锁类型.本节将详细介绍一下 C++11 标准 ...

  9. Windows Phone下的Socket编程

    讨论下有关于Windows Phone下的Socket编程方面的知识. Socket就是通常所称的套接字,用于描述IP地址和端口,是一个通信链的句柄.应用程序通常通过Socket向网络发出请求或者应答 ...

  10. Jetty 9嵌入式开发

    官方网址:http://www.eclipse.org/jetty/ 下载地址:http://download.eclipse.org/jetty/stable-9/dist/ 文档网址:http:/ ...