2013年3月20日水曜日

Virtual De Hadoop(CDH4) Part.1

事前準備

ゲストOSとしてCentOSがインストールされている状態にしておきます。

Windows7+vmwareの場合:

MacOS+Parallelsの場合:


Oracle JDKのインストール

Oracle社のサイトでJDKをダウンロードさせて頂きます。

JDK6をDownloadすることにします

「Accept License Agreement」を選択して、「jdk-6u43-linux-x64-rpm.bin」をクリックします

ダウンロードが始まるや否や、処理を一時停止させます。
ダウンロード一覧からダウンロード先のパスをコピーします。(図はchromeの場合)


wgetコマンドの後ろにコピーしたパスを貼付けて、jdkをダウンロードします
[root@hadoop /]# wget http://download.oracle.com/otn-pub/java/jdk/6u43-b01/jdk-6u43-linux-x64-rpm.bin?AuthParam=1234567890_abcdefgeaxxxxxxxxxxxx

tmpフォルダへ移動かつファイル名を変えます
[root@hadoop /]# mv jdk-6u43-linux-x64-rpm.bin?AuthParam=1234567890_abcdefgeaxxxxxxxxxxxx /tmp/jdk-6u43-linux-x64-rpm.bin

実行権限を与えて展開+インストールします
[root@hadoop /]# cd tmp
[root@hadoop tmp]# chmod +x jdk-6u43-linux-x64-rpm.bin 
[root@hadoop tmp]# ./jdk-6u43-linux-x64-rpm.bin 

JDKがインストールされたか確認します
[root@hadoop tmp]# rpm -qi jdk
Name        : jdk                          Relocations: /usr/java 
Version     : 1.6.0_43                          Vendor: Oracle and/or its affiliates.
Release     : fcs                           Build Date: 2013年03月01日 22時03分27秒
Install Date: 2013年03月20日 12時44分53秒      Build Host: jb6-lin-amd64.sfbay.sun.com
Group       : Development/Tools             Source RPM: jdk-1.6.0_43-fcs.src.rpm
Size        : 127075557                        License: Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. Also under other license(s) as shown at the Description field.
Signature   : (none)
Packager    : Java Software 
URL         : http://www.oracle.com/technetwork/java/javase/overview/index.html
Summary     : Java(TM) Platform Standard Edition Development Kit
Description :
The Java Platform Standard Edition Development Kit (JDK) includes both
the runtime environment (Java virtual machine, the Java platform classes
and supporting files) and development tools (compilers, debuggers,
tool libraries and other tools).

The JDK is a development environment for building applications, applets
and components that can be deployed with the Java Platform Standard
Edition Runtime Environment.

JAVA_HOMEのパスを通します
[root@hadoop /]# echo "export JAVA_HOME=/usr/java/default" >> /etc/bashrc
[root@hadoop /]# source /etc/bashrc
[root@hadoop /]# echo $JAVA_HOME
/usr/java/default

Hadoop(CDH4)インストールの事前準備

以下のサイトを読みつつ、CDH4のHadoop(2.0系)のレポジトリをインストールします
https://ccp.cloudera.com/display/CDH4DOC/CDH4+Installation
[root@hadoop tmp]# wget http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm

cloudera-cdhをインストールします
[root@hadoop tmp]# sh
Loaded plugins: fastestmirror, presto
Setting up Local Package Process
Examining cloudera-cdh-4-0.x86_64.rpm: cloudera-cdh-4-0.x86_64
Marking cloudera-cdh-4-0.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: centos.ustc.edu.cn
base                                                     | 3.7 kB     00:00
extras                                                   | 3.5 kB     00:00
updates                                                  | 3.5 kB     00:00
Not using downloaded repomd.xml because it is older than what we have:
  Current   : Tue Mar 19 05:14:29 2013
  Downloaded: Sat Mar  9 03:07:50 2013

...

Total size: 13 k
Installed size: 13 k

yes...
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : cloudera-cdh-4-0.x86_64                                      1/1
  Verifying  : cloudera-cdh-4-0.x86_64                                      1/1

Installed:
  cloudera-cdh.x86_64 0:4-0

Complete!

yumを更新
[root@hadoop tmp]# yum update yum
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: centos.ustc.edu.cn
cloudera-cdh4                                            |  951 B     00:00
cloudera-cdh4/primary                                    |  29 kB     00:00
cloudera-cdh4                                                             95/95
Setting up Update Process
No Packages marked for Update

yum で hadoopを検索します
[root@hadoop tmp]# yum search hadoop 
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: centos.ustc.edu.cn
============================= N/S Matched: hadoop ==============================
hadoop.x86_64 : Hadoop is a software platform for processing vast amounts of
              : data
hadoop-0.20-conf-pseudo.x86_64 : Hadoop installation in pseudo-distributed mode
...
  Name and summary matches only, use "search all" for everything.

Hadoop起動用のユーザとグループを作成します
[root@hadoop /]# groupadd -g 1000 hadoop
[root@hadoop /]# useradd -g hadoop -u 1000 hadoop
[root@hadoop /]# passwd hadoop

hadoopユーザに切り替えます
[root@hadoop /]# su hadoop
[hadoop@hadoop /]$ 


次回へ続く

0 件のコメント: