1、环境准备
vmware10
Centos6.5 32位版本JDK1.7linux32位版
Hadoop2.2.0版本
安装过程讲解:
字符界面安装centos6.5,网络设置为主机模式或者桥连接
配置静态ip 并测试能不能从主机ping的通虚拟机
使用secureCRT进行远程ssh登陆
配置etc/hosts 添加ip对应的主机名,比如192.168.17.2 master
安装ssh 客户端,通过修改本地yum源来进行,成功后重启服务
关闭防火墙 chkconfig
创建普通用户 hadoop(名字可自定义)
设置免密钥ssh登录(伪分布式其实可以省略)
Last login: Sat Nov 14 22:27:48 2015
root
[root@localhost ~]# root
-bash: root: command not found
[root@localhost ~]# ls
anaconda-ks.cfg install.log install.log.syslog
[root@localhost ~]# pwd
/root
[root@localhost ~]# cd
[root@localhost ~]# ls
anaconda-ks.cfg install.log install.log.syslog
[root@localhost ~]# cd ..
[root@localhost /]# ls
bin boot dev etc home lib lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
[root@localhost /]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:C3:A2:52
inet addr:192.168.157.2 Bcast:192.168.157.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec3:a252/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:123 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12204 (11.9 KiB) TX bytes:12733 (12.4 KiB)
Interrupt:19 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:688 (688.0 b) TX bytes:688 (688.0 b)
[root@localhost /]# ls
bin boot dev etc home lib lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
[root@localhost /]# cd etc
[root@localhost etc]# ls h*
host.conf hosts hosts.allow hosts.deny
[root@localhost etc]# vi hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.157.2 master
"hosts" 4L, 182C written
[root@localhost etc]# cat hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.157.2 master
[root@localhost etc]# useradd hadoop
[root@localhost etc]# passwd hadoop
Changing password for user hadoop.
New password:
Retype new password:
Sorry, passwords do not match.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost etc]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
[root@localhost etc]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@localhost etc]# chkconfig iptables --list
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost etc]# chkconfig iptables off
[root@localhost etc]# chkconfig iptables --list
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost etc]# rpm -qa | grep ssh
openssh-5.3p1-94.el6.i686
libssh2-1.4.2-1.el6.i686
openssh-server-5.3p1-94.el6.i686
[root@localhost etc]# cd yum.r*
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost yum.repos.d]# mkdir backup
[root@localhost yum.repos.d]# ls
backup CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost yum