메뉴 건너뛰기

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  <= 이항목은 관리를 위해서 추가적으로 부여되어야 함



번호 제목 날짜 조회 수
47 [CDP7.1.7] oozie sqoop action으로 import혹은 export수행시 발생한 오류에 대한 자세한 로그 확인 하는 방법 2024.04.19 3148
46 spark-sql실행시 ERROR log: Got exception: java.lang.NumberFormatException For input string: "2000ms" 오류발생시 조치사항 2016.06.09 3135
45 hadoop cluster구성된 노드를 확인시 Capacity를 보면 색이 붉은색으로 표시되어 있는 경우나 Unhealthy인 경우 처리방법 2017.08.30 3116
44 Flume을 이용한 데이타 수집시 HBase write 성능 튜닝 file 2016.10.31 3113
43 Hive MetaStore Server기동시 Could not create "increment"/"table" value-generation container SEQUENCE_TABLE since autoCreate flags do not allow it. 오류발생시 조치사항 2017.05.03 3112
42 spark 2.0.0의 api를 이용하는 예제 프로그램 2017.03.15 3108
41 Ubuntu 16.04 LTS에 Hive 2.1.1설치하면서 "Version information not found in metastore"발생하는 오류원인및 조치사항 2017.05.03 3088
40 format된 namenode를 다른 서버에서 다시 format했을때 오류내용 2016.09.22 3086
39 [Encryption Zone]Encryption Zone에 생성된 table을 select할때 HDFS /tmp/zone1에 대한 권한이 없는 경우 2023.06.29 3069
38 Authorization within Hadoop Projects 2022.06.13 3046
37 Cloudera설치중에 "Error, CM server guid updated"오류 발생시 조치방법 2018.03.29 3043
36 hadoop에서 yarn jar ..를 이용하여 appliction을 실행하여 정상적으로 수행되었으나 yarn UI의 어플리케이션 목록에 나타나지 않는 문제 2017.05.02 3037
35 spark-shell을 실행하면 "Attempted to request executors before the AM has registered!"라는 오류가 발생하면 2018.06.08 3024
34 hadoop에서 yarn jar ..를 이용하여 appliction을 실행하여 정상적(?)으로 수행되었으나 yarn UI의 어플리케이션 목록에 나타나지 않는 문제 2017.05.02 3005
33 centos 6에서 mariadb 5.1 to 10.0 으로 upgrade 2016.11.01 3003
32 hadoop에서 yarn jar ..를 이용하여 appliction을 실행하여 정상적으로 수행되었으나 yarn UI의 어플리케이션 목록에 나타나지 않는 문제 2017.05.02 2998
31 Toree 0.1.0-incubating이 Scala 2.10.4까지만 지원하게 되어서 발생하는 NoSuchMethod오류 문제 해결방법(scala 2.11.x을 지원하지만 오류가 발생할 수 있음) 2018.04.20 2961
30 spark-shell실행시 "A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection."오류가 발생하는 경우 해결방법 2016.05.20 2953
29 Incompatible clusterIDs오류 원인및 해결방법 2016.04.01 2948
28 [Impala] alter table구문수행시 "WARNINGS: Impala does not have READ_WRITE access to path 'hdfs://nameservice1/DATA/Temp/DB/source/table01_ccd'" 발생시 조치 2024.04.26 2941
위로