如何续订用于 Amazon EMR 身份验证的过期 Kerberos 票证?

1 分钟阅读
0

我想续订用于 Amazon EMR 身份验证的过期 Kerberos 票证。

解决方法

要续订过期的 Kerberos 票证,请完成以下步骤:

  1. 要连接到 Amazon EMR 主节点,请使用 SSH

  2. 要确认 Kerberos 票证是否已过期,请运行 klist 命令。如果未缓存任何凭证,则表示票证已过期。

    [hadoop@ip-xxx-x-x-xxx ~]$ klist
    klist: No credentials cache found (filename: /tmp/krb5cc_498)
  3. 要确认 Kerberos 主体名称,请列出 keytab 文件的内容:

    [hadoop@ip-xxx-x-x-xxx ~]$ klist -kt /etc/hadoop.keytab
    Keytab name: FILE:/etc/hadoop.keytab
    KVNO Timestamp           Principal
    ---- ------------------- ------------------------------------------------------
       2 07/04/2019 21:48:46 hadoop/ip-xxx-x-x-xxx.ec2.internal@EC2.INTERNAL
       2 07/04/2019 21:48:46 hadoop/ip-xxx-x-x-xxx.ec2.internal@EC2.INTERNAL
       2 07/04/2019 21:48:46 hadoop/ip-xxx-x-x-xxx.ec2.internal@EC2.INTERNAL
  4. 要续订 Kerberos 票证,请运行 kinit。指定 keytab 文件和主体:

    [hadoop@ip-xxx-x-x-xxx ~]$ kinit -kt /etc/hadoop.keytab hadoop/ip-xxx-x-x-xxx.ec2.internal@EC2.INTERNAL
  5. 确认凭证已缓存:

    [hadoop@ip-xxx-x-x-xxx ~]$ klist
    Ticket cache: FILE:/tmp/krb5cc_498
    Default principal: hadoop/ip-xxx-x-x-xxx.ec2.internal@EC2.INTERNAL
    Valid starting       Expires              Service principal
    11/04/2019 22:13:47  11/05/2019 08:13:47  krbtgt/EC2.INTERNAL@EC2.INTERNAL
    renew until 11/06/2019 22:13:47
  6. 要确认 Kerberos 票证是否有效,请运行 HDFS 命令:

    [hadoop@ip-XXX-XX-XX-XXX ~]$ hdfs dfs -ls /
    Found 4 items
    drwxr-xr-x   - hdfs hadoop          0 2019-11-05 22:45 /apps
    drwxrwxrwt   - hdfs hadoop          0 2019-11-05 22:46 /tmp
    drwxr-xr-x   - hdfs hadoop          0 2019-11-05 22:45 /user
    drwxr-xr-x   - hdfs hadoop          0 2019-11-05 22:45 /var

相关信息

使用 Kerberos 通过 Amazon EMR 进行身份验证

AWS 官方
AWS 官方已更新 5 个月前