setup cluster -- configure hadoop


after above two step now we can configure our hadoop
at first we must install the "jdk" and then we can install hadoop
1. install jdk
    i use the command "sudo apt-get install openjdk-7-jdk"
    and you can down the new jdk package and install it
2. down the hadoop package  at below url
    http://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
    and you can search "hadoop releases" by google to find
3. install and configure the file
    (1 install it
    uncompress the package
    at the "Downloads" directory use the below commands
    "tar-vxzf hadoop-2.6.0.tar.gz -C /home/warrior/bigData"
    "cd /home/warrior/bigData"
    "mv hadoop-2.6.0 hadoop"
    (2 configure it 
    at first set the "/etc/profile"
    add the content 

點擊(此處)摺疊或打開

  1. export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
  2. export HADOOP_INSTALL=/home/warrior/bigData/hadoop
  3. export PATH=$PATH:$HADOOP_INSTALL/bin
  4. export PATH=$PATH:$HADOOP_INSTALL/sbin
  5. export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
  6. export HADOOP_COMMON_HOME=$HADOOP_INSTALL
  7. export HADOOP_HDFS_HOME=$HADOOP_INSTALL
  8. export YARN_HOME=$HADOOP_INSTALL
    (3 set the /home/warrior/bigData/hadoop/etc/hadoop/core-site.xml

點擊(此處)摺疊或打開

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  3. <!--
  4.   Licensed under the Apache License, Version 2.0 (the "License");
  5.   you may not use this file except in compliance with the License.
  6.   You may obtain a copy of the License at

  7.     http://www.apache.org/licenses/LICENSE-2.0

  8.   Unless required by applicable law or agreed to in writing, software
  9.   distributed under the License is distributed on an "AS IS" BASIS,
  10.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11.   See the License for the specific language governing permissions and
  12.   limitations under the License. See accompanying LICENSE file.
  13. -->

  14. <!-- Put site-specific property overrides in this file. -->

  15. <configuration>
  16.     /* path of HDFS */
  17.     <property>
  18.         <name>fs.defaultFS</name>
  19.     </property>
  20.     /* buffer size */
  21.     <property>
  22.         <name>fs.default.name</name>
  23.         <value>hdfs://warrior:9000</value>
  24.     </property>
  25.     /* temp folder */
  26.     <property>
  27.         <name>hadoop.tmp.dir</name>
  28.         <value>file:/home/warrior/tmp</value>
  29.         <description>Abase for other temporary directories.</description>
  30.     </property>


  31. </configuration>
    (4 set the /home/warrior/bigData/hadoop/etc/hadoop/yarn-site.xml

點擊(此處)摺疊或打開

  1. <?xml version="1.0"?>
  2. <!--
  3.   Licensed under the Apache License, Version 2.0 (the "License");
  4.   you may not use this file except in compliance with the License.
  5.   You may obtain a copy of the License at

  6.     http://www.apache.org/licenses/LICENSE-2.0

  7.   Unless required by applicable law or agreed to in writing, software
  8.   distributed under the License is distributed on an "AS IS" BASIS,
  9.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10.   See the License for the specific language governing permissions and
  11.   limitations under the License. See accompanying LICENSE file.
  12. -->
  13. <configuration>

  14. <!-- Site specific YARN configuration properties -->
  15.     <property>
  16.         <name>yarn.nodemanager.aux-services</name>
  17.         <value>mapreduce_shuffle</value>
  18.     </property>
  19.     
  20.     <property>
  21.         <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
  22.         <value>org.apache.hadoop.mapred.ShuffleHandler</value>
  23.     </property>
  24.     
  25.     <property>
  26.         <name>yarn.resourcemanager.address</name>
  27.         <value>warrior:8032</value>
  28.     </property>
  29.     <property>
  30.         <name>yarn.resourcemanager.scheduler.address</name>
  31.         <value>warrior:8030</value>
  32.     </property>
  33.     
  34.     <property>
  35.         <name>yarn.resourcemanager.resource-tracker.address</name>
  36.         <value>warrior:8031</value>
  37.     </property>
  38.     
  39.     <property>
  40.         <name>yarn.resourcemanager.admin.address</name>
  41.         <value>warrior:8033</value>
  42.     </property>
  43.     
  44.     <property>
  45.         <name>yarn.resourcemanager.webapp.address</name>
  46.         <value>warrior:8088</value>
  47.     </property>
  48. </configuration>
    (5 set the /home/warrior/bigData/hadoop/etc/hadoop/mapres-site.xml

點擊(此處)摺疊或打開

  1. <configuration>
  2.     <property>
  3.         <name>mapreduce.framework.name</name>
  4.         <value>yarn</value>
  5.     </property>
  6.     
  7.     <property>
  8.         <name>mapreduce.jobhistory.address</name>
  9.         <value>warrior:10020</value>
  10.     </property>

  11.     <property>
  12.         <name>mapred.job.tracker</name>
  13.         <value>warrior:10001</value>
  14.     </property>
  15.     
  16.     <property>
  17.         <name>mapreduce.jobhistory.webapp.address</name>
  18.         <value>warrior:19888</value>
  19.     </property>
  20. </configuration>
    (6 make directory "namenode" "datanode" at "/home/warrior/bigData/"
    and set the /home/warrior/bigData/hadoop/etc/hadoop/hdfs-site.xml

點擊(此處)摺疊或打開

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  3. <!--
  4.   Licensed under the Apache License, Version 2.0 (the "License");
  5.   you may not use this file except in compliance with the License.
  6.   You may obtain a copy of the License at

  7.     http://www.apache.org/licenses/LICENSE-2.0

  8.   Unless required by applicable law or agreed to in writing, software
  9.   distributed under the License is distributed on an "AS IS" BASIS,
  10.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11.   See the License for the specific language governing permissions and
  12.   limitations under the License. See accompanying LICENSE file.
  13. -->

  14. <!-- Put site-specific property overrides in this file. -->

  15. <configuration>
  16.     <property>
  17.         <name>dfs.namenode.secondary.http-address</name>
  18.         <value>warrior:9001</value>
  19.     </property>
  20.     
  21.     <property>
  22.         <name>dfs.namenode.name.dir</name>
  23.         <value>file:/home/warrior/bigData/hdfs//namenode</value>
  24.     </property>
  25.     
  26.     <property>
  27.         <name>dfs.datanode.data.dir</name>
  28.         <value>file:/home/warrior/bigData/hdfs//datanode</value>
  29.     </property>
  30.     
  31.     <property>
  32.         <name>dfs.replication</name>
  33.         <value>1</value>
  34.     </property>
  35.     
  36.     <property>
  37.         <name>dfs.webdfs.enabled</name>
  38.         <value>true</value>
  39.     </property>
  40. </configuration>
    (7 set the "master" and "slaves" 
    below is my set 
    set the /home/warrior/bigData/hadoop/etc/hadoop/master
    [email protected]
    set the /home/warrior/bigData/hadoop/etc/hadoop/slaves
    [email protected]
    [email protected]


4. scp the directory to all the other machines
    like at 10.0.2.10 to 10.0.2.20
    "scp /home/warrior/bigData/hadoop/  [email protected]:/home/warrior/bigData/hadoop/"
    to other like above
5. use below command test the hadoop cluster
    "./bin/hadoop namenode -format"
    "./sbin/start-all.sh"


閱讀(11) | 評論(0) | 轉發(0) |
評論熱議
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章