메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


--테이블 사용자 추가시 모든 노드에 반드시 추가해 줄것...
* 참조 : https://www.cloudera.com/documentation/enterprise/5-13-x/topics/sg_sentry_service_config.html#xd_583c10bfdbd326ba--69adf108-1492ec0ce48--7dbd

0.각노드에 사용자 추가및 패스워드 설정, hive그룹추가
useradd hadmin
passwd hadmin

0-1. hue에서 admin/admin으로 로그인후 관리자로 사용할 사용자를 등록(예, hadmin, 슈퍼어드민으로 설정)한다.
0-2. beeline으로 로그인하여
beeline
!connect jdbc:hive2://xxx.xxx.xxx.xxx:10000/
username:hive
password:hive
0-3. beeline에서 admin-role생성
create role admin_role;
grant all on server server1 to role admin_role;
grant role admin_role to group hadmin;

-----------------------------HDFS상의 권한 설정(771, hive:hive)-----------------------
hive의 default warehouse디렉토리인 /user/hive/warehouse 혹은 hive-site.xml에서 hive.metastore.warehouse.dir로 지정한 HDFS위치는 hive user와 hive group을 가져야 하며(예, hive:hive) 해당 디렉토리내의 모든 파일과 디렉토리 그리고 하위 디렉토리와 파일은 모두 hive:hive로 설정되어야한다.
 가. sudo -u hdfs hdfs dfs -chmod -R 771 /user/hive/warehouse
 나. sudo -u hdfs hdfs dfs -chown -R hive:hive /user/hive/warehosue
)
혹은 hive가 다른 디렉토리를 사용한다면 해당 디렉토리는 771로 설정하고 소유:그룹은 hive:hive로 맞춰줘야한다.


--------------------hue user추가및 role권한 부여-----
-1. YARN에서 최소 사용자 ID(min.user.id)를 1000에서 0으로 변경 (MapReduce job을 submit할 수 있게함)
 
0. Cloudera Manager에서 
가. Hue -> Sentry서비스 -> Sentry 선택
나. Hive -> Sentry서비스 -> Sentry 선택
다. Impala -> Sentry 서비스 -> Sentry 선택

1. 모든 노드에 linux user생성및 hive 그룹부여
useradd shd001
passwd shd001
usermod -aG hive,spark shd001

* SpaceQuota설정 : HDFS home및 hive영역에 대한 쿼터 설정을 수행한다.
   (150G로 설정하면 3X replica의 경우 50G까지의 파일 저장이 가능함)
 -> sudo -u hdfs kinit -kt /var/lib/keytab/hdfs.keytab hdfs   (Kerberos설정된 경우에 수행)
 -> sudo -u hdfs hdfs dfsadmin -setSpaceQuota 150G /user/shd001     (shd001 HDFS폴더에 spacequota를 지정하는 경우)
 -> sudo -u hdfs hdfs dfsadmin -setSpaceQuota 150G /user/hive/warehouse/prj001db.db   (prj001db에 spacequota를 지정하는 경우)
(참고 : prj001db에 할당된 quota를 확인하는 방법 : sudo -u hdfs hdfs dfs -count -q -v /user/hive/warehosue/prj001db.db)


* hdfs의 home위치는 group을 hdfs로 변경함 (예, shd001사용자인 경우 sudo -u hdfs hdfs dfs -chown shd001:hdfs /user/shd001를 수행한다)
  (group을 hive로 변경하면 다른 계정에서 서로 폴더를 볼수 있게되므로.. hive가 아닌 hdfs로 그룹명을 준다)

2. hue user생성
hue admin 계정으로 접속해서 사용자 추가
linux user와 똑같이 생성

3. user용DB및 HDFS경로에 대한 role생성(hive query사용)및 부여
create database prj001db;

create role shd001_role;
grant all on database prj001db to role shd001_role;
grant role shd001_role to group shd001;

create role shd001_uri_all_role;
grant all on uri 'hdfs://nameservice/user/shd001' to role shd001_uri_all_role;
grant role shd001_uri_all_role to group shd001;


-------------sentry설정시 설정해야 하는 값--------------------------------------
0. YARN서비스에서
가. 최소사용자ID(min.user.id)값을 1000에서 0으로 변경
나. allowed.system.users에 hive추가

0-1. Hive서비스에서
가. Hive Metastore Access Control and Proxy User Groups Override(hadoop.proxyuser.hive.groups)에 hive, hue, sentry추가

1. Hive서비스에서
HiveServer2 Enable Impersonation
hive.server2.enable.impersonation, hive.server2.enable.doAs 은 false로 해야함

2. Sentry서비스에서
Sentry Service Advanced Configuration Snippet (Safety Valve) for sentry-site.xml 
sentry.hive.testing.mode 를 true로 등록

2-1. sentry-site.xml에 대한 Sentry 클라이언트 고급 구성 스니펫(안전 밸브)에 
(Sentry Client Advanced Configuration Snippet(Safety Valve) for sentry-site.xml
sentry.hive.testing.mode 를 true로 등록

2-1. Sentry서비스에서
Admin Groups(sentry.service.admin.group)에 관리자 id(예, hadmin)을 추가함
Allowed Conneting Users(sentry.service.allow.connect)에 관리자 id(예, hadmin)을 추가하고
hive, impala,hue,spark그룹이 지정되어 있는지 확인후 지정되지 않았으면 추가해준다.


3. Hive서비스에서
Hive Service Advanced Configuration Snippet (Safety Valve) for hive-site.xml
- sentry.hive.testing.mode 를 true로 설정
- hive.server2.authorization.external.exec를 true로 설정
- hive.security.authorization.enabled를 false로 설정

4. Hive서비스의 HiveServer2인스턴스에서
HiveServer2 Advanced Configuration Snippet (Safety Valve) for hive-site.xml
sentry.hive.testing.mode 를 true로 설정

5. Hive서비스에서
- Hive Service Advanced Configuration Snippet (Safety Valve) for sentry-site.xml
sentry.hive.testing.mode 를 true로 설정

- Hive Warehouse Subdirectories Inherit Permissions(hive.warehouse.subdir.inerit.perms)에 체크하여 활성화

6. Hive서비스에서 
Enable Stored Notifications in Database을 체크하여 활성화

6-1. Hive Metastore Server에서
Enable Stored Notifications in Database를 체크하여 활성화

7. HDFS에서 
 - Enable Sentry Synchronization에서 HDFS체크하여 활성화
 - Enable Access Control Lists에서 HDFS를 체크하여 활성화 (체크하지 않으면 : HDFS Access Control lists must be enabled(dfs.namenode.acls.enabled이라는 메세지 발생)

 - Check HDFS Permissions을 체크하여 enable시킴
 - Select Enable Sentry Synchronization을 체크하여 enable시킴
 - Sentry Synchronization Path Prefixes(sentry.hdfs.integration.path.prefixes)에 /user/hive/warehouse에 추가하여 /user경로도 추가해준다.(그래야 두군데다 권한통제가됨)


8. hdfs, hive및 sentry서비스 재시작
번호 제목 글쓴이 날짜 조회 수
679 Cloudera Manager의 Java Heap Size변경하는 방법 gooper 2022.06.27 31
678 [Sentry] sentry메타 DB를 이용하여 테이블에 매핑되어 있는 role명칭 찾는 방법. gooper 2022.06.22 16
677 Authorization within Hadoop Projects gooper 2022.06.13 85
676 CDP에서 AD와 Kerberos를 활용하여 인증 환경을 구축하는 3가지 방법 gooper 2022.06.10 413
675 [AD(LADP)] CDP1.7에서 AD및 Kerberos를 연동해도 각 노드에 os account, os group은 생성되어야 하지만 SSSD서비스를 이용하면 직접 생성될 필요가 없다. gooper 2022.06.10 105
674 Query 1234:1234 expired due to client inactivity(timeout is 5m)및 invalid query handle gooper 2022.06.10 81
673 HDFS 파일및 디렉토리 생성시 생성방법에 따라 권한이 다르게 부여된다. gooper 2022.05.30 220
672 [Cloudera Agent] Metadata-Plugin throttling_logger INFO (713 skipped) Unable to send data to nav server. Will try again. gooper 2022.05.16 7
671 "bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')])" 오류는 CA인증을 하지 못해서 발생함 총관리자 2022.05.13 48
670 [TLS/SSL]Kudu Tablet Server설정 총관리자 2022.05.13 35
669 [TLS/SSL]Kudu Master 설정하기 총관리자 2022.05.13 61
668 [TLS/SSL]Cloudera 6.3.4기준 Oozie Web UI TLS설정 항목및 설정값 총관리자 2022.05.13 36
667 [TLS/SSL]Cloudera CDH6.3.4기준 Hue TLS설정 항목 총관리자 2022.05.13 93
666 [HIVESERVER2]프로세스의 thread및 stack trace를 덤프하는 방법(pstack, jstack) 총관리자 2022.05.11 149
665 [Hue]Hue의 메타정보를 담고 있는 desktop_document테이블과 desktop_document2의 관계 총관리자 2022.05.09 38
664 Error: IO_ERROR : java.io.IOException: Error while connecting Oozie server 총관리자 2022.05.02 26
663 oozie webui접근시 id/pw를 물어보는 Windows보안 팝업창이 뜰때 확인/조치방법 총관리자 2022.05.02 19
662 [개발] 온라인 IDE - 개발 환경 구축 없어 어디서나 웹브라우저로 개발하기 총관리자 2022.05.02 196
661 [bitbucket] 2022년 3월 2일 부터 git 작업시 기존에 사용하던 비빌번호를 사용할 수 없도록 변경되었다. 총관리자 2022.04.30 10
660 주문히스토리 조회 총관리자 2022.04.30 10

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로