RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR

Apache Hadoop 2.7.1 significant improvements over the previous stable 2.7 releases. This version has many improvements in HDFS and MapReduce. This how to guide will help you to setup Hadoop 2.7.1 single node cluster on CentOS/RHEL 7/6/5, Ubuntu, Debian and LinuxMint Systems. This article has been tested with Ubuntu 14.04 LTS and it doesn’t includes overall configuration of hadoop, we have only basic configuration required to start working with hadoop.

Setup Hadoop on Linux

Step 1: Installing Java

Java is the primary requirement for running hadoop on any system, So make sure you have Java installed on your system using following command.

# java -version 

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

If you don’t have Java installed on your system, use one of following link to install it first.

Install Java 8 on CentOS/RHEL 7/6/5
Install Java 8 on Ubuntu

Step 2: Creating Hadoop User

We recommend to create a normal (nor root) account for hadoop working. So create a system account using following command.

# adduser hadoop
# passwd hadoop

After creating account, it also required to set up key based ssh to its own account. To do this use execute following commands.

# su - hadoop
$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 0600 ~/.ssh/authorized_keys

Lets verify key based login. Below command should not ask for password but first time it will prompt for adding RSA to the list of known hosts.

$ ssh localhost
$ exit

Step 3. Downloading Hadoop 2.7.1

Now download hadoop 2.7.1 source archive file using below command. You can also select alternate download mirror for increasing download speed.

$ cd ~
$ wget http://apache.claz.org/hadoop/common/hadoop-2.7.1/hadoop-2.7.1.tar.gz
$ tar xzf hadoop-2.7.1.tar.gz
$ mv hadoop-2.7.1 hadoop

Step 4. Configure Hadoop Pseudo-Distributed Mode

4.1. Setup Hadoop Environment Variables

First we need to set environment variable uses by hadoop. Edit ~/.bashrc file and append following values at end of file.

export HADOOP_HOME=/home/hadoop/hadoop
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin

Now apply the changes in current running environment

$ source ~/.bashrc

Now edit $HADOOP_HOME/etc/hadoop/hadoop-env.sh file and set JAVA_HOME environment variable. Change the JAVA path as per install on your system. This path may vary as per your operating system version and installation source. So make sure you are using correct path.

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

4.2 Setup Hadoop Configuration Files

Hadoop has many of configuration files, which need to configure as per requirements of your hadoop infrastructure. Lets start with the configuration with basic hadoop single node cluster setup. first navigate to below location

$ cd $HADOOP_HOME/etc/hadoop

Edit core-site.xml

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

Edit hdfs-site.xml

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

<property>
  <name>dfs.name.dir</name>
    <value>file:///home/hadoop/hadoopdata/hdfs/namenode</value>
</property>

<property>
  <name>dfs.data.dir</name>
    <value>file:///home/hadoop/hadoopdata/hdfs/datanode</value>
</property>
</configuration>

Edit mapred-site.xml

<configuration>
 <property>
  <name>mapreduce.framework.name</name>
   <value>yarn</value>
 </property>
</configuration>

Edit yarn-site.xml

<configuration>
 <property>
  <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
 </property>
</configuration>

4.3. Format Namenode

Now format the namenode using following command, make sure that Storage directory is

$ hdfs namenode -format

Sample output:

15/11/13 14:48:31 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = localhost/127.0.0.1
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.7.1
...
...
...
15/11/13 14:48:41 INFO common.Storage: Storage directory /home/hadoop/hadoopdata/hdfs/namenode has been successfully formatted.
15/11/13 14:48:42 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
15/11/13 14:48:42 INFO util.ExitUtil: Exiting with status 0
15/11/13 14:48:42 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
************************************************************/

Step 5. Start Hadoop Cluster

Lets start your hadoop cluster using the scripts provides by hadoop. Just navigate to your hadoop sbin directory and execute scripts one by one.

$ cd $HADOOP_HOME/sbin/

Now run start-dfs.sh script.

$ ./start-dfs.sh

Sample output:

Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/hadoop/hadoop/logs/hadoop-hadoop-namenode-svr1.tecadmin.net.out
localhost: starting datanode, logging to /home/hadoop/hadoop/logs/hadoop-hadoop-datanode-svr1.tecadmin.net.out
Starting secondary namenodes [0.0.0.0]
The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established.
ECDSA key fingerprint is 0a:50:c6:62:70:84:3d:b8:76:56:10:cd:46:6f:5c:7d.
Are you sure you want to continue connecting (yes/no)? yes
0.0.0.0: Warning: Permanently added '0.0.0.0' (ECDSA) to the list of known hosts.
0.0.0.0: starting secondarynamenode, logging to /home/hadoop/hadoop/logs/hadoop-hadoop-secondarynamenode-svr1.tecadmin.net.out
15/11/13 14:54:12 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Now run start-yarn.sh script.

$ ./start-yarn.sh

Sample output:

starting yarn daemons
starting resourcemanager, logging to /home/hadoop/hadoop/logs/yarn-hadoop-resourcemanager-svr1.tecadmin.net.out
localhost: starting nodemanager, logging to /home/hadoop/hadoop/logs/yarn-hadoop-nodemanager-svr1.tecadmin.net.out

Step 6. Access Hadoop Services in Browser

Hadoop NameNode started on port 50070 default. Access your server on port 50070 in your favorite web browser.

http://svr1.tecadmin.net:50070/

hadoop-2-7-1-namenode

Now access port 8088 for getting the information about cluster and all applications

http://svr1.tecadmin.net:8088/

hadoop-2-7-1-namenode

Access port 50090 for getting details about secondary namenode.

http://svr1.tecadmin.net:50090/

hadoop-2-7-1-secondry-namenode

Access port 50075 to get details about DataNode

Step 7. Test Hadoop Single Node Setup

7.1 – Make the HDFS directories required using following commands.

$ bin/hdfs dfs -mkdir /user
$ bin/hdfs dfs -mkdir /user/hadoop

7.2 – Now copy all files from local file system /var/log/httpd to hadoop distributed file system using below command

$ bin/hdfs dfs -put /var/log/apache2 logs

7.3 – Now browse hadoop distributed file system by opening below url in browser. You will see apache2 folder in list. Click on folder name to open and you will find all log files there.

 http://svr1.tecadmin.net:50070/explorer.html#/user/hadoop/logs/

hadoop-2-7-1-example-data

7.4 – Now copy logs directory for hadoop distributed file system to local file system.

$ bin/hdfs dfs -get logs /tmp/logs
$ ls -l /tmp/logs/
2015/12/14 11:51 2015/12/14 11:51
http://zosel.net/trackback/224
from.スーパーコピーブランド  2015/12/27 08:31
http://www.bentonlock.com/web.phpブランドバッグコピー
from.スーパーコピーブランド  2015/12/27 08:32
http://www.beothic.com/page.phpコピー時計
from.スーパーコピー財布  2015/12/27 08:38
http://www.bestbuyauto.ca/foot.php財布コピー
from.激安ブランドコピー  2015/12/27 08:49
http://www.beothic.com/page.phpブランド時計コピー
from.スーパーコピー  2015/12/27 08:55
http://www.bendequine.com/cache.phpコピーブランド
from.スーパーコピー通販  2015/12/27 09:00
http://www.bernicefriesen.com/eamca.phpスーパーコピーN
from.ブランドコピー  2015/12/27 09:02
http://www.bellbaker.com/bellk.php偽物腕時計
from.激安ブランドコピー  2015/12/27 09:19
http://www.bernicefriesen.com/eamca.phpスーパーコピー時計
from.スーパーコピーバッグ  2015/12/27 09:21
http://www.beothic.com/page.php偽物腕時計
from.偽物腕時計  2015/12/27 10:23
http://www.bearscovebeachhouse.com/church.phpレプリカ時計
from.コピー時計  2015/12/27 11:28
http://www.bellbaker.com/bellk.php激安ブランドコピー
from.時計 ウブロ  2015/12/27 15:35
http://armstrong.coop/kncOWPbRDE1サルバトーレマーラ クロノグラフ 腕時計
from.腕時計 高校生  2015/12/28 20:48
http://www.bendequine.com/cache.phpコピーブランド
from.dazzlin バッグ 送料無料  2015/12/30 13:11
http://www.adelelacedouard.ca/8vCBNOATAV6シャネル 新作 クリーム
from.セリーヌ 表参道 営業時間  2016/01/01 06:36
http://artandsoulbnb.com/8lUNJEAMRU2時計 部品製造
from.アグ カバン  2016/01/01 06:51
http://artandsoulbnb.com/8lPOHXaIVT1時計 部品名
from.ブルガリ ベルト サイズ  2016/01/02 00:24
http://artandsoulbnb.com/8lPOHXaIVT1時計 部品名
from.シャネル 大阪 店舗  2016/01/02 09:57
http://artandsoulbnb.com/8lTIEOGHBB2時計 部品屋
from.腕時計 でんぱソーラー seiko  2016/01/02 13:36
http://artandsoulbnb.com/8lPOHXaIVT1時計 部品名
from.Mcm  2016/01/04 17:10
nike free run 3 size 9
from.デイトナ usb 2ポート  2016/01/04 18:12
http://www.bcpedson.ca/qyRCbOCaLZ2クロエ サングラス 評判
from.本物 クロムハーツ 1クリップ ファンシーブレスレット 13リンク  2016/01/05 02:44
http://accabord.ca/qqMSPYNZJZ8?バレンシアガ 財布
from.ナイキ すうぇっと上下  2016/01/05 04:41
http://accabord.ca/qqEaPcCCQJ9バレンシアガ メンズ
from.アクアテラ ストライプ  2016/01/05 10:11
http://artandsoulbnb.com/8lTIEOGHBB2時計 部品屋
from.バッグ レディース りゅっく  2016/01/11 15:50
http://www.agrawest.com/5wXOOUPEbQ2モンクレール ダウン ブルガリア
from.ウブロ eta  2016/01/11 16:49
http://www.adamintegrated.ca/knLIQZYaQB1カレラ ワイン amazon
ZOSEL:Too much is as bad as too little...!! 자공(子貢)이 공자에게 "사(師:子張의 이름)와 상(商:子夏의 이름)은 어느 쪽이 어집니까?" 하고 묻자, 공자는 "사는 지나치고 상은 미치지 못한다"고 대답하였다. "그럼 사가 낫단 말씀입니까?" 하고 반문하자, 공자는 "지나친 것은 미치지 못한 것과 같다(過猶不及)"고 말하였다.
Too much is as bad as too little...!! 자공(子貢)이 공자에게 "사(師:子張의 이름)와 상(商:子夏의 이름)은 어느 쪽이 어집니까?" 하고 묻자, 공자는 "사는 지나치고 상은 미치지 못한다"고 대답하였다. "그럼 사가 낫단 말씀입니까?" 하고 반문하자, 공자는 "지나친 것은 미치지 못한 것과 같다(過猶不及)"고 말하였다.
전체 (209)
리눅스시스템 (92)
윈도우시스템 (16)
프로그램 (7)
네트워크시스템 (7)
최근관심 (1)
«   2024/05   »
      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  
  1. yeezyboost-350.co.uk  2021
    yeezyboost-350.co.uk
  2. 강남역 풀싸롱  2021
    강남역 풀싸롱
  3.   2021
  1. 2018/02 (1)
  2. 2017/03 (2)
  3. 2016/12 (2)