影片中共用到兩台Ubuntu VM,
- HNClient:Ubuntu Desktop環境,安裝xrdp套件
- HNName:Ununtu 12.04.2 LTS (x86_64), ip:192.168.0.20
首先從 HNClient,open an terminal,安裝openssh-server
- HNClient:~$sudo apt-get install openssh-server
從client連到server,
- HNClient:~$ssh hnname
- @HNName:~$ssh-keygen
- @HNName:~$ssh localhost
接著將public key匯入後,再次連到本機,這時應該直接登入成功,不會要求密碼
將public key匯入client vm,測試連到client,應該也不需要密碼- @HNName:~$cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- @HNName:~$ssh localhost (it should be no password enter needed)
- @HNName:~$ssh-copy-id -i ~/.ssh/id_rsa.pub nuggetuser@hnclient
- @HNName:~$ssh hnclient (it should be no password enter needed)
- @HNName:~$sudo apt-get install openjdk-7-jdk
- Installing Java 7 SE:
- sudo add-apt-repository ppa:webupd8team/java
- sudo apt-get update
- sudo apt-get install oracle-java7-installer
安裝完成後,確認Java的版本
- @HNName:~$java -version
打開browser,連到Apache Hadoop的下載網頁,複製檔案下載的連結。
- @HNName:~$wget http://mirrors......./hadooop-1.2.0-bin.tar.gz
- @HNName:~$tar -zxvf hadooop-1.2.0-bin.tar.gz
- @HNName:~$sudo cp -r hadoop-1.2.0 /usr/local/hadoop
設定PATH變數,將
export HADOOP_PREFIX=/usr/local/hadoop
export PATH=$PATH:$HADOOP_PREFIX/bin
export PATH=$PATH:$HADOOP_PREFIX/bin
加到檔案的後面
- @HNName:~$sudo vi $HOME/.bashrc
- @HNName:~$exec bash
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true
加到檔案的後面
- @HNName:~$sudo vi /usr/local/hadoop/conf/hadoop-env.sh
視頻上顯示系統取消IPv6的支援方法
- Disable IPv6 system wide:
- sudo vi /etc/sysctl.conf
- net.ipv6.conf.all.disable_ipv6=1
- net.ipv6.conf.default.disable_ipv6=1
- net.ipv6.conf.io.disable_ipv6=1
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://HNName:10001</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/hadoop/tmp</value>
</property>
</configuration>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://HNName:10001</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/hadoop/tmp</value>
</property>
</configuration>
- @HNName:~$sudo vi /usr/local/hadoop/conf/core-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>HNName:10002</value>
</property>
<name>mapred.job.tracker</name>
<value>HNName:10002</value>
</property>
- @HNName:~$sudo vi /usr/local/hadoop/conf/mapred-site.xml
建立目錄
- @HNName:~$sudo mkdir /usr/local/hadoop/tmp
- @HNName:~$sudo chown nugetuser /usr/local/hadooop/tmp
格式化Namenode
- @HNName:~$hadoop namenode -formate
啟動Hadoop
- @HNName:~$start-all.sh
確認Hadoop是否正常運作
- @HNName:~$jps
.....(make sure hadoop is running)
.....
.....
結束Hadoop
- @HNName:~$stop-all.sh
利用brower,檢查Hadoop系統狀態
- http://ip(or hostname):50070 <<-- check namenode status
- http://ip(or hostname):50030 <<-- check jobtracker status
- http://ip(or hostname):50060 <<-- check tasktracker status
沒有留言:
張貼留言