(转载)Hadoop2.7.1配置
http://my.oschina.net/laigous/blog/478438
hadoop偽分布式搭建
????其實官網有比較詳實的說明,英語好的可以直接看官網,地址
????1、安裝JDK1.7
????????這個省略,官網顯示1.6可以,但是我用openjdk1.6出了異常,JDK1.6沒試,直接用了JDK1.7
? ? ? ? 配置好環境變量
????
?| 1 | vi?/etc/profile |
| 1 2 3 | export?JAVA_HOME=/usr/local/jdk1.7.0_79 export?CLASSPATH=.:$JAVE_HOME/lib.tools.jar export?PATH=$PATH:$JAVA_HOME/bin |
? ?添加完后執行命令使配置生效
?| 1 | source?/etc/profile |
? ? 2、安裝ssh、rsync,(以ubuntu為例)
? | 1 2 | ??$?sudo?apt-get?install?ssh ??$?sudo?apt-get?install?rsync |
????3、下載hadoop編譯包,鏡像地址(國內鏡像竟然比US的還慢,不能忍,注意2.7的編譯包為64位)
????查是32還是64位的辦法
?| 1 2 | cd?hadoop-2.7.0/lib/native file?libhadoop.so.1.0.0 |
| 1 | hadoop-2.7.0/lib/native/libhadoop.so.1.0.0:?ELF?64-bit?LSB?shared?object,?AMD?x86-64,?version?1?(SYSV),?not?stripped |
? ? 4、配置環境變量
????hadoop配置文件指定java路徑
????etc/hadoop/hadoop-env.sh
?| 1 | export?JAVA_HOME=/usr/local/jdk1.7.0_79 |
? 系統環境變量
?| 1 2 3 4 | export?HADOOP_HOME=/usr/local/hadoop-2.7.0 export?PATH=$PATH:$HADOOP_HOME/bin export?HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native export?HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib" |
? 后兩條不加會出現
You have loaded library /usr/hadoop/hadoop-2.7.0/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
? 添加完后執行命令使配置生效
?| 1 | source?/etc/profile |
? 執行命令查看是否成功
?| 1 | hadoop?version |
? ? 5、修改hadoop配置文件?
? ? ?etc/hadoop/core-site.xml:
?| 1 2 3 4 5 6 | <configuration> ????<property> ????????<name>fs.defaultFS</name> ????????<value>hdfs://localhost:9000</value> ????</property> </configuration> |
? ? ?etc/hadoop/hdfs-site.xml:
?| 1 2 3 4 5 6 | <configuration> ????<property> ????????<name>dfs.replication</name> ????????<value>1</value> ????</property> </configuration> |
? ? ?6、設置hadoop ssh無密碼訪問
?| 1 2 3 | ??$?ssh-keygen?-t?dsa?-P?''?-f?~/.ssh/id_dsa ??$?cat?~/.ssh/id_dsa.pub?>>?~/.ssh/authorized_keys ??$?export?HADOOP\_PREFIX=/usr/local/hadoop-2.7.0 |
? ? 7、格式化節點和啟動hadoop
?| 1 2 | $?bin/hdfs?namenode?-format $?sbin/start-dfs.sh |
? ? 打開瀏覽器?http://localhost:50070/看是否成功
? ? hdfs配置:username最好和當前用戶名相同,不然會可能出現權限問題
| 1 2 | ??$?bin/hdfs?dfs?-mkdir?/user ??$?bin/hdfs?dfs?-mkdir?/user/<username> |
? ? ?8、yarn配置
? ? ?etc/hadoop/mapred-site.xml:
?| 1 2 3 4 5 6 | <configuration> ????<property> ????????<name>mapreduce.framework.name</name> ????????<value>yarn</value> ????</property> </configuration> |
? ? etc/hadoop/yarn-site.xml:
?| 1 2 3 4 5 6 | <configuration> ????<property> ????????<name>yarn.nodemanager.aux-services</name> ????????<value>mapreduce_shuffle</value> ????</property> </configuration> |
? ? 啟動yarn
| 1 | $?sbin/start-yarn.sh |
? ??http://localhost:8088/查看是否成功
? ? 至此hadoop單節點偽分布式安裝配置完成
總結
以上是生活随笔為你收集整理的(转载)Hadoop2.7.1配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ubuntu15.10避免图形界面无法登
- 下一篇: ubuntu部署eclipse兼容性问题