나의 리눅스 계정명은 eyeballs 인 상황.

 

/user/eyeballs/test 라는 디렉터리의 소유자가 다른 사람이라서(abc 라고 하자) 

소유자를 chown 으로 바꾸려고 했는데 다음과 같은 에러가 남.

 


[eyeballs@my_server]$ hadoop fs -chown -R eyeballs: /user/eyeballs/test

chown: changing ownership of '/user/eyeballs/test': Permission denied.
user=eyeballs is not the owner of inode=/user/eyeballs/test

 

삭제하는 것도 에러가 난다.

 


[eyeballs@my_server]$ hdfs dfs -rm -r /user/eyeballs/test

rm: Failed to move to trash: hdfs://my_server/user/eyeballs/test:
Permission denied: user=eyeballs, access=ALL, inode="/user/eyeballs/test":abc:hdfs:drwxr-xr-x

 

소유자를 살펴보니 abc 로 되어있다.

 


[eyeballs@my_server]$ hdfs dfs -ls /user/eyeballs/test

Found 1 items
drwxr-xr-x   - abc hdfs          0 2022-01-17 19:36 /user/eyeballs/test

 

이렇게 소유자가 다른 상태에서

chown 으로 소유자를 변경하려면

슈퍼유저로 잠시 변신(?)하여, 슈퍼유저 권한을 이용하면 된다.

아래 예에서, super user 권한을 갖는 계정명은 super_eyeballs (default 는 hdfs)

 


[eyeballs@my_server]$ HADOOP_USER_NAME=super_eyeballs hadoop fs -chown -R eyeballs: /user/eyeballs/test

 

만약 super user 권한이 없는 계정명을 HADOOP_USER_NAME 에 넣으면

다음과 같은 에러가 뜬다.

 


[eyeballs@my_server]$ HADOOP_USER_NAME=eyeballs hadoop fs -chown -R eyeballs: /user/eyeballs/test

chown: changing ownership of '/user/eyeballs/test': User eyeballs is not a super user (non-super user cannot change owner).

 

 

 

슈퍼 유저란, 네임 노드 프로세스와 동일한 이름을 가진 유저를 말한다.

The super-user is the user with the same identity as name node process itself.

 

default super user 는 hdfs 이며

core-site.xml 파일 의 dfs.permissions.superusergroup 속성을 설정하여 super user 그룹을 구성할 수 있음

 

출처 : https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html#The_Super-User

http://doc.isilon.com/ECS/3.2/DataAccessGuide/ecs_c_hdfs_users_superuser_supergroup.html

 

 








+ Recent posts