Windows下安装Hadoop开发环境

来源:互联网 发布:遗传算法 优缺 编辑:程序博客网 时间:2024/04/27 14:47

Windows下安装Hadoop开发环境

准备:

1.Eclipse

2.Java 6+

3.Cygwin

4.Hadoop

1.安装Cygwin

通过链接下载http://cygwin.com/setup.exe,打开exe文件,

运行安装程序。 
1.显示 Cygwin 欢迎屏幕。
2.单击 Next 进入下一个屏幕,选择要执行的安装类型。
3.单击 Install from Internet。
4.单击 Next,然后选择一个安装目录。
5.安装时一定要确认选择“ openssh ”安装包。如下图:


通过使用 Start 菜单或双击 Cygwin 图标(如果添加了这些快捷方式的话),启动 Cygwin;也可以执行 Cygwin 目录中的 Cygwin 脚本(比如 C:\cygwin\Cygwin.bat)。

我在安装中遇到了一些问题,按照这篇文章重新安装了一遍就好了

http://wenku.baidu.com/view/45409fc289eb172ded63b775.html

2.安装SSH守护线程

Hadoop连接需要ssh

a.打开 Cygwin 命令环境(以管理员的身份运行)

b.执行以下命令
dell@dell-PC$ chmod +r /etc/group
dell@dell-PC$ chmod +r /etc/passwd
dell@dell-PC$ chmod +rwx /var
dell@dell-PC$ ssh-host-config


*** Query: Overwrite existing /etc/ssh_config file? (yes/no) yes
*** Info: Creating default /etc/ssh_config file
*** Query: Overwrite existing /etc/sshd_config file? (yes/no) yes
*** 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/READ                                                                                                            
*** Query: Should privilege separation be used? (yes/no) no
*** Info: Updating /etc/sshd_config file


*** 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: [] cyg_ssh
*** Info: On Windows Server 2003, Windows Vista, and above, the
*** Info: SYSTEM account cannot setuid to other users -- a capability
*** Info: sshd requires.  You need to have or to create a privileged
*** Info: account.  This script will help you do so.

*** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
*** Info: or later.  On these systems, it's not possible to use the LocalSystem
*** Info: account for services that can change the user id without an
*** Info: explicit password (such as passwordless logins [e.g. public key
*** Info: authentication] via sshd).

*** Info: If you want to enable that functionality, it's required to create
*** Info: a new account with special privileges (unless a similar account
*** Info: already exists). This account is then used to run these special
*** Info: servers.


*** Info: Note that creating a new user requires that the current account
*** Info: have Administrator privileges itself.

*** Info: No privileged account could be found.

*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will only be used by registered services.
*** Query: Do you want to use a different name? (yes/no) no
*** Query: Create new privileged user account 'cyg_server'? (yes/no) yes
*** Info: Please enter a password for new user cyg_server.  Please be sure
*** Info: that this password matches the password rules given on your system.
*** Info: Entering no password will exit the configuration.
*** Query: Please enter the password:
*** Query: Reenter:


*** Info: User 'cyg_server' has been created with password '1qaz2wsx'.
*** Info: If you change the password, please remember also to change the
*** Info: password for the installed services which use (or will soon use)
*** Info: the 'cyg_server' account.

*** Info: Also keep in mind that the user 'cyg_server' needs read permissions
*** Info: on all users' relevant files for the services running as 'cyg_server'.
*** Info: In particular, for the sshd server all users' .ssh/authorized_keys
*** Info: files must have appropriate permissions to allow public key
*** Info: authentication. (Re-)running ssh-user-config for each user will set
*** Info: these permissions correctly. [Similar restrictions apply, for
*** Info: instance, for .rhosts files if the rshd server is running, etc].

*** Info: The sshd service has been installed under the 'cyg_server'
*** Info: account.  To start the service now, call `net start sshd' or
*** Info: `cygrunsrv -S sshd'.  Otherwise, it will start automatically
*** Info: after the next reboot.

*** Info: Host configuration finished. Have fun!

d.运行net start sshd出现错误

cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error 1062:
The service has not been started.

很可能是/var/log的权限设置不正确。首先执行 mkpasswd 和 mkgroup 重新生成权限信息,再删除sshd服务,重新配置:

$ mkpasswd -l > /etc/passwd
$ mkgroup -l > /etc/group
$ cygrunsrv -R sshd
$ ssh-host-config -y
$ cygrunsrv -S sshd

然后发现正常启动了


接下来安装Hadoop

http://blog.csdn.net/savechina/article/details/5656937