메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


Hadoop Hadoop 설치 및 시작하기

구퍼 2013.03.06 09:45 조회 수 : 1951

Hadoop 설치 및 시작하기

 

Hadoop 의 구축 방법으로는

단독 작업 모드 (Stand-Alone Operation), 가상 분산 모드 (Pseudo-Distributed Operation), 완전 분산 모드 (Fully-Distributed Operation) 이렇게 3가지 방법이 있다.

본 포스팅에서는 가상 분산 모드(Pseudo-Distributed Operation)로 구축해 보도록 하겠다.

하둡 설치하기

 

아래의 아파치 하둡 페이지에서 다운로드를 받는다.

http://www.apache.org/dyn/closer.cgi/hadoop/common/

필자는 hadoop_1.1.1 버전을 받았으나, 다른 버전을 사용해도 상관없을 것이다.

tar.gz 로 끝나는 파일(hadoop-1.1.1.tar.gz)을 받으면 된다.

다운이 완료되었으면 알FTP를 통해 다운받은 파일을 전송한다.

전송이 완료되면

PuTTY 를 통해 원격접속하여 hadoop 설치를 진행하겠다.

서버에는 Ubuntu 12.04 버전이 설치되어있다.

그리고 자바는 필수적으로 설치되어 있어야 한다.(jdk1.6.x 권장)

알FTP로 전송한 hadoop-1.1.1.tar.gz가 있는 위치로 이동하여 tar파일의 압축을 푼다.

압축해제 명령어

tar -xvzf hadoop-1.1.1.tar.gz

hadoop-1.1.1.tar.gz 의 압축을 푼 것으로 설치는 완료되었다.

하둡 설치경로를 환경 변수설정 해주어야 한다.

# cd

# vi .profile

export JAVA_HOME=/usr/lib/jvm/java-6-sun

export HODOOP_INSTALL=/usr/local/hadoop-1.1.1

export PATH=$PATH:$HADOOP_INSTALL/bin

환경 설정을 적용한다.

# source .profile

가상 분산 모드(Pseudo-Distributed Operation) 설정하기

압축해제한 폴더경로로 이동하여 파일들을 살펴보면 대략 이러한 파일들이 나올것이다.

input, output 폴더는 테스트과정에서 생성된것임

xml 문서작성하기

vi 편집기를 이용하여 다음 3개의 xml 을 아래와 같이 수정한다.

vi conf/core-site.xml

vi conf/hdfs-site.xml

vi conf/mapred-site.xml

1. conf/core-site.xml

<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

2. conf/hdfs-site.xml

<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>

3. conf/mapred-site.xml

<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>


passphraseless ssh 설치하기

$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

 

실행하기

다음의 명령어를 차례로 입력한다.

$ mkdir input
$ cp conf/*.xml input

$ bin/hadoop namenode -format
$ bin/start-all.sh
$ bin/hadoop fs -put conf input
$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'
$ bin/hadoop fs -get output output
$ cat output/*

bin/start-all.sh 입력시 정상적으로 실행된다면 아래의 목록들이 확인될 것이다.

# jps

NameNode

SecondaryNameNode

JobTracker

DataNode

TaskTracker

만약 bin/start-all.sh 입력시 'JAVA_HOME is not set' 이라는 에러가 뜬다면

$ vi conf/hadoop-env.sh 문서에서

export JAVA_HOME='자바경로' 를 입력한다.

export앞에 #은 주석처리이니 빼줄것

정상적으로 진행됬을 경우

cat output/* 입력시 결과가 출력된다.

1개의 일치하는 파일을 찾았다.

  
설치 과정에서의 troubleshooting
- start-all.sh 실행시 데몬 프로세스가 구동되지 않거나 JAVA_HOME 못찾는 경우
> vi conf/hadoop-env.sh 에 JAVA_HOME 환경 설정 부분 주석 제거하고 JAVA 설치 정보 수정해 줌

- java.io.IOException: Not a file: 오류 발생 시
> bin/hadoop fs -rmr input          (input 삭제)
> bin/hadoop fs -put conf input   (로컬의 conf경로에 있는 파일을 hadoop의 input에 다시적재)

 

- 구동 확인 방법
. http://localhost:50030/jobtracker.jsp
. http://localhost:50070/dfshealth.jsp

번호 제목 글쓴이 날짜 조회 수
61 small file 한개 파일로 만들기(text file 혹은 parquet file의 테이블) gooper 2022.07.04 76
60 [Cloudera 6.3.4, Kudu]]Service Monitor에서 사용하는 metric중에 일부를 blacklist로 설정하여 모니터링 정보 수집 제외하는 방법 gooper 2022.07.08 31
59 [Kudu]Schema별 혹은 테이블별 사용량(Replica포함) 구하는 방법 gooper 2022.07.14 121
58 [CDP7.1.7]Impala Query의 Memory Spilled 양은 ScratchFileUsedBytes값을 누적해서 구할 수 있다. gooper 2022.07.29 29
57 [kerberos]Kerberos HA구성 참고 페이지 gooper 2022.08.31 15
56 Oracle 12c DB의 LOB타입 컬럼이 있는 테이블을 import할 때 주의 할 사항 gooper 2022.09.14 177
55 [Kerberos인증] /var/log/krb5kdc.log파일 기준으로 인증요청(AS), 티켓확인(TGS)이 진행되는 로그 기록 gooper 2022.09.21 36
54 [impala]쿼리 수행중 발생하는 오류(due to memory pressure: the memory usage of this transaction, Failed to write to server) gooper 2022.10.05 67
53 kerberos연동된 CDH 6.3.4에서 default realm값이 잘못된 상태에서 서비스 기동시 오류 gooper 2022.10.14 35
52 kudu의 내부 table명 변경하는 방법 gooper 2022.11.10 22
51 [oozie]oozie ssh action으로 패스워드 없이 다른 서버에 ssh로그인 하여 shellscript호출하는 설정하는 방법 gooper 2022.11.10 29
50 [Impala 3.2버젼]compute incremental stats db명.테이블명 수행시 ERROR: AnalysisException: Incremental stats size estimate exceeds 2000.00MB. 오류 발생원인및 조치방안 gooper 2022.11.30 697
49 [HA구성 이슈]oozie 2대를 L4로 HA구성했을때 발생하는 이슈 gooper 2023.01.17 17
48 [Kerberos]병렬 kinit 호출시 cache파일이 손상되어 Bad format in credentials cache 혹은 No credentials cache found 혹은 Internal credentials cache error 오류 발생시 gooper 2023.01.20 32
47 [Impala TLS/SSL이슈]RangerAdminRESTClient.java:151] Failed to get response, Error is: TrustManager is not specified gooper 2023.02.02 106
46 [ftgo_application]Unable to infer base url오류 발생시 조치방법 gooper 2023.02.20 1348
45 ./gradlew :composeDown 및 ./gradlew :composeUp 를 성공했을때의 메세지 gooper 2023.02.20 6
44 호출 url현황 gooper 2023.02.21 6
43 [Hive canary]Hive에 Metastore canary red alert및 hive log파일에 Duplicate entry '123456' for key 'NOTIFICATION_LOG_EVENT_ID'가 발생시 조치사항 gooper 2023.03.10 67
42 hive의 메타정보 테이블을 MariaDB로 사용하는 경우 table comment나 column comment에 한글 입력시 깨지는 경우 utf8로 바꾸는 방법. gooper 2023.03.10 93

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로