hadoop-1.0.4在ubuntu伪分布模式搭建

一、安装ubuntu,ip是192.168.1.34

二、配置环境变量

    1,下载 jdk1.6.0_45.tar.gz

    2,在opt目录下,mkdir software , 解压命令tar xzf jdk1.6.0_45.tar.gz(文件) 到/opt/software/目录下

    3,下载hadoop-1.0.4.tar.gz

    4,将hadoop-1.0.4.tar.gz解压到/opt/software/目录

    5,命令 vi (中间有空格)/etc/profile 在该文件的末尾如下代码:

         export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45

         export JRE_HOME=/usr/lib/jvm/jdk1.6.0_45/jre

         export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

         export HADOOP_HOME=/opt/software/hadoop-1.0.4

         export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin

         至此,按住Esc、shift、:、三个键,输入wq保存并退出,为了使得坏境变量生效,需要执行命令 source(中间有空              格)/etc/profile

     6,命令 java -version,输出 java -version "1.6.0_45"就ok

     7,命令 hadoop verison,输出 hadoop-1.0.4 就ok

     8,命令 cd /opt/software/hadoop1.0.4/conf 跳到conf目录,vi  hadoop-env.sh

         加入 export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45

三、配置SSH

       ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa

       cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

       ssh 192.168.1.34

四、配置三个文件

    vi core-site.xml  

         <configuration>

             <property>

                 <name>hadoop.tmp.dir</name>

                <value>/opt/software/hadoop-1.0.4</value>

            </property>

            <property>

                 <name>fs.default.name</name>

                <value>hdfs://192.168.1.34:9000</value>

            </property>

        </configuration>

        ======================================

        vi mapred-site.xml

        <configuration>

             <property>

                 <name>mapred.job.tarcker</name>

                <value>192.168.1.34:9001</value>

            </property>

        </configuration>

        =======================================

        vi hdfs-site.xml

        <configuration>

             <property>

                 <name>dfs.replication</name>

                <value>1</value>

            </property>

            <property>

                 <name>dfs.support.append</name>

                <value>true</value>

            </property>

             <property>

                 <name>dfs.support.append</name>

                <value>true</value>

            </property>

             <property>

                 <name>dfs.permissions</name>

                <value>false</value>

            </property>

        </configuration>

    8,vi /etc/hosts 加上

         (ip)192.168.1.34   lwj(域名)

    9,conf 目录下 vi slaves 加入 lwj  vi masters 加入 lwj

   10,给C:\windows\system32\drivers\etc\hosts  加入192.168.1.108      lwj

   10,格式化namenode  bin/hadoop namenode -format

   11,启动 bin/start-all.sh 停止 bin/stop-all.sh

   12,bin/hadoop dfsadmin -report

   13,浏览器地址栏输入http://192.168.1.34:50030/或者http://192.168.1.34:50070/检验


        


   

  


 

            

你可能感兴趣的:(hadoop-1.0.4在ubuntu伪分布模式搭建)