Hadoop
-
[Hadoop] yarn-site.xml 알아보기Hadoop 2024. 3. 3. 12:14
- 목차 들어가며. 이번 글에서는 yarn-site.xml 의 설정들에 대해서 알아보도록 하겠습니다. 아래 링크는 yarn-default.xml 의 상세한 설명이 기록되어 있는 공식 문서의 주소입니다. https://hadoop.apache.org/docs/r3.1.0/hadoop-yarn/hadoop-yarn-common/yarn-default.xml yarn-site.xml yarn.nodemanager.resource.memory-mb yarn.nodemanager.resource.memory-mb 는 NodeManager 에서 실행될 컨테이너의 메모리 사이즈를 설정하는 옵션입니다. 만약 yarn.nodemanager.resource.memory-mb 가 -1 로 설정되어 있고 또 다른 옵션인 ya..
-
[YARN] ApplicationMaster 알아보기Hadoop 2024. 2. 28. 21:15
- 목차 ApplicationMaster ? Application Master 는 Yarn Client 에 의해서 요청된 Application 을 생성하고 관리하는 역할을 수행합니다. Application Master 는 실행할 Application 마다 하나씩 생성이 되는데요. A 라는 Job 을 실행하기 위해서 YARN 에게 요청하게 되면, YARN 의 ResourceManager 는 이 실행 요청을 받고, Application Master 를 먼저 생성합니다. 그리고 Application Master 는 A Job 의 실행과 관리를 책임지게 됩니다. 아래 그림처럼 YARN Client 의 Job 실행 요청을 수행하기 위해서 제일 먼저 Resource Manager 는 Application Maste..
-
[Hadoop] HADOOP_USER_NAME 환경변수 알아보기Hadoop 2024. 2. 21. 07:30
- 목차 들어가며. 로컬 환경의 터미널에서 원격의 Hadoop 시스템에게 명령을 요청하는 경우가 종종 생기곤 합니다. 이때에 hdfs dfs 커맨드를 사용하게 되는데 별다른 조치없이 hdfs 커맨드를 사용하게 되면, 실제 로컬 머신의 Active User 가 hdfs File System 의 사용자로 설정됩니다. 이를 방지하는 방법에 대해서 알아보도록 하겠습니다. 간단히 Hadoop 실행하기. 아래의 링크는 docker-compose 를 통해서 간단히 Hadoop Cluster 를 생성하는 내용의 페이지입니다. https://westlife0615.tistory.com/20 [Hadoop] Docker 로 Hadoop Cluster 실행하기 ( docker-compose ) - 목차 소개. 하둡을 이해하..
-
[Hadoop] MapReduce Combiner 알아보기Hadoop 2024. 2. 11. 10:26
- 목차 Combiner 란 ? Combiner 의 내부 동작은 Reducer 와 유사합니다. 다만 차이가 있다면, 실행되는 노드의 위치입니다. Combiner 는 Mapper 가 위치한 노드에서 실행됩니다. 그래서 Combiner 는 보통 최적화 기법으로 사용되는데요. Reducer 가 수행해야할 작업을 Combiner 단계에서 미리 처리하여 Shuffling 되는 데이터의 양을 줄일 수 있습니다. 유명한 예시인 Word Count 관련 MapReduce 를 예로 들면, 중복이 많은 Word 에 대한 Count 를 계산할 때에 Combiner 가 존재하지 않는다면 모든 Key-Value Pairs 는 Shuffling 의 대상이 됩니다. 이 과정에서 Combiner 는 중복적인 Word 를 일차적으로 ..
-
[Hadoop] MapReduce Configuration 알아보기Hadoop 2024. 2. 3. 11:32
- 목차 들어가며. 이번 글에서는 Configuration File 을 JVM 데이터로 Deserialization 하는 내용에 대해서 다루어보려고 합니다. 여타 Java Application 은 Resources 하위의 Configuration 파일 내용을 Application 내부에서 사용하곤 합니다. Hadoop 의 MapReduce 에서 org.apache.hadoop.conf.Configuration 의 여러 사용법에 대해서 다루어보도록 하겠습니다. Deserialize Configuration. 먼저 configuration.xml 파일을 작성해보겠습니다. User 데이터를 표현하는 XML 을 구성하였구요. name, age, gender, full-desc 4개의 key-value 로 구성됩..
-
[Hadoop] Secondary NameNode 알아보기Hadoop 2024. 1. 30. 08:08
- 목차 들어가며. 이번 글에서는 Secondary NameNode 에 대해서 알아보는 시간을 가지겠습니다. Hadoop 은 크게 NameNode 와 DataNode 로 구성됩니다. 하나의 파일을 Hadoop 에 저장하게 되면, 파일은 여러 블록들로 나뉘어져 저장됩니다. 이러한 나누어진 블록들은 분산된 DataNode 들에 저장됩니다. 하나의 온전한 파일이 여러 Block 들로 분리되고, 분리된 Block 들은 분산된 DataNode 로 저장됩니다. 이 상황에서 NameNode 는 분산된 Block 들이 어떤 DataNode 에 저장되어 있는지, 파일과 블록의 크기는 어떤지에 대한 메타데이터를 관리하게 됩니다. 그래서 클라이어트가 어떤 파일을 요청하게 되면 NameNode 는 파일의 블록들의 위치 정보를..
-
Zookeeper Ensemble 알아보기 (Leader Election, Sequential Znode)Hadoop 2023. 12. 19. 04:44
- 목차 소개. ZooKeeper Ensemble 에 대해서 알아보려고 합니다. ZooKeeper 들로 구성된 하나의 클러스터이며, Leader-Follower 구성을 따릅니다. 하나의 Leader 가 존재하고, 나머지 ZooKeeper 서버들은 Follower 가 됩니다. 그래서 Leader 를 Replication 하죠. Leader ZooKeeper 가 전적으로 Znode 의 Write, Update, Delete 요청을 책임지며, 카프카나 하둡에 해당하는 클라이언트와 소통하게 됩니다. 그리고 ZooKeeper Ensemble 에서 Leader Election 또한 매우 중요한 부분인데요. 이 과정에서 사용되는 Sequential Znode 에 대해서도 알아보려고 합니다. ZooKeeper Ense..
-
Zookeeper Watch Mechanism 알아보기Hadoop 2023. 12. 19. 04:44
- 목차 소개. Zookeeper 의 Watch Mechanism 은 클라이언트와 주키퍼의 양방향 통신을 가능하게 합니다. 클라이언트는 znode 를 생성/수정/삭제/조회를 할 수 있습니다. 주키퍼는 이러한 클라이언트의 read/write 요청을 처리합니다. 그리고 주키퍼 또한 클라이언트에게 znode 의 상태를 공유할 수 있는데요. 이러한 방식으로 znode 상태 변경에 대한 이벤트를 주키퍼는 클라이언트에게 전달합니다. 카프카나 하둡의 네임노드와 같이 HA 를 구성해야하는 환경에서 주키퍼는 사용되는데요. 이번 글에서 주키퍼의 watch mechanism 에 대해서 알아보겠습니다. 어떤 방식으로 소통하게 될까? 클라이언트가 서버로부터 데이터를 받는 방식은 크게 2가지가 있습니다. 첫번째는 Polling ..
-
Zookeeper Znode 알아보기Hadoop 2023. 12. 19. 04:44
- 목차 소개. Zookeeper 는 Znode 라는 데이터 저장기능이 존재합니다. Znode 는 데이터를 저장할 수 있는 논리적인 개념인데요. Hadoop NameNode 의 Namespace 와 같이 가상의 저장 개념입니다. Znode 는 파일시스템처럼 트리구조를 취하는데요. /hadoop-ha/hadoop-active /hadoop-ha/hadoop-standby /hadoop-ha/locks/operation1 위와 같는 형식의 트리 구조를 이룹니다. 그리고 각 트리의 노드에 해당하는 Znode 를 특정 데이터를 담을 수 있습니다. 이번 글에서는 Znode 가 어떻게 데이터를 저장하는지에 대해서 자세히 알아보려고 합니다. Zookeeper Znode 구조. Znode 는 In-Memory 구조를 ..
-
Hadoop File Permission 알아보기 (ACL)Hadoop 2023. 12. 15. 06:42
- 목차 소개. Hadoop 의 File Permssion 에 대해서 알아보려고 합니다. Hadoop 의 File Permission 은 기존의 Linux 시스템에서 사용하는 Permission 체계와 유사합니다. File 과 Directory 마다 Owner 가 존재하게 되구요. Owner 가 속하는 Group 이 존재합니다. 그리고 Read, Write, Execute 에 해당하는 권한을 부여할 수 있습니다. 또한 ACL (Access Control List) 또한 적용이 가능한데요. 이와 관련된 내용와 설정 방식이 대해서 알아보려고 합니다. 먼저 간단하게 Hadoop Cluster 를 생성해보도록 하겠습니다. 1. hadoop config 파일을 생성합니다. 하둡은 core-site.xml, hdf..