在Windows下利用cygwin仿unix环境安装配置Hadoop。
1、 所需软件
1.1、Cygwin
下载地址:http://www.cygwin.com/setup.exe
2、 安装
2.1、Cygwin安装说明见文章:http://www.zihou.me/2010/02/19/1506/
2.2、JDK的安装省略了
2.3、hadoop-0.20.1安装
将hadoop-0.20.1.tar.gz解压,解压后的目录如hadoop-0.20.1,假设是放在E盘:
E:\hadoop-0.20.1,修改conf/hadoop-env.sh文件,将export JAVA_HOME的值修改为你机上的jdk安装目录,比如/cygdrive/d/tools/jdk1.6.0_03,/cygdrive是Cygwin安装成功后系统的根目录
3、 安装和配置ssh
3.1、安装
在Cygwin的根目录下分别运行:
$ chmod +r /etc/group $ chmod +r /etc/passwd $ chmod +rwx /var $ ssh-host-config *** Info: Generating /etc/ssh_host_key *** Info: Generating /etc/ssh_host_rsa_key *** Info: Generating /etc/ssh_host_dsa_key *** Info: Creating default /etc/ssh_config file *** Info: Creating default /etc/sshd_config file *** Info: Privilege separation is set to yes by default since OpenSSH 3.3. *** Info: However, this requires a non-privileged account called 'sshd'. *** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep. *** Query: Should privilege separation be used? (yes/no) yes *** Info: Note that creating a new user requires that the current account have *** Info: Administrator privileges. Should this script attempt to create a *** Query: new local account 'sshd'? (yes/no) yes *** Info: Updating /etc/sshd_config file *** Info: Added ssh to C:\WINDOWS\system32\driversc\services *** Info: Creating default /etc/inetd.d/sshd-inetd file *** Info: Updated /etc/inetd.d/sshd-inetd *** Warning: The following functions require administrator privileges! *** Query: Do you want to install sshd as a service? *** Query: (Say "no" if it is already installed as a service) (yes/no) yes *** Query: Enter the value of CYGWIN for the daemon: [] cygwin (注:此处输入的cygwin可以是任意的) *** Info: The sshd service has been installed under the LocalSystem *** Info: account (also known as SYSTEM). To start the service now, call *** Info: `net start sshd' or `cygrunsrv -S sshd'. Otherwise, it *** Info: will start automatically after the next reboot. *** Info: Host configuration finished. Have fun!
在询问yes/no的地方,统一输入yes,sshd就安装好了。
3.2配置
3.2.1、启动sshd服务
net start sshd
CYGWIN sshd 服务正在启动
CYGWIN sshd 服务已经启动成功
3.2.3、建立ssh的通道
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
执行遍$ ssh localhost看看,如果没有问题,就说明sshd已经配置好了。
Hadoop单机环境配置 <转>
Hadoop 三台主机 集群搭建 详解 <转>