最近在系统的学习hadoop
课程第一步是安装hadoop1.x,具体安装步骤如下:
一、系统安装
本文使用centos6.5安装,具体安装步骤省略
二、jdk安装
下载jdk1.7.0_51解压,在环境中
设置环境变量:
vi /etc/profile,添加如下行:
export JAVA_HOME=/usr/local/jdk1.7.0_51class="java" name="code">service iptables status service ip6tables status service iptables stop service ip6tables stop chkconfig iptables off chkconfig ip6tables off四,免密码登陆 设置使用免密码登陆方式
vi /etc/ssh/sshd_config RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys?将这三个部分的注释去掉,使用RSA验证方式
[hadoop@vm .ssh]$ pwd /export/home/hadoop/.ssh [hadoop@vm .ssh]$ ssh-keygen -t rsa Generating public/private rsa key pair. ...... [hadoop@vm .ssh]$ cp id_rsa.pub authorized_keys [hadoop@vm .ssh]$ ls authorized_keys id_rsa id_rsa.pub?修改hosts文件:
[hadoop@vm conf]$ more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.2.201 vm.master
192.168.2.202 vm.slave1
192.168.2.203 vm.slave2
?修改hostname[hadoop@vm etc]$ vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=vm.master?四,修改hadoop配置文件 monospace; font-size: 1em;"> [hadoop@vm conf]$ pwd /export/home/hadoop/hadoop-1.2.1/conf 修改core-site.xml?
[hadoop@vm conf]$ vi core-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>fs.default.name</name> <value>hdfs://localhost:9000</value> </property> </configuration>?修改hdfs-site.xml
[hadoop@vm conf]$ vi hdfs-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>dfs.replications</name> <value>1</value> </property> </configuration>?修改mapred-site.xml
[hadoop@vm conf]$ vi mapred-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>mapred.job.tracker</name> <value>localhost:9001</value> </property> </configuration>?设置JAVA_HOME