■ Hadoop 2.6.0 버전 윈도우즈 10을 설치하는 방법을 보여준다.
1. Java 설치하기
1.1 웹 브라우저에서 아래 URL을 입력한다.
▶ URL
1 2 3 |
http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html |
1.2 아래 웹 페이지에서 “Java Platform (JDK) 8u144” 링크를 클릭한다.
1.3 아래 웹 페이지에서 “Java SE Development Kit 8u144” 항목에서 설치 파일을 다운로드 받는다.
▶ 표
1 2 3 4 5 6 7 8 |
─────────────────────── 구분 프로그램명 비고 ────── ───────────── ── 32비트 버전 jdk-8u144-windows-i586.exe 64비트 버전 jdk-8u144-windows-x64.exe ─────────────────────── |
1.4 다운로드 받은 Java 설치 파일을 실행해 Java를 설치한다.
※ 설치시 주의 사항 : 설치 경로에 공백 문자가 포함되면 안된다.
▶ 표
1 2 3 4 5 6 7 8 |
───────────── 순번 설치 디렉토리 ── ────────── 1 c:\Java\jdk1.8.0_144 2 c:\Java\jre1.8.0_144 ───────────── |
2. ANT 설치하기
2.1 웹 브라우저에서 아래 URL을 입력한다.
▶ URL
1 2 3 |
http://ant.apache.org/bindownload.cgi |
2.2 아래 웹 페이지에서 “Current Release of Ant” 항목의 “1.10.1 .zip archive: apache-ant-1.10.1-bin.zip [PGP] [SHA1] [SHA512] [MD5]” 링크를 클릭해 해당 파일을 다운로드 한다.
2.3 다운로드 받은 압축 파일을 아래 경로에 압축 해제한다.
c:\Java\apache-ant-1.10.1
3. Hadoop 설치하기
3.1 웹 브라우저에서 아래 URL을 입력한다.
▶ URL
1 2 3 |
http://www.barik.net/archive/2015/01/19/172716/ |
3.2 “hadoop-2.6.0.tar.gz” 항목을 클릭해 압축 파일을 다운로드 한다.
3.3 다운로드 받은 압축 파일을 아래 경로에 압축 해제한다.
▶ 디렉토리 경로
1 2 3 |
c:\hadoop-2.6.0 |
4. 환경 변수 설정하기
4.1 “제어판”에서 “시스템” 항목을 선택한다.
4.2 “시스템”에서 “고급 시스템 설정” 항목을 선택한다.
4.3 “시스템 속성” 대화 상자에서 “환경 변수” 버튼을 클릭한다.
4.4 아래 화면과 같이 “시스템 변수” 항목에서 “새로 만들기” 버튼을 클릭해 “ANT_HOME”, “HADOOP_HOME”, “JAVA_HOME” 변수를 추가한다.
▶ 표
1 2 3 4 5 6 7 8 9 |
──────────────────── 변수 값 ────── ───────────── ANT_HOME C:\Java\apache-ant-1.10.1 HADOOP_HOME C:\hadoop-2.6.0 JAVA_HOME C:\Java\jdk1.8.0_144 ──────────────────── |
4.5 “King에 대한 사용자 변수” 항목에서 “Path” 항목을 선택하고 “편집” 버튼을 클릭한다.
4.6 “환경 변수 편집” 대화 상자에서 “새로 만들기” 버튼을 클릭해 아래와 같이 “%ANT_HOME%\bin”, “%HADOOP_HOME%\bin”, “%JAVA_HOME%” 항목을 추가한다.
4.7 컴퓨터를 재부팅한다.
5. 싱글 노드 클러스터(가상 분산 모드) 구성하기
5.1 HDFS 환경 설정하기
5.1.1 “c:\hadoop-2.6.0\etc\hadoop\hadoop-env.cmd” 파일 수정하기
▶ hadoop-env.cmd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
@echo off @rem Licensed to the Apache Software Foundation (ASF) under one or more @rem contributor license agreements. See the NOTICE file distributed with @rem this work for additional information regarding copyright ownership. @rem The ASF licenses this file to You under the Apache License, Version 2.0 @rem (the "License"); you may not use this file except in compliance with @rem the License. You may obtain a copy of the License at @rem @rem http://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem Set Hadoop-specific environment variables here. @rem The only required environment variable is JAVA_HOME. All others are @rem optional. When running a distributed configuration it is best to @rem set JAVA_HOME in this file, so that it is correctly defined on @rem remote nodes. @rem The java implementation to use. Required. set JAVA_HOME=%JAVA_HOME% @rem The jsvc implementation to use. Jsvc is required to run secure datanodes. @rem set JSVC_HOME=%JSVC_HOME% @rem set HADOOP_CONF_DIR= @rem Extra Java CLASSPATH elements. Automatically insert capacity-scheduler. if exist %HADOOP_HOME%\contrib\capacity-scheduler ( if not defined HADOOP_CLASSPATH ( set HADOOP_CLASSPATH=%HADOOP_HOME%\contrib\capacity-scheduler\*.jar ) else ( set HADOOP_CLASSPATH=%HADOOP_CLASSPATH%;%HADOOP_HOME%\contrib\capacity-scheduler\*.jar ) ) @rem The maximum amount of heap to use, in MB. Default is 1000. @rem set HADOOP_HEAPSIZE= @rem set HADOOP_NAMENODE_INIT_HEAPSIZE="" @rem Extra Java runtime options. Empty by default. @rem set HADOOP_OPTS=%HADOOP_OPTS% -Djava.net.preferIPv4Stack=true @rem Command specific options appended to HADOOP_OPTS when specified if not defined HADOOP_SECURITY_LOGGER ( set HADOOP_SECURITY_LOGGER=INFO,RFAS ) if not defined HDFS_AUDIT_LOGGER ( set HDFS_AUDIT_LOGGER=INFO,NullAppender ) set HADOOP_NAMENODE_OPTS=-Dhadoop.security.logger=%HADOOP_SECURITY_LOGGER% -Dhdfs.audit.logger=%HDFS_AUDIT_LOGGER% %HADOOP_NAMENODE_OPTS% set HADOOP_DATANODE_OPTS=-Dhadoop.security.logger=ERROR,RFAS %HADOOP_DATANODE_OPTS% set HADOOP_SECONDARYNAMENODE_OPTS=-Dhadoop.security.logger=%HADOOP_SECURITY_LOGGER% -Dhdfs.audit.logger=%HDFS_AUDIT_LOGGER% %HADOOP_SECONDARYNAMENODE_OPTS% @rem The following applies to multiple commands (fs, dfs, fsck, distcp etc) set HADOOP_CLIENT_OPTS=-Xmx512m %HADOOP_CLIENT_OPTS% @rem set HADOOP_JAVA_PLATFORM_OPTS="-XX:-UsePerfData %HADOOP_JAVA_PLATFORM_OPTS%" @rem On secure datanodes, user to run the datanode as after dropping privileges set HADOOP_SECURE_DN_USER=%HADOOP_SECURE_DN_USER% @rem Where log files are stored. %HADOOP_HOME%/logs by default. @rem set HADOOP_LOG_DIR=%HADOOP_LOG_DIR%\%USERNAME% @rem Where log files are stored in the secure data environment. set HADOOP_SECURE_DN_LOG_DIR=%HADOOP_LOG_DIR%\%HADOOP_HDFS_USER% @rem The directory where pid files are stored. /tmp by default. @rem NOTE: this should be set to a directory that can only be written to by @rem the user that will run the hadoop daemons. Otherwise there is the @rem potential for a symlink attack. set HADOOP_PID_DIR=%HADOOP_PID_DIR% set HADOOP_SECURE_DN_PID_DIR=%HADOOP_PID_DIR% @rem A string representing this instance of hadoop. %USERNAME% by default. set HADOOP_IDENT_STRING=%USERNAME% set HADOOP_PREFIX=C:\hadoop-2.6.0 set HADOOP_CONF_DIR=%HADOOP_PREFIX%\etc\hadoop set YARN_CONF_DIR=%HADOOP_CONF_DIR% set PATH=%PATH%;%HADOOP_PREFIX%\bin |
5.1.2 “c:\hadoop-2.6.0\etc\hadoop\core-site.xml” 파일 수정하기
▶ core-site.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>fs.default.name</name> <value>hdfs://0.0.0.0:19000</value> </property> </configuration> |
5.1.3 “c:\hadoop-2.6.0\etc\hadoop\hdfs-site.xml” 파일 수정하기
▶ hdfs-site.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration> |
5.1.4 “c:\hadoop-2.6.0\etc\hadoop\slaves” 파일 수정하기
▶ slaves
1 2 3 |
localhost |
5.2 YARN 환경 설정하기
5.2.1 “c:\hadoop-2.6.0\etc\hadoop\mapred-site.xml” 파일 수정하기
※ 해당 폴더에 mapred-site.xml 파일 대신 mapred-site.xml.template 파일이 있다. mapred-site.xml.template 파일을 복사해 mapred-site.xml 파일을 생성한 다음 수정한다.
▶ mapred-site.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>mapreduce.job.user.name</name> <value>%USERNAME%</value> </property> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> <property> <name>yarn.apps.stagingDir</name> <value>/user/%USERNAME%/staging</value> </property> <property> <name>mapreduce.jobtracker.address</name> <value>local</value> </property> </configuration> |
5.2.2 “c:\hadoop-2.6.0\etc\hadoop\yarn-site.xml” 파일 수정하기
▶ yarn-site.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
<?xml version="1.0"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <configuration> <property> <name>yarn.server.resourcemanager.address</name> <value>0.0.0.0:8020</value> </property> <property> <name>yarn.server.resourcemanager.application.expiry.interval</name> <value>60000</value> </property> <property> <name>yarn.server.nodemanager.address</name> <value>0.0.0.0:45454</value> </property> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <property> <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name> <value>org.apache.hadoop.mapred.ShuffleHandler</value> </property> <property> <name>yarn.server.nodemanager.remote-app-log-dir</name> <value>/app-logs</value> </property> <property> <name>yarn.nodemanager.log-dirs</name> <value>/dep/logs/userlogs</value> </property> <property> <name>yarn.server.mapreduce-appmanager.attempt-listener.bindAddress</name> <value>0.0.0.0</value> </property> <property> <name>yarn.server.mapreduce-appmanager.client-service.bindAddress</name> <value>0.0.0.0</value> </property> <property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property> <property> <name>yarn.log-aggregation.retain-seconds</name> <value>-1</value> </property> <property> <name>yarn.application.classpath</name> <value> %HADOOP_CONF_DIR%, %HADOOP_COMMON_HOME%/share/hadoop/common/*, %HADOOP_COMMON_HOME%/share/hadoop/common/lib/*, %HADOOP_HDFS_HOME%/share/hadoop/hdfs/*, %HADOOP_HDFS_HOME%/share/hadoop/hdfs/lib/*, %HADOOP_MAPRED_HOME%/share/hadoop/mapreduce/*, %HADOOP_MAPRED_HOME%/share/hadoop/mapreduce/lib/*, %HADOOP_YARN_HOME%/share/hadoop/yarn/*, %HADOOP_YARN_HOME%/share/hadoop/yarn/lib/* </value> </property> </configuration> |
6. 환경 변수 초기화 하기
6.1 “c:\hadoop-2.6.0\etc\hadoop\hadoop-env.cmd” 파일을 실행한다.
7. 파일 시스템 포맷하기
7.1 관리자 권한으로 “명령 프롬프트”를 실행한다.
7.2 “hdfs namenode -format” 명령을 입력한다.
※ “c:\tmp” 폴더에 해당 폴더들이 생성된다.
8. HDFS 데몬 시작하기
8.1 관리자 권한으로 “명령 프롬프트”를 실행한다.
8.2 “c:\hadoop-2.6.0\sbin\start-dfs.cmd” 파일을 실행한다.
9. YARN 데몬 시작하기
9.1 관리자 권한으로 “명령 프롬프트”를 실행한다.
9.2 “c:\hadoop-2.6.0\sbin\start-yarn.cmd” 파일을 실행한다.