메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


1. 암호화 key 목록 확인

 - sudo -u hdfs kinit -kt /var/lib/keytab/hdfs.keytab hdfs

 - sudo -u hdfs hdfs crypto -listZones

   --> /tmp/zone1 testkey


2. 암호화 zone생성

 - sudo -u hdfs kinit -kt /var/lib/keytab/hdfs.keytab hdfs

 - sudo -u hdfs hdfs dfs mkdir /tmp/zone1

 - sudo -u hdfs hdfs dfs crypto -createZone -keyName testkey -path /tmp/zone1


3. hdfs dfs -copyFromLocal /home/hadoop/testfile.txt /tmp/zone1 수행시 발생할 수 있는 오류

- coyFromLocal: Permission denied: user=hadoop, access=WRITE, inode='/tmp/zone1/':hdfs:supergroup:drwxr-xr-x <- 이 경우는 Ranger->Hadoop SQL에서 Policy를 생성하고 url에 "hdfs://nameservice1/tmp/zone1"을 입력, Allow Conditions의 Select User에 hadoop을 입력, Permission에 "All"을 선택하고 저장해서 권한을 부여해준다. 또한 이곳에 테이블을 생성(impala 혹은 kudu)하여 CRUD하기 위해서 database에 test(db명이 test인 경우)를 선택하고 table, column에는 *을 입력한다. Allow Conditions의 Select User에 hadoop을 선택하고 Permissions에는 select, read, refresh를 선택하고 "save"를 클릭하여 권한을 부여해준다. hive table을 생성하는 경우는 Ranger->Service Manager->HDFS(cm_hdfs)에서 Policy를 등록해주고 Resource Path를 "/tmp/zone1"와 같이 등록및 Select User(예, hadoop), Permissions (예,CRUD권한, Read/Write/Execute)를 선택후 save해서 권한을 부여해 준다.

- copyFromLocal: User:hadoop not allowed to do 'DECRYPT_EEK' ON 'testkey'   <- 이 경우는 아래와 같이 Ranger에서 관련 권한을 부여해야 함.


* Ranger에서 권한 설정(로그인 id : keyadmin로 로그인 해야 cm_kms정책이 보이며 수정할 수 있다, 아래의 설명은 testkey를 만들고 hadoop계정에 testkey에 대한 권한을 부여하는 경우임.)

1. Encryption -> Key Manager ->Select Service에서  cm_kms를 선택한다. 

   (이때, Error! Connection refused: Please check the KMS provider URL and whether the Ranger KMS is running오류가 발생하면  Service Manager -> KMS 우측 "수정" 버튼클릭 -> Config Properties에서 KMS URL을 변경해준다.

     (Ranger KMS의 TLS가 비활성화된 경우 : kms://http@node01.gooper.com:9292/kms, Ranger KMS의 TLS가 활성화된 경우 : kms://https@node01.gooper.com:9494/kms )

   )

1.1 "Add New Key"를 클릭한다. (필요시)

  . Key Name : testkey

  . Cipher : AES/CTR/NoPadding  (default로 설정됨)

  . Length : 128 혹은 256

1.2 "Save"를 눌러서 저장해준다. 


2. Access Manager -> Service Manager에서 KMS중 cm_kms를 클릭한다. 

3 Add New Policy를 클릭하여 새로운 kms정책을 만든다.

  . Policy Name : policy_testkey

  . Key Name : testkey

  . Allow Conditions항목에서 

     Select User에 hadoop을 선택, Permission에 Get, Get Keys, Get Metadata,, Generate EEk, Decrypt EEK를 선택한다.

4. 저장(save)한다. 


* 관리자 계정을 위한 cm_kms의 Policy Name이 all-keyname항목에는 다음과 같이 설정해줘야 한다. 

  - User : keyadmin -> Permissions : Create, Delete, Rollover, Set key Material, Get, Get Keys, Get Metadata, Generate EEK, Decrypt EEK

  - User : hive -> Permissions : Get Metadata, Decrypt EEK

  - User : hbase -> Permissions : Decrypt EEK

  - User : hadoop, impala, hdfs -> Permissions : Get Metadata, Generate EEK, Decrlypt EEK  <= 이항목은 관리를 위해서 추가적으로 부여되어야 함



번호 제목 날짜 조회 수
741 [Ranger]RangerAdminRESTClient Error gertting pplicies; Received NULL response!!, secureMode=true, user=rangerkms/node01.gooper.com@ GOOPER.COM (auth:KERBEROS), serviceName=cm_kms 2023.06.27 73
740 [vue storefrontui]외부 API통합하기 참고 문서 2022.02.09 80
739 [Encryption Zone]Encryption Zone에 생성된 table을 select할때 HDFS /tmp/zone1에 대한 권한이 없는 경우 2023.06.29 83
738 ./gradlew :composeDown 및 ./gradlew :composeUp 를 성공했을때의 메세지 2023.02.20 84
737 [EncryptionZone]User:testuser not allowed to do "DECRYPT_EEK" on 'testkey' 2023.06.29 89
736 [vi] test.nq파일에서 특정문자열(예, <>)을 찾아서 포함되는 라인을 삭제한 동일한 이름의 파일을 만드는 방법 2017.01.25 98
735 [Impala] alter table구문수행시 "WARNINGS: Impala does not have READ_WRITE access to path 'hdfs://nameservice1/DATA/Temp/DB/source/table01_ccd'" 발생시 조치 2024.04.26 98
734 CM의 Impala->Query tab에서 FINISHED query가 보이지 않는 현상 2021.08.31 99
733 restaurant-controller,에서 등록 예시 2022.04.30 99
732 주문히스토리 조회 2022.04.30 99
731 [Hue metadata]Oracle에 있는 Hue 메타정보 테이블을 이용하여 coordinator와 workflow관계 목록을 추출하는 방법 2023.08.22 99
730 [Cloudera Agent] Metadata-Plugin throttling_logger INFO (713 skipped) Unable to send data to nav server. Will try again. 2022.05.16 103
729 oozie의 sqoop action수행시 ooize:launcher의 applicationId를 이용하여 oozie:action의 applicationId및 관련 로그를 찾는 방법 2023.07.26 104
728 [CDP7.1.6,HDFS]HDFS파일을 삭제하고 Trash비움이 완료된후에도 HDFS 공간을 차지하고 있는 경우 확인/조치 방법 2023.07.17 108
727 [CDP7.1.7, Replication]Encryption Zone내 HDFS파일을 비Encryption Zone으로 HDFS Replication시 User hdfs가 아닌 hadoop으로 수행하는 방법 2024.01.15 110
726 주문 생성 데이터 예시 2022.04.30 112
725 호출 url현황 2023.02.21 112
724 [CDP7.1.7, Hive Replication]Hive Replication진행중 "The following columns have types incompatible with the existing columns in their respective positions " 오류 2023.12.27 116
723 eclipse 3.1 단축키 정리파일 2017.01.02 118
722 [CDP7.1.7]Oozie job에서 ERROR: Kudu error(s) reported, first error: Timed out: Failed to write batch of 774 ops to tablet 8003f9a064bf4be5890a178439b2ba91가 발생하면서 쿼리가 실패하는 경우 2024.01.05 118
위로