Hue 集成Kerberos 导致Kerberos Ticket Renewer 起不来

本文详细记录了一次KerberosTicketRenewer无法启动的问题排查过程,包括错误日志分析、kinit命令使用及KDC配置检查。通过调整krbtgt和hue服务主体的票证续期策略,最终解决了票证无法更新的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错,Kerberos Ticket Renewer 起不来,查看日志

[19/Jan/2018 07:10:08 +0000] kt_renewer   INFO     Renewing kerberos ticket to work around kerberos 1.8.1: /usr/bin/kinit -R -c /run/hue/hue_krb5_ccache
kinit: KDC can't fulfill requested option while renewing credentials
[19/Jan/2018 07:10:08 +0000] kt_renewer   ERROR    Couldn't renew kerberos ticket in order to work around Kerberos 1.8.1 issue. Please check that the ticket for 'hue/cdh21@HADOOP.COM' is still renewable:
  $ klist -f -c /run/hue/hue_krb5_ccache
If the 'renew until' date is the same as the 'valid starting' date, the ticket cannot be renewed. Please check your KDC configuration, and the ticket renewal policy (maxrenewlife) for the 'hue/cdh21@HADOOP.COM' and `krbtgt' principals.
[19/Jan/2018 23:10:09 +0000] settings     DEBUG    DESKTOP_DB_TEST_NAME SET: /usr/local/hue/desktop/desktop-test.db
[19/Jan/2018 23:10:09 +0000] settings     DEBUG    DESKTOP_DB_TEST_USER SET: hue_test
[19/Jan/2018 07:10:09 +0000] __init__     INFO     Couldn't import snappy. Support for snappy compression disabled.
[19/Jan/2018 07:10:09 +0000] kt_renewer   INFO     Reinitting kerberos from keytab: /usr/bin/kinit -k -t /etc/security/keytabs/hue.service.keytab -c /var/run/hue/hue_krb5_ccache hue/cdh21@HADOOP.COM
[19/Jan/2018 07:10:10 +0000] kt_renewer   INFO     Renewing kerberos ticket to work around kerberos 1.8.1: /usr/bin/kinit -R -c /run/hue/hue_krb5_ccache
kinit: KDC can't fulfill requested option while renewing credentials
[19/Jan/2018 07:10:10 +0000] kt_renewer   ERROR    Couldn't renew kerberos ticket in order to work around Kerberos 1.8.1 issue. Please check that the ticket for 'hue/cdh21@HADOOP.COM' is still renewable:

解决办法:

linux 执行:
[root@cdh21 hbase]# klist -f -c /run/hue/hue_krb5_ccache
Ticket cache: FILE:/run/hue/hue_krb5_ccache
Default principal: hue/cdh21@HADOOP.COM

Valid starting Expires Service principal
2018-12-13T15:46:56 2018-12-14T15:46:56 krbtgt/HADOOP.COM@HADOOP.COM
renew until 2018-12-20T15:46:54, Flags: FRIT

这个问题的原因是:ticket无法更新
如果过了Expires,可以通过命令kinit –R来更新ticket
但如果ticket无法更新
[root@vmw201 ~]$ kinit -R kinit: Ticket expired while renewing credentials
这是因为krbtgt/HADOOP.COM@ HADOOP.COM的[renewlife]被设置成了0,这一点可以通过[kadmin.local => getprinc krbtgt/ HADOOP.COM @ HADOOP.COM]看出来。

进入命令行,将上面的查询出来的两个结果进行赋值即可:重启,正常运行

[root@cdh21 bin]# kadmin.local
Authenticating as principal hue/cdh21@HADOOP.COM with password.
kadmin.local: modprinc -maxrenewlife 90day krbtgt/HADOOP.COM@HADOOP.COM
Principal “krbtgt/HADOOP.COM@HADOOP.COM” modified.
kadmin.local: modprinc -maxrenewlife 90day +allow_renewable hue/cdh21@HADOOP.COM
Principal “hue/cdh21@HADOOP.COM” modified.

--- apiVersion: flink.apache.org/v1beta1 kind: FlinkDeployment metadata: name: flinksql-hive-test-job spec: flinkConfiguration: classloader.resolve-order: parent-first pekko.ask.timeout: '30s' taskmanager.numberOfTaskSlots: '4' execution.checkpointing.interval: 60000ms state.backend.type: 'rocksdb' execution.checkpointing.incremental: true execution.checkpointing.dir: 'hdfs:///tmp/checkpoints' execution.checkpointing.savepoint-dir: 'hdfs:///tmp/savepoints' security.kerberos.login.keytab: '/opt/keytab/work.keytab' security.kerberos.login.principal: 'work/work@BAIDU.COM' flinkVersion: v1_20 image: 'swr.cn-east-3.myhuaweicloud.com/yifanzhang/flink:1.20_cdc_mysql_to_paimon_starrocks' imagePullPolicy: Always job: jarURI: 'local:///opt/flink/lib/flink-sql-runner-1.12.0.jar' args: ["/opt/flink/sql-scripts/flinksql.sql"] state: running upgradeMode: savepoint jobManager: replicas: 1 resource: cpu: 2 memory: 4096m taskManager: replicas: 1 resource: cpu: 4 memory: 8192m restartNonce: 0 serviceAccount: flink podTemplate: apiVersion: v1 kind: Pod spec: containers: # don't modify this name - name: flink-main-container volumeMounts: - name: flinksql mountPath: /opt/flink/sql-scripts - name: hadoop-config mountPath: /opt/hadoop/etc/hadoop - name: krb5-config mountPath: /etc/krb5.conf subPath: krb5.conf - name: keytab mountPath: /opt/keytab volumes: - configMap: name: flinksql-hive-test-configmap name: flinksql - configMap: name: hadoop-config-configmap name: hadoop-config - configMap: name: krb5-config-configmap name: krb5-config - secret: secretName: work-keytab name: keytab hostAliases: - ip: "10.8.75.101" hostnames: - "dn1.bmr.cde.cscec8b.com.cn" - ip: "10.8.75.102" hostnames: - "dn2.bmr.cde.cscec8b.com.cn" apiVersion: v1 data: flinksql.sql: |- SET 'hadoop.security.authentication' = 'kerberos'; SET 'hive.metastore.sasl.enabled' = 'true'; SET 'hive.metastore.kerberos.principal' = 'nm/dn1.bmr.cde.cscec8b.com.cn@BAIDU.COM'; -- 替换为实际principal -- 测试部分:验证Hive表读取 CREATE CATALOG hive WITH ( 'type' = 'hive', 'hadoop-conf-dir' = '/opt/hadoop/etc/hadoop', 'hive-conf-dir' = '/opt/hadoop/etc/hadoop' ); -- 测试查询2:抽样10条数据验证字段 SELECT person_no, second_unit_code, end_time, post_status_id FROM hive.dws.dws_user_system_total_user_quantity_log WHERE rfq = (SELECT MAX(rfq) FROM hive.dws.dws_user_system_total_user_quantity_log) LIMIT 10; kind: ConfigMap metadata: name: flinksql-hive-test-configmap 以上2个脚本有什么问题,为什么报错如下: Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Can't get Master Kerberos principal for use as renewer at java.base/java.util.concurrent.FutureTask.report(Unknown Source) at java.base/java.util.concurrent.FutureTask.get(Unknown Source) at org.apache.flink.connectors.hive.MRSplitsGetter.getHiveTablePartitionMRSplits(MRSplitsGetter.java:79) ... 13 more Caused by: java.io.IOException: Can't get Master Kerberos principal for use as renewer at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:134) at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:102) at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodes(TokenCache.java:81)
最新发布
07-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值