分享

Centos6.5下Hadoop2.5.1环境搭建完整命令

math2008 发表于 2014-11-20 16:14:04 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 10702
uname -a
who
top
修改主机名称
gedit /etc/sysconfig/network
service network restart
-----------------------------------------------------------------------
yum install java
--------------------------------------------------------------------
[root@Datanode Desktop]# java -version
java version "1.7.0_71"
OpenJDK Runtime Environment (rhel-2.5.3.1.el6-x86_64 u71-b14)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
---------------------------------------------------------
[root@Datanode Desktop]# rpm -qa | grep java
tzdata-java-2014j-1.el6.noarch
java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el6.x86_64
--------------------------------------------------------------------------
[root@Datanode Desktop]#  rpm -e --nodeps tzdata-java-2014j-1.el6.noarch
[root@Datanode Desktop]#  rpm -e --nodeps java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el6.x86_64
                          rpm -ivh jdk-7u67-linux-x64.rpm
-------------------------------------------------------------------------------------------
[root@Datanode local]# java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
-------------------------------------------------------------------------
[root@Datanode Desktop]# gedit /etc/profile
#set java home moweiadd
export JAVA_HOME=/usr/java/latest
export JRE_HOME=/usr/java/latest/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
[root@Datanode Desktop]# source /etc/profile
[root@Datanode Desktop]# java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
[root@Datanode Desktop]# echo $JAVA_HOME
/usr/java/latest
--------------------------------------------------------------------------------------
[root@Namenode Desktop]# ifconfig
eth2      Link encap:Ethernet  HWaddr 00:0C:29:4A:DB:28  
          inet addr:192.168.133.136  Bcast:192.168.133.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe4a:db28/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12309 (12.0 KiB)  TX bytes:2177 (2.1 KiB)
[root@Datanode ~]# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:0C:29:7D:C9:4A  
          inet addr:192.168.133.135  Bcast:192.168.133.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe7d:c94a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:101 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:18449 (18.0 KiB)  TX bytes:2711 (2.6 KiB)
[root@Namenode Desktop]# ping 192.168.133.135
PING 192.168.133.135 (192.168.133.135) 56(84) bytes of data.
64 bytes from 192.168.133.135: icmp_seq=1 ttl=64 time=4.46 ms
64 bytes from 192.168.133.135: icmp_seq=2 ttl=64 time=1.17 ms
64 bytes from 192.168.133.135: icmp_seq=3 ttl=64 time=0.519 ms
----------------------------------------------------------------------------
[root@Namenode Desktop]# ssh-keygen -t rsa
[root@Namenode Desktop]# cd /root/.ssh
[root@Namenode .ssh]# cat id_rsa.pub > authorized_keys
[root@Namenode .ssh]# ssh localhost
The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is 61:d1:a4:d7:7f:c0:1a:15:3a:e0:68:14:7d:00:7a:8e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
[root@Namenode ~]# ssh localhost
Last login: Wed Nov 19 20:39:00 2014 from localhost
**********************************************************
[root@Namenode ~]# cd .ssh
[root@Namenode .ssh]# ls
authorized_keys  id_rsa  id_rsa.pub  known_hosts
[root@Namenode .ssh]# scp authorized_keys root@192.168.133.135:/root/.ssh
root@192.168.133.135's password:
authorized_keys                           
[root@localhost .ssh]# scp authorized_keys root@192.168.133.135:/root/.ssh/
--------------------------------------------------------------------------------
[root@Datanode Desktop]# cd /usr
[root@Datanode usr]# ls
bin  games                include  lib    libexec  sbin   src
etc  hadoop-2.5.1.tar.gz  java     lib64  local    share  tmp
[root@Datanode usr]# scp hadoop-2.5.1.tar.gz root@192.168.133.136:/usr/
root@192.168.133.136's password:
hadoop-2.5.1.tar.gz                           100%   73MB   4.3MB/s   00:17   
[root@Datanode usr]#
cd /usr #进入"/usr"目录
    tar –zxvf hadoop-2.5.1.tar.gz #解压hadoop-2.5.1.tar.gz安装包
    mv hadoop-2.5.1 hadoop #将hadoop-2.5.1文件夹重命名hadoop
    rm –rf hadoop-2.5.1.tar.gz  #删除安装包
然后把Hadoop的安装路径添加到"/etc/profile"中,将以下语句添加到末尾,并使其有效:
# set hadoop path
export HADOOP_HOME=/usr/hadoop
export PATH=$PATH :$HADOOP_HOME/bin
#######################etc/hadoop/core-site.xml###################################################
<configuration>
<property>
      <name>hadoop.tmp.dir</name>
      <value>/usr/hadoop/tmp</value>
      <description>A base for other temporary directories.</description>
  </property>
<!--file system properties-->
  <property>
      <name>fs.defaultFS</name>
      <value>hdfs://192.168.133.136:9000</value>
  </property>
  <property>  
        <name>io.file.buffer.size</name>  
        <value>4096</value>  
    </property>  
</configuration>
###################etc/hadoop/hdfs-site.xmlm############################################
<configuration>
<property>
        <name>dfs.namenode.name.dir</name>
        <value>/usr/hadoop/hdfs/name</value>
    </property>
    <property>
        <name>dfs.datanode.data.dir</name>
        <value>/usr/hadoop/hdfs/data</value>
    </property>
    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
</configuration>
-----------------------------------------------------------------------------------------------

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条