安裝配置
一、軟件下載
JDK下載:jdk-7u65-linux-i586.tar.gzhtml
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.htmljava
Hadoop下載:hadoop-2.4.1.tar.gznode
http://www.apache.org/dyn/closer.cgi/hadoop/common/linux
二、/etc/hosts配置
- 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
- ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
-
- <strong><span style="color:#ff0000;">192.168.1.2 Master.Hadoop
- 192.168.1.3 Slave1.Hadoop</span></strong>
三、/etc/profile配置
- export JAVA_HOME=/usr/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0
- export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
- export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
-
- export HADOOP_HOME=/usr/hadoop
- export HADOOP_HOME_WARN_SUPPRESS=1
- export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
四、~/etc/hadoop/core-site.xml配置
- <configuration>
-
- <property>
- <name>fs.defaultFS</name>
- <value>hdfs://Master.Hadoop:9000</value>
- <description>
- Where to find the Hadoop Filesystem through the network.
- Note 9000 is not the default port.
- (This is slightly changed from previous versions which didnt have "hdfs")
- </description>
- </property>
-
- <property>
- <name>hadoop.tmp.dir</name>
- <value>/usr/hadoop/tmp</value>
- </property>
-
- </configuration>
五、~/etc/hadoop/mapred-site.xml配置
- <configuration>
- <property>
- <name>mapreduce.framework.name</name>
- <value>yarn</value>
- </property>
- </configuration>
六、etc/hadoop/yarn-site.xml配置
- <configuration>
-
- <property>
- <name>yarn.resourcemanager.scheduler.address</name>
- <value>Master.Hadoop:8030</value>
- </property>
-
- <property>
- <name>yarn.resourcemanager.resource-tracker.address</name>
- <value>Master.Hadoop:8031</value>
- </property>
-
- <property>
- <name>yarn.resourcemanager.address</name>
- <value>Master.Hadoop:8032</value>
- </property>
-
- <property>
- <name>yarn.resourcemanager.admin.address</name>
- <value>Master.Hadoop:8033</value>
- </property>
-
- <property>
- <name>yarn.resourcemanager.webapp.address</name>
- <value>Master.Hadoop:8088</value>
- </property>
-
- <property>
- <name>yarn.resourcemanager.webapp.https.address</name>
- <value>Master.Hadoop:8090</value>
- </property>
-
- <property>
- <name>yarn.nodemanager.local-dirs</name>
- <value>${hadoop.tmp.dir}/nodemanager/local</value>
- <description>the local directories used by the nodemanager</description>
- </property>
-
- <property>
- <name>yarn.nodemanager.remote-app-log-dir</name>
- <value>${hadoop.tmp.dir}/nodemanager/remote</value>
- <description>directory on hdfs where the application logs are moved to </description>
- </property>
-
- <property>
- <name>yarn.nodemanager.log-dirs</name>
- <value>${hadoop.tmp.dir}/nodemanager/logs</value>
- <description>the directories used by Nodemanagers as log directories</description>
- </property>
-
- <property>
- <name>yarn.nodemanager.aux-services</name>
- <value>mapreduce_shuffle</value>
- <description>shuffle service that needs to be set for Map Reduce to run </description>
- </property>
-
- <property>
- <name>mapreduce.jobhistory.address</name>
- <value>Master.Hadoop:10020</value>
- </property>
-
- <property>
- <name>mapreduce.jobhistory.webapp.address</name>
- <value>Master.Hadoop:19888</value>
- </property>
-
- </configuration>
七、~/etc/hadoop/hdfs-site.xml配置
- <configuration>
-
- <property>
- <name>dfs.permissions.superusergroup</name>
- <value>root</value>
- </property>
-
- <property>
- <name>dfs.replication</name>
- <value>1</value>
- </property>
-
- </configuration>
啓動與驗證
一、格式化HDFS文件系統
hadoop namenode -formatweb
二、啓動Hadoop
啓動前關閉集羣中全部機器的防火牆apache
service iptables stoporacle
啓動命令app
start-all.shdom
三、驗證Hadoop
方式一:jpswebapp
方式二:hadoop dfsadmin -report
ZOOM 雲視頻會議網站:http://www.zoomonline.cn/