Amazon EMR 인증에 사용하다 만료된 Kerberos 티켓을 갱신하려면 어떻게 해야 합니까?

2분 분량
0

Amazon EMR 클러스터에서 인증에 Kerberos를 사용하고 있습니다. Kerberos 티켓이 만료되었습니다. 클러스터에서 명령을 실행하려고 하면 다음과 같은 오류 메시지가 표시됩니다. 19/11/04 22:12:16 WARN ipc.Client: Exception encountered while connecting to the server : javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] ls: Failed on local exception: java.io.IOException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]; Host Details : local host is: "ip-xxx-x-x-x.ec2.internal/192.x.x.x";destination host is: "ip-xxx-x-x-x.ec2.internal":8020;

간략한 설명

만료된 Kerberos 티켓을 갱신하려면 다음을 수행하세요.

1.    klist 명령을 실행하여 KDC(Key Distribution Center)에서 발급한 자격 증명을 표시합니다.

2.    새 티켓을 얻으려면 kinit 명령을 실행하고 자격 증명이 포함된 keytab 파일을 지정하거나 보안 주체에 대한 암호를 입력합니다.

해결 방법

1.    SSH를 사용하여 마스터 노드에 연결합니다.

2.    티켓이 만료되었는지 확인하려면 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.    HDFS 명령을 실행하여 Kerberos 티켓이 작동하는지 확인합니다.

[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 인증 사용

AWS 공식
AWS 공식업데이트됨 3년 전
댓글 없음