Knowledge Center Monthly Newsletter - March 2025
Stay up to date with the latest from the Knowledge Center. See all new and updated Knowledge Center articles published in the last month and re:Post’s top contributors.
我想要更新用於 Amazon EMR 身分驗證的過期 Kerberos 票證。
若要更新過期的 Kerberos 票證,請完成下列步驟:
若要連線到 Amazon EMR 主節點,請使用 SSH。
若要確認 Kerberos 票證已過期,請執行 klist 命令。如果沒有快取任何憑證,則表示票證已過期。
[hadoop@ip-xxx-x-x-xxx ~]$ klist klist: No credentials cache found (filename: /tmp/krb5cc_498)
若要確認 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
若要更新 Kerberos 票證,請執行 kinit。指定 keytab 檔案和主體:
[hadoop@ip-xxx-x-x-xxx ~]$ kinit -kt /etc/hadoop.keytab hadoop/ip-xxx-x-x-xxx.ec2.internal@EC2.INTERNAL
確認已快取憑證:
[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
若要確認 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
透過 Amazon EMR 使用 Kerberos 進行驗證