메뉴 건너뛰기

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서비스 재시작
번호 제목 글쓴이 날짜 조회 수
560 namenode오류 복구시 사용하는 명령 총관리자 2016.04.01 376
559 Incompatible clusterIDs오류 원인및 해결방법 총관리자 2016.04.01 490
558 Elastic Search For Hadoop 2.2.0설치하기(5대 클러스터링) 총관리자 2016.04.04 447
557 elasticsearch 1.3.0에서 rdf및 hadoop plugin설치 총관리자 2016.04.06 108
556 failed to read local state, exiting...오류발생시 조치사항 총관리자 2016.04.06 141
555 서버 5대에 solr 5.5.0 설치하고 index data를 HDFS에 저장/search하도록 설치/설정하는 방법 총관리자 2016.04.08 54
554 서버 5대에 solr 5.5.0 설치하고 index data를 HDFS에 저장/search하도록 설치/설정하는 방법(SolrCloud) 총관리자 2016.04.08 656
553 딥러닝 수학/알고리즘 '한국어' 강의 총관리자 2016.04.10 110
552 Cassandra 3.4(3.10) 설치/설정 (5대로 clustering) 총관리자 2016.04.11 397
551 bin/cassandra -f -R로 startup할때 NullPointerException오류가 나면 조치할 내용 총관리자 2016.04.14 70
550 cumulusRDF 1.0.1설치및 "KeyspaceCumulus" keyspace확인하기 file 총관리자 2016.04.15 242
549 Hadoop 완벽 가이드 정리된 링크 총관리자 2016.04.19 205
548 Spark 2.1.1 clustering(5대) 설치(YARN기반) 총관리자 2016.04.22 1882
547 solrcloud에 solrdf1.1설치하고 테스트 하기 총관리자 2016.04.22 113
546 solrdf초기 기동시 "Caused by: java.lang.IllegalAccessError: tried to access field org.apache.solr.handler.RequestHandlerBase.log from class org.gazzax.labs.solrdf.handler.update.RdfUpdateRequestHandler" 오류가 발생시 조치사항 총관리자 2016.04.22 157
545 collection생성시 -shards와 -replicationFactor값을 잘못지정하면 write.lock for client xxx.xxx.xxx.xxx already exists오류가 발생한다. 총관리자 2016.04.28 88
544 solr 인스턴스 기동후 shard에 서버가 정상적으로 할당되지 않는 경우 해결책 총관리자 2016.04.29 654
543 kafka 0.9.0.1 for scala 2.1.1 설치및 테스트 총관리자 2016.05.02 412
542 kafka broker기동시 brokerId가 달라서 기동에 실패하는 경우 조치방법 총관리자 2016.05.02 2331
541 Master rejected startup because clock is out of sync 오류 해결방법 총관리자 2016.05.03 60

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.

위로