Hadoop搭建
1、安裝虛擬機
VMware workstation
CentOS 鏡像
安裝Linux虛擬機:(在Win7上)
1)安裝VMwareWorkstations(可修改配置)
2)添加CentOS鏡像(啟動安裝 ->配置網路)
網路配置:NAT模式
網路重啟:service network restart
關閉系統:shutdown -h now
2、遠程連接
Xshell5
Xftp5
3、在Linux上搭建Hadoop集群
下載軟體
1. Jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Hadoop包:http://apache.fayea.com/hadoop/common/hadoop-2.7.2/
步驟:
1、修改/etc/hosts
2、配置JDK
安裝:rpm -ivh jdk-8u101-linux-x64.rpm
vi /etc/profileJAVA_HOMEsource /etc/profilejava -version
3、配置SSH(免密碼登錄)
ssh-keygen -t rsacat xxx.pub >> authorized_keyschmod 644 authorized_keysssh IP/HOSTNAME
4、安裝及配置Hadoop
tar zxf hadoop-2.7.2.tar.gzcd /opt/hadoop-2.7.2/etc/hadoop/
core-site.xml
<property> <name>fs.default.name</name> <value>hdfs://bigdata:9000</value> </property> <property> <name>hadoop.tmp.dir</name> <value>/opt/hadoop-2.7.2/current/tmp</value> </property> <property> <name>fs.trash.interval</name> <value>4320</value> </property>
hdfs-site.xml
<property> <name>dfs.namenode.name.dir</name> <value>/opt/hadoop-2.7.2/current/dfs/name</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>/opt/hadoop-2.7.2/current/data</value> </property> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.webhdfs.enabled</name> <value>true</value> </property> <property> <name>dfs.permissions.superusergroup</name> <value>staff</value> </property> <property> <name>dfs.permissions.enabled</name> <value>false</value> </property>
yarn-site.xml
<property> <name>yarn.resourcemanager.hostname</name> <value>bigdata</value> </property> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <property> <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name> <value>org.apache.hadoop.mapred.ShuffleHandler</value> </property> <property> <name>yarn.resourcemanager.address</name> <value>bigdata:18040</value> </property><property> <name>yarn.resourcemanager.scheduler.address</name> <value>bigdata:18030</value> </property> <property> <name>yarn.resourcemanager.resource-tracker.address</name> <value>bigdata:18025</value> </property> <property> <name>yarn.resourcemanager.admin.address</name> <value>bigdata:18141</value> </property><property> <name>yarn.resourcemanager.webapp.address</name> <value>bigdata:18088</value> </property><property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property><property> <name>yarn.log-aggregation.retain-seconds</name> <value>86400</value> </property><property> <name>yarn.log-aggregation.retain-check-interval-seconds</name> <value>86400</value> </property><property> <name>yarn.nodemanager.remote-app-log-dir</name> <value>/tmp/logs</value> </property><property> <name>yarn.nodemanager.remote-app-log-dir-suffix</name> <value>logs</value> </property>
mapred-site.xml
<property> <name>mapreduce.framework.name</name> <value>yarn</value></property><property> <name>mapreduce.jobtracker.http.address</name> <value>bigdata:50030</value></property><property> <name>mapreduce.jobhisotry.address</name> <value>bigdata:10020</value></property><property> <name>mapreduce.jobhistory.webapp.address</name> <value>bigdata:19888</value></property><property> <name>mapreduce.jobhistory.done-dir</name> <value>/jobhistory/done</value></property><property> <name>mapreduce.intermediate-done-dir</name> <value>/jobhisotry/done_intermediate</value></property><property> <name>mapreduce.job.ubertask.enable</name> <value>true</value></property>
slaves
bigdata
hadoop-env.sh
JAVA_HOME
5、格式化HDFS
hdfs namenode -format
『16/09/0403:07:30 INFO common.Storage: Storage directory /opt/hadoop-2.7.2/current/dfs/namehas been successfully formatted.』
6、啟動Hadoop集群
/opt/hadoop-2.7.2/sbin/start-all.sh
7、驗證Hadoop集群
1)jps
2)
關閉防火牆 或者 在防火牆的規則中開放這些埠
hdfs http://bigdata:50070
yarn http://bigdata:18088
推薦閱讀:
※五分鐘深入 Hadoop 內核
※大數據,hadoop,spark,mahout的學習路線和需要的基礎知識,以及掌握到什麼程度?
※第六章:Hadoop運行環境搭建
※eclipse中,如何導入hadoop2.6.0的源碼?請大神給出詳細步驟?
※從頭學習大數據培訓課程 hadoop 分散式計算框架(十一)mapreducer 編程,任務工作鏈高級運行方法
TAG:Hadoop |