본문 바로가기

전체 글1126

[ranger] mysql 에서 ranger 를 위한 user 생성 후 권한 추가 방법 레인저를 설정 할 때 ranger db 초기화를 위해서는 root 권한의 유저를 설정해야 합니다.  일반적으로 유저를 생성하고, grant 옵션을 이용해서 사용자를 추가 했으나 권한 부족으로 레이저 설치가 되지 않아서 mysql user 테이블을 조회하여 권한을 확인 하였더니, grant 옵션이 빠져 있어서 다음과 같이 update 를 실행하여 권한을 추가 하였습니다. -- 사용자 생성CREATE USER IF NOT EXISTS 'ranger_root'@'%' IDENTIFIED BY 'password';-- DB 생성CREATE DATABASE IF NOT EXISTS ranger;-- 권한 설정GRANT ALL PRIVILEGES ON *.* TO 'ranger_root'@'%' WITH GRANT.. 2024. 10. 13.
[ranger] 레인저 2.4.0에서 ES에 Audit을 설정할 때 Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair 오류 ranger 2.4.0 버전의 HDFS 플러그인을 사용할 때 haoop 3.3.4 버전의 플러그인을 설정하고, ES를 Audit 저장소로 설정할 때 다음과 같은 오류가 발생하였습니다  Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambda.. 2024. 10. 11.
[airflow] 에어플로우 로그를 정리할 때 사용할 수 있는 명령어 에어플로우가 오랜 기간 실행되면 에어플로우의 로그와 DAG의 실행 로그가 로컬에 쌓이게 됩니다. 이 로그를 주기적으로 정리해 주어야 할 때 사용할 수 있는 명령어 입니다.  다음은 로그 파일의 사이즈를 0으로 초기화 하는 명령어 입니다. truncate -s 0 airflow-worker.errcat /dev/null > airflow-worker.err: > airflow-worker.err> airflow-worker.err  DAG 로그를 초기화 하기 위해서는 find 명령어를 이용합니다. 폴더로 파일이 생성되기 때문에 rm 명령어를 이용하고, DAG이 생성되는 날짜를 이용하여 처리합니다. # airflow/logs 폴더에서 사용find ./ -name "*2024-10-11* -maxdepth 2.. 2024. 10. 11.
[ranger] 레인저 HDFS plugin 에서 User does not have permission for this operation 오류 레인저 HDFS 플러그인을 설정하는데 다음과 같은 오류가 발생하면서 플러그인 정보를 가져가지 못하는 문제가 있었습니다 . User does not have permission for this operation 이는 커버러스 설정된 레인저는 지정한 사용자만 플러그인을 가져갈 수 있게 설정되어서 그렇습니다. 레인저의 플러그인 설정 정보에 다음 값을 추가하면 됩니다 . "policy.download.auth.users": "hdfs" 2024. 10. 10.
[log4j] log4j 설정을 적용할 때 Unable to locate appender "INFO,DRFA" for logger config "root" 오류 spark 3.2를 사용하다가 spark 3.5로 변경했는데 log4j 설정이 log4j2 설정으로 변경되면 서 기존에 설정한 로깅 설정이 적용되지 않았다.  log4j2 설정으로 변경해서 적용했는데 다음과 같은 오류가 발생하였다. Unable to locate appender "INFO,DRFA" for logger config "root"  원인은 기존에 log4j 설정을 할 때 처럼 로그 레벨과 타겟을 동일하게 설정했더니 오류가 발생하는 것이다. log4j2 는 각각 따로 설정을 해주어야 한다. # root loggerrootLogger.level = INFOrootLogger.appenderRefs = rootrootLogger.appenderRef.root.ref = DRFA 2024. 10. 10.
[spark] log4j 설정을 이용하여 스파크 쓰리프트 서버의 로그를 파일로 출력하는 방법 log4j 설정을 외부에서 주입하는 방법을 정리합니다.문제spark 스리프트 서버를 실행할 때는 로그를 파일로 저장하고, spark beeline 을 실행할 때는 콘솔로 출력해야 했습니다. 같은 로그 설정 파일을 이용하기 때문에 하나의 파일로 두 가지 설정을 출력해야 했습니다.해결 방법log4j 에 기본 설정을 두고, 외부에서 설정이 주입되면 외부 설정을 이용할 수 있게 하였습니다.다음과 같이 설정하여 외부에서 정보가 입력되지 않으면, 설정에 저장된 spark.root.logger 설정을 이용하고, 외부에서 입력되면 외부의 설정이 기본값을 덮어 써서 외부의 값을 이용하게 됩니다.# log4j 설정 spark.root.logger=INFO,consolespark.log.dir=.spark.log.file=.. 2024. 9. 30.
[Tez] Tez 0.10.3과 Hadoop 3.3.6을 연결할 때 발생하는 오류 Tez 0.10.3 와 Hadoop 3.3.6을 설치하니 다음과 같은 오류가 발생하였습니다. 2024-09-05T06:53:52,466 INFO [main] conf.HiveConf: Using the default value passed in for log id: 693153d4-f980-4b4a-84b9-f55371e343d92024-09-05T06:53:52,471 INFO [main] session.SessionState: Error closing tez sessionjava.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.Exception: java.lang.IllegalAccessError: tried to.. 2024. 9. 23.
[apt] apt를 이용한 설치 파일을 다운로드 하는 방법 - Kerberos 설치 파일 다운로드 하는 방법 apt 를 이용하여 라이브러리를 설치 할 때 인터넷이 되지 않는 환경의 VM에 파일을 설치 하기 위해서 설치 파일을 다운로드 받아야 하는 경우가 있습니다. 이때는 다음의 명령어를 이용해서 파일 uri를 확인하고 wget 명령을 이용해서 파일을 다운로드 할 수 있습니다.  # krb 서버 sudo apt install --print-uris -y krb5-kdc krb5-admin-server# krb 클라이언트sudo apt install --print-uris -y krb5-user 위의 명령어를 입력하면 다운로드 파일 정보를 확인할 수 있습니다. 이 파일들을 모두 다운 받아서 다른 vm 에 설치하면 됩니다. 주의할 점은 이미 설치된 후 라면 정보가 출력되지 않을 수 있습니다. 설치 전에 미리 입력하는.. 2024. 9. 7.
[hue] Secure HDFS와 연동에서 Error 401 Authentication required 오류가 발생하는 경우 Hue와 SecureHDFS를 연동하는 방법을 정리하면서 발생한 다음의 오류를 해결하는 방법도 알아보겠습니다.HTTP ERROR 401Problem accessing /webhdfs/v1. Reason: Authentication requiredPowered by Jetty://  사용 버전hadoop: v2.10.2Hue: 4.11.0Hue와 Secure HDFS 연결 설정hadoop은 커버로스 설정을 처리하고, Hue에서 커버로스 하둡을 연동하기 위해서는 hue.ini 에 다음과 같이 설정합니다.[hadoop][[hdfs_clu.. 2024. 9. 3.
[curl] curl: option --data-binary: out of memory 오류가 발생할 때 해결 방법 curl 에서 파일을 업로드 할 때 작은 용량의 데이터는 --data-binary 를 이용할 수 있습니다. 이때 out of memory 오류가 발생하면 -T 옵션을 이용하면 됩니다. -T(--upload-file) 옵션은 파일을 서버에 업로드 할 때 주로 사용합니다. curl -T filename.txt http://example.com/upload  -d (--data-binary) 옵션은 텍스트 데이터를 그대로 전송할 때 주로 사용합니다.curl --data-binary @filename.txt http://example.com/upload 2024. 9. 3.
[mysql] grant all privileges on ranger.* to 'ranger_admin'@'%' with grant option; 쿼리 실행 중에 Access denied for user 'ranger_root'@'%' to database 'ranger' ErrorCode: 1044 오류가 발생하는 경우 해결 방법 아파치 레인저를 설치 하는 중에 setup.sh 를 실행하면 다음과 같은 쿼리를 실행하고, 오류가 발생하였습니다.오류grant all privileges on ranger.* to 'ranger_admin'@'%' with grant option; ranger_admin 유저에 권한 추가다음과 같이 모든 권한을 주었지만 동일한 오류가 발생하였습니다.GRANT ALL privileges on *.* to 'ranger_root'@'%';FLUSH PRIVILEGES;mysql user 테이블 확인ranger_admin 유저에게 모든 권한을 주었기 때문에 이러한 오류가 발생하는 원인을 확인하기 위해서 mysql.user 테이블을 조회하여 보았습니다. 모든 권한을 주었지만 Grant_priv 칼럼의 값이 N인.. 2024. 7. 23.
[hdfs] HA 구성된 HDFS의 journalnode 3대 중 1대의 서버가 장애가 발생했을 때 대응 (Journal Storage Directory /hadoop/hdfs/journal/edit/user-hadoop not formatted ; journal id: user-hadoop) 장애 상황HA 구성 된 하둡은 3대의 저널 노드(journalnode)를 필요로 하는데 그 중 1대의 노드에 장애가 발생하여 서버가 포맷 되었습니다. 이로 인해 1대의 저널 노드를 새로 구축해야 하는 상황이 되었습니다.  오류를 해결하기 위해서 서버를 새로 설치하고 실행하니 다음과 같은 오류가 발생하였습니다. 2024-07-18 06:31:25,405 INFO org.apache.hadoop.ipc.Server (IPC Server handler 3 on default port 8485): IPC Server handler 3 on default port 8485, call Call#944181936 Retry#0 org.apache.hadoop.hdfs.qjournal.protocol.QJournalP.. 2024. 7. 18.
[MySQL] Referencing column 'AA' and referenced column 'BB' in foreign key constraint 'FK40h442pc8wb44wkjpkec435vm' are incompatible. 오류 처리 MySQL에서 발생한 오류 메시지 "Referencing column 'AA' and referenced column 'BB' in foreign key constraint 'FK40h442pc8wb44wkjpkec435vm' are incompatible."는 외래 키 제약 조건을 설정할 때 참조하고자 하는 두 열의 데이터 유형이 서로 호환되지 않음을 의미합니다. 외래 키 제약 조건을 만들거나 변경할 때, 참조하는 열(자식 테이블)과 참조되는 열(부모 테이블)의 데이터 유형이 동일해야 하며, 그 외에도 몇 가지 규칙이 있습니다. 이 오류가 발생하는 원인으로는 다음과 같은 것들이 있을 수 있습니다:데이터 유형 불일치: 참조 열과 참조되는 열의 데이터 유형이 다릅니다. 예를 들어, 하나의 열이 INT이고 .. 2024. 7. 11.
[airflow] 에어플로우에서 생성하는 로그의 umask 설정 Apache Airflow에서 로그 파일의 umask를 변경하려면, Airflow 설정 파일(airflow.cfg)에서 설정을 변경하거나, 소스코드 수정을 통해 적용할 수 있습니다. 1. Airflow 설정 파일 (airflow.cfg) 수정Airflow 설정 파일(airflow.cfg)에서 umask 설정을 직접 변경할 수 있는 옵션은2.6.0 이후 적용되었습니다. file_task_handler_new_file_permissions 옵션을 설정하여 적용할 수 있습니다.  https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#file-task-handler-new-file-permissions Configuration.. 2024. 6. 15.
[ranger] apache ranger 빌드 방법 정리 Linux 기준으로 Apache Ranger를 빌드하는 방법을 단계별로 정리하겠습니다. Apache Ranger는 Hadoop 생태계에서 데이터 보안을 관리하기 위한 도구입니다.Ranger를 빌드하려면 Java, Maven, Git 등이 필요합니다.1. 필수 소프트웨어 설치JavaApache Ranger는 Java로 작성되었기 때문에 JDK가 필요합니다. JDK 8 이상이 필요합니다. openjdk8에서 오류가 발생하여 zulu jdk로 빌드릴 진행합니다. wget https://cdn.azul.com/zulu/bin/zulu8.78.0.19-ca-jdk8.0.412-linux_x64.tar.gztar zxf zulu8.78.0.19-ca-jdk8.0.412-linux_x64.tar.gzexport JA.. 2024. 6. 15.
[redis] rocky linux9 버전에 redis 설치 rock linux9 버전에 redis를 설치 하는 방법은 다음과 같습니다  # 설치sudo dnf install redis# 설정 초기화 # bind 주소를 로컬 주소로 변경# 프로텍션 모드를 false 로 변경 sudo vi /etc/redis/redis.conf# 서비스 추가 sudo systemctl enable redis# 실행 sudo systemctl start redis.service# 실행 확인 redis-cli ping 2024. 5. 7.
[mysql] rocky linux9에 mysql 8설치 rocky 리눅스9 버전에 mysql8 버전을 설치 하는 방법은 다음과 같습니다.  # mysql 설치 sudo dnf install mysql-server# 서비스 추가sudo systemctl enable mysqld# 서비스 실행 sudo systemctl start mysqld.service# 실행 상태 확인 sudo systemctl status mysqld# 암호 초기화 sudo mysql_secure_installation# 버전 확인 mysqladmin -u root -p version# root 연결 mysql -u root -p 2024. 5. 7.
[Iceberg] 아파치 Iceberg 사용 방법. Apache Iceberg 는 데이터 포맷 입니다. jar 라이브러리만 Spark, Hive 등에 추가하면 사용할 수 있습니다. 따로 컴포넌트를 실행해야 하는 것은 아닙니다. 테이블을 생성하면 다음과 같은 형태로 저장되고, HDFS 위치에 메타 정보가 보관됩니다. 하이브 메타스토어의 역할이 HDFS위치에 파일로 저장됩니다. 사용 방법은 다음 링크에서 확인 부탁드립니다. https://wikidocs.net/228567 10-Iceberg Apache Iceberg는 대용량 데이터의 효율적인 관리와 쿼리를 지원하기 위한 **오픈 소스 데이터 테이블 포맷 및 관리 시스템**입니다. Iceberg는 Hadoop 및 A… wikidocs.net 2024. 4. 14.
[hive] java.lang.NoSuchMethodError: com.lmax.disruptor.dsl.Disruptor.<init> 오류 수정 문제 hive 2.3.9 버전을 실행하면서 다음과 같은 오류가 발생하였습니다. Exception in thread "main" java.lang.NoSuchMethodError: com.lmax.disruptor.dsl.Disruptor.(Lcom/lmax/disruptor/EventFactory;ILjava/util/concurrent/ThreadFactory;Lcom/lmax/disruptor/dsl/ProducerType;Lcom/lmax/disruptor/WaitStrategy;)V at org.apache.logging.log4j.core.async.AsyncLoggerDisruptor.start(AsyncLoggerDisruptor.java:108) at org.apache.logging.lo.. 2024. 3. 30.
[kerberos] Couldn't renew kerberos ticket in order to work around Kerberos 1.8.1 issue. Please check that the ticket for hue/xxxx 오류 처리 오류hue에서 커버러스(kerberos)를 설정하고 실행 할 때 다음과 같은 오류가 발생하면서 제대로 실행되지 않는 문제가 있었습니다. [28/Mar/2024 21:45:22 +0900] kt_renewer ERROR Couldn't renew kerberos ticket in order to work around Kerberos 1.8.1 issue. Please check that the ticket for 'hue/test.com@KERB.ROS' is still renewable: $ klist -f -c /tmp/hue_krb5_ccacheIf the 'renew until' date is the same as the 'valid starting' date, the ticket can.. 2024. 3. 30.
[hive] hive s3 연결시 hive 2.3.0, 3.0.0 이상에서 설정해야 하는 hive.conf.hidden.list 값 hive 에서 s3 를 연결할 때 core-site.xml 파일에 s3 설정 값을 정상적으로 입력하고, hadoop으로 데이터 조회를 확인하고, hive를 이용하여 테이블 생성까지 되는데, tez 나 mr을 이용한 작업을 돌릴 때 다음과 같은 오류가 발생하였습니다. Caused by: com.amazonaws.AmazonClientException: No AWS Credentials provided by SimpleAWSCredentialsProvider : org.apache.hadoop.fs.s3a.CredentialInitializationException: Access key, secret key or session token is unset at org.apache.hadoop.fs.s3a.AW.. 2024. 3. 5.
[maven] aws-sdk-java 코드 빌드시 로컬 소스로 빌드하는 방법 aws sdk java 소스코드를 빌드해서 사용해야 할 일이 생겼는데 빌드를 하이 최종적으로 생기는 aws-java-sdk-bundle-1.12.262.jar 파일이 로컬에 빌드한 파일을 이용하지 않고, 메이븐에 있는 동일한 버전의 파일을 가져와서 shade로 복사하였습니다. 로컬에 수정한 내용의 파일을 이용해서 사용해야 하는데 메이븐 옵션을 바꾸어도 변경이 되지 않아서 우선 버전을 바꾸어서 적용하니 로컬의 파일을 이용하였습니다. https://github.com/aws/aws-sdk-java GitHub - aws/aws-sdk-java: The official AWS SDK for Java 1.x. The AWS SDK for Java 2.x is available here: https://githu.. 2024. 3. 5.
[spark] spark-shell 실행 시 발생하는 java.lang.NoSuchFieldError: JAVA_9 오류 처리 spark-shell을 실행할 때 다음과 같은 오류가 발생하는 경우가 있습니다. 24/02/22 13:09:59 INFO SparkEnv: Registering MapOutputTracker 24/02/22 13:09:59 INFO SparkEnv: Registering BlockManagerMaster 24/02/22 13:09:59 INFO BlockManagerMasterEndpoint: Using org.apache.spark.storage.DefaultTopologyMapper for getting topology information 24/02/22 13:09:59 INFO BlockManagerMasterEndpoint: BlockManagerMasterEndpoint up java.lang.. 2024. 2. 25.
[hive] hive 의 mr 엔진의 오류 처리 - FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask. DEFAULT_MR_AM_ADMIN_USER_ENV Hive 에서 MR 엔진으로 작업을 실행할 때 다음과 같은 오류가 발생하는 경우가 있습니다 FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask. DEFAULT_MR_AM_ADMIN_USER_ENV 원인은 hadoop 라이브러리 충돌입니다. tez 0.9.2 버전에 들어있는 기본 라이브러리가 hadoop 2.7이고, 설치한 하둡 라이브러리가 2.10.2 이기 때문에 발생하는 오류입니다. 문제 해결을 위애서는 tez 에 들어있는 하둡 라이브러리를 삭제 하면 됩니다. rm hadoop-mapreduce-client-core-2.7.0.jar rm hadoop-mapreduce-client-commo.. 2024. 2. 23.
[terraform] template v2.2.0 does not have a package available for your current platform, darwin_arm64 오류 처리 M1 맥북에서 테라폼 코드를 작성할 때 'template_cloudinit_confg'를 이용하면 오류가 발생합니다. - Using previously-installed terraform-provider-openstack/openstack v1.53.0 ╷ │ Error: Incompatible provider version │ │ Provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64. │ │ Provider releases are separate from Terraform CLI releases, so not all prov.. 2024. 2. 18.
[terraform] provider를 로컬 캐쉬를 이용하여 초기화 하는 방법 테라폼을 이용해서 작업을 할 때 terrafom init 명령을 입력하면 프로바이더를 다운로드 하게 되는데 , 폐쇄된 환경에서는 사용할 수 없게 됩니다. 이런 경우 로컬 캐쉬를 이용해서 테라폼 프로바이더를 설정할 수 있습니다. # home 디렉토리에 .terraformrc 파일 생성 후 다음 내용을 입력 # .terraformrc 파일 내용 plugin_cache_dir = "/home/deploy/.terraform.d/plugins-cache" disable_checkpoint = true provider_installation { filesystem_mirror { path = "/home/deploy/.terraform.d/plugins-cache" include = ["registry.terra.. 2024. 2. 7.
[intellij] python 프로젝트 생성 시 AttributeError: module 'virtualenv.create.via_global_ref.builtin.cpython.mac_os' has no attribute 'CPython2macOsArmFramework' 오류 갑자기 인텔리 j 에서 파이썬 프로젝트를 생성할 때 venv 를 선택하면 다음과 같은 오류가 발생하였습니다. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/logan.. 2024. 2. 7.
[trino] trino chart 에서 https 적용 방법 trino를 chart를 이용하여 설치하고, 인그레스에 tls 를 설정하면 https 를 이용하여 통신할 수 있습니다. 하지만 인그레스에만 설정을 하게 되면 코디네이터와 워커의 내부 통신은 http를 이용하게 되고, 쿼리를 실행할 때 반환되는 nextUri 값이 http로 반환되어 오류가 발생합니다. trino에서는 이것을 처리하위한 설정을 제공합니다. config.properties 파일에 다음 설정을 추가하면 내부 통신을 반환할 때 https로 설정하여 반환합니다. http-server.process-forwarded=true https://trino.io/docs/current/security/tls.html#use-a-load-balancer-to-terminate-tls-https TLS and.. 2024. 1. 9.
[hive] metastore 메트릭 설정 하는 방법 하이브 메타스토어의 metric을 설정하려면 hive-site.xml 파일에 다음 설정을 추가해야 합니다. 다음과 같이 설정하면 /tmp/report.json 위치에 5초에 한번 씩 메트릭 설정 파일을 생성합니다. 기본 설정은 json 형태의 파일이며, JMX 형태로 출력할 수도 있습니다. hive.metastore.metrics.enabled true hive.service.metrics.file.location /tmp/report.json hive.service.metrics.file.frequency 5 seconds 다음 위치에서 설정을 확인할 수 있습니다. https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#Con.. 2024. 1. 8.
[macbook] 맥북에 openjdk8 설치하는 방법 맥북에 openjdk8을 설치 하기 위해서는 brew를 이용합니다. # jdk 설치 brew install openjdk@8 # java version 확인 /usr/local/opt/openjdk@8/bin/java -version # java_home 설정 export JAVA_HOME=/usr/local/opt/openjdk@8 https://formulae.brew.sh/formula/openjdk@8 openjdk@8 Homebrew’s package index formulae.brew.sh 2023. 12. 28.