Download presentation
Presentation is loading. Please wait.
Published byMae O’Brien’ Modified over 8 years ago
1
下載 hadoop 1: http://www.apache.org/dyn/closer.cgi/hadoop/common/http://www.apache.org/dyn/closer.cgi/hadoop/common/ 安裝 jdk 1: sudo add-apt-repository ppa:webupd8team/java 2: sudo apt-get update 3: sudo apt-get install oracle-java7-installer 安裝套件 1: sudo apt-get install ssh 2: sudo apt-get install rsync
2
設定變數 1: vim ~/.bashrc 加入下面 export JAVA_HOME=/usr/lib/jvm/java-7-oracle export PATH=$PATH:$JAVA_HOME/bin:/home/jimmy/work/hadoop/bin 存完, 輸入以下指令生效 source ~/.bashrc 2: vim etc/hadoop/hadoop-env.sh 修改加入下面參數 export HADOOP_PREFIX=/home/jimmy/work/hadoop export JAVA_HOME=/usr/lib/jvm/java-7-oracle/ export HADOOP_COMMON_LIB_NATIVE_DIR=/home/jimmy/work/hadoop/lib/nativ e export HADOOP_OPTS="$HADOOP_OPTS - Djava.library.path=/home/jimmy/work/hadoop/lib/native"
3
修改設定檔 1: vim etc/hadoop/core-site.xml fs.defaultFS hdfs://localhost:9000 2: vim etc/hadoop/hdfs-site.xml dfs.replication 1
4
產生公 / 私鑰 1: ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 2: cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys 啟動 hadoop 1: bin/hdfs namenode –format 2:./sbin/start-all.sh ( 如果你看到以下錯誤 hadoop/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard 代表你沒設定 export HADOOP_COMMON_LIB_NATIVE_DIR=/home/jimmy/work/hadoop/lib/native) 3: 輸入 http://localhost:50070/ 確認 hadoop 起動 外部電腦連入觀看只要把 localhost 改成 IP 即可
5
4: 建立資料夾 (1): bin/hdfs dfs -mkdir /user (2): bin/hdfs dfs -mkdir /user/jimmy 5: 複製 xml 到 input (1): bin/hdfs dfs -put etc/hadoop input 6: run example hadoop jar share/hadoop/mapreduce/hadoop-mapreduce- examples-2.5.0.jar grep input output 'dfs[a-z.]+‘ 7: copy hdfs bin/hdfs dfs -get output output 8: cat output/* 9:./sbin/stop-all.sh
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.