z

Hadoop Install

etc 2021. 8. 3. 17:37

대상: hadoop2.6.0
사전설치: virtualbox6.1, centos7, gcc, gcc-c++, protocol buffer2.5 , jdk 1.8
실행모드: 독립실행, 가상분산, 완전분산

1. protocolbuffer 2.5 (data serialization)
 1.1 download: https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0

 

Release Protocol Buffers v2.5.0 · protocolbuffers/protobuf

Version 2.5.0 General New notion "import public" that allows a proto file to forward the content it imports to its importers. For example, // foo.proto import public "bar.proto"; import "baz.prot...

github.com

1.2. extract tar.gz and #./configure; make; make install
1.3. 확인 #protoc --version

2.hadoop 2.6
2.1 download : search hadoop-2.6.0.tar.gz from google and download
2.2 압축해제
2.3 환경파일 설정
 - masters 파일 생성 내용은 localhost
 - slaves 파일 내용 localhost로 설정
 - core-stie.xml 파일 설정 : HDFS와 MR에서 공통이용할 환경정보
 - mapred-site.xml 파일 설정: 맵리듀스에서 사용할 환경정보
 - hdfs-site.xml : HDFS에서 이용할 환경 정보정보
 - hadoop-env.sh : JAVA_HOME 설정

yarn-site.xml
0.00MB
mapred-site.xml.template
0.00MB
mapred-site.xml
0.00MB
masters
0.00MB
hdfs-site.xml
0.00MB
hadoop-env.sh
0.00MB
core-site.xml
0.00MB
slaves
0.00MB

2.4 포맷
 $~/hadoop/bin/hdfs namenode -format
2.4 실행 및 확인
$~/hadoop/sbin/start-all.sh : 중간에 계정패스워드 4~5회 물어봄
$jps : java virtual machine process status tool
 - 목록출력: NameNode, DataNode, ResourceManager, NodeManager, SecondaryNameNode
2.5 종료
 $~/hadoop/sbin/stop-all.sh : 중간에 패스워드 물어봄

3. 워드카운트 샘플 실행

3.1 파일작성
 - 이클립스에서 소스 작성 (Mapper, Reducer, Driver)
 - conf 디렉토리 생성 후 하둡설정파일 카피 (core-site.xml, hdfs-site.xml, mapred-site.xml)
 - 하둡코어라이브러리 다운로드 받아 classpath추가 (hadoop-core-1.2.1.jar)
 - 작성후 jar파일로 묶어서 실행

3.2 실행순서
 - $ ./bin/hdfs dfs -mkdir /input
 - $ ./bin/hdfs dfs -mkdir /input/hadoop
 - $ ./bin/hdfs dfs -mkdir /output
 - $ ./bin/hadoop jar WordCount.jar MainClassFullPackageName inputFileName output/FolerName

WordCount.jar
3.72MB

AND