安装时选择软件包:

editor-两个VIM、base-SED、Net-OPENSSH、OPENSSL、libs-libintl3和libintl8

环境变量:

path=%JAVA_HOME%\bin;%JAVA_HOME%\jre6\bin;D:\Program Files\MySQL\MySQL Server 5.5\bin;D:\Program Files\Python2.;D:\Program Files\MongoDB\bin;D:\Program Files\TortoiseSVN\bin;%MAVEN_HOME%\bin;D:\cygwin64\bin;D:\cygwin64\usr\bin

CYGWIN=ntsec tty

然后开始安装,安装完开始启动sshd服务:

进入终端执行:

tree@treePC ~
$ 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/README.privsep.
*** 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: [] ntsec
*** Info: On Windows Server , 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 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 'lee**jan'.
*** 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!

OK,启动SSH:

配置无密码SSH:

在终端执行

tree@treePC ~/.ssh
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/tree/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/tree/.ssh/id_rsa.
Your public key has been saved in /home/tree/.ssh/id_rsa.pub.
The key fingerprint is:
a0:4c:cd::e4::6f:c4::::eb:d6::c9: tree@treePC
The key's randomart image is:
+--[ RSA ]----+
| .+= |
| .B + |
| +.O o . |
| o.+ = E |
| .o. So . |
| o ... + |
| . . . |
| |
| |
+-----------------+

将公钥加入公钥授权文件中:

tree@treePC ~/.ssh
$ pwd
/home/tree/.ssh tree@treePC ~/.ssh
$ ls
id_rsa id_rsa.pub tree@treePC ~/.ssh
$ cp id_rsa.pub authorized_keys tree@treePC ~/.ssh
$ ls
authorized_keys id_rsa id_rsa.pub

弄完之后重启cygWin,ssh localhost试试能不能连接。

如果报错,重启sshd服务。然后重启cygWin试试。

创建连接,将C盘的jdk链接进来:

tree@treePC ~
$ ln -s "/cygdrive/c/Program Files/Java/jdk1.6.0_43" "/usr/local/jdk"

配置文件:

hadoop-env.sh文件加上JDK

# The java implementation to use.  Required.
export JAVA_HOME=/usr/local/jdk

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>hadoop.tmp.dir</name>
<value>/hadoop-0.20.2/temp</value>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

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.name.dir</name>
<value>/hadoop-0.20.2/hdfs/name</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>/hadoop-0.20.2/hdfs/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>

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>
<property>
<name>mapred.local.dir</name>
<value>/hadoop-0.20.2/mapred</value>
</property>
</configuration>

配置完之后,格式化namenode:

tree@treePC /hadoop-0.20./bin
$ ./hadoop namenode -format
// :: INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = treePC/192.168.0.157
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 0.20.2
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010
************************************************************/
// :: INFO namenode.FSNamesystem: fsOwner=treepc\tree,None,root,Administrators,Users,HomeUsers,ora_dba
// :: INFO namenode.FSNamesystem: supergroup=supergroup
// :: INFO namenode.FSNamesystem: isPermissionEnabled=true
// :: INFO common.Storage: Image file of size saved in seconds.
// :: INFO common.Storage: Storage directory \hadoop-0.20.\hdfs\name has been successfully formatted.
// :: INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at treePC/192.168.0.157
************************************************************/

启动:

tree@treePC /hadoop-0.20./bin
$ ./start-all.sh
starting namenode, logging to /hadoop-0.20./bin/../logs/hadoop-tree-namenode-treePC.out
localhost: starting datanode, logging to /hadoop-0.20./bin/../logs/hadoop-tree-datanode-treePC.out
localhost: starting secondarynamenode, logging to /hadoop-0.20./bin/../logs/hadoop-tree-secondarynamenode-treePC.out
starting jobtracker, logging to /hadoop-0.20./bin/../logs/hadoop-tree-jobtracker-treePC.out
localhost: starting tasktracker, logging to /hadoop-0.20./bin/../logs/hadoop-tree-tasktracker-treePC.out

运行一个圆周率DEMO:

tree@treePC /hadoop-0.20./bin
$ ./hadoop jar ../hadoop-0.20.-examples.jar pi
Number of Maps =
Samples per Map =
Wrote input for Map #
Wrote input for Map #
Starting Job
// :: INFO mapred.FileInputFormat: Total input paths to process :
// :: INFO mapred.JobClient: Running job: job_201402281919_0001
// :: INFO mapred.JobClient: map % reduce %
// :: INFO mapred.JobClient: map % reduce %
// :: INFO mapred.JobClient: map % reduce %
// :: INFO mapred.JobClient: Job complete: job_201402281919_0001
// :: INFO mapred.JobClient: Counters:
// :: INFO mapred.JobClient: Job Counters
// :: INFO mapred.JobClient: Launched reduce tasks=
// :: INFO mapred.JobClient: Launched map tasks=
// :: INFO mapred.JobClient: Data-local map tasks=
// :: INFO mapred.JobClient: FileSystemCounters
// :: INFO mapred.JobClient: FILE_BYTES_READ=
// :: INFO mapred.JobClient: HDFS_BYTES_READ=
// :: INFO mapred.JobClient: FILE_BYTES_WRITTEN=
// :: INFO mapred.JobClient: HDFS_BYTES_WRITTEN=
// :: INFO mapred.JobClient: Map-Reduce Framework
// :: INFO mapred.JobClient: Reduce input groups=
// :: INFO mapred.JobClient: Combine output records=
// :: INFO mapred.JobClient: Map input records=
// :: INFO mapred.JobClient: Reduce shuffle bytes=
// :: INFO mapred.JobClient: Reduce output records=
// :: INFO mapred.JobClient: Spilled Records=
// :: INFO mapred.JobClient: Map output bytes=
// :: INFO mapred.JobClient: Map input bytes=
// :: INFO mapred.JobClient: Combine input records=
// :: INFO mapred.JobClient: Map output records=
// :: INFO mapred.JobClient: Reduce input records=
Job Finished in 24.927 seconds
Estimated value of Pi is 3.80000000000000000000

上浏览器看看:

mapreduce:

http://localhost:50030

HDFS:

http://localhost:50070

OK,运行成功就证明安装成功了。

cygwin下安装hadoop0.20的更多相关文章

  1. cygwin 下安装python MySQLdb

    cygwin 下安装python MySQLdb 1) cygwin 更新 运行 cygwin/setup-x86_64.exe a 输入mysql,选择下面的包安装: libmysqlclient- ...

  2. cygwin下安装软件

    cygwin下安装软件cygwin工具安装新的软件和常见的命令windows8.1下安装Cygwin并通过apt-cyg安装软件包Cygwin利用apt-cyg安装gcc.g++.make和gdb 首 ...

  3. Cygwin下安装vim后,vim中退格键无法正常使用

    问题描述: 在Cygwin中安装完vim后 进入vim,发现上下左右键和退格键都无法正常使用 问题分析: 首先考虑到的就是缺少vim的配置文件,首先查看/etc路径下是否有vim的配置文件 admin ...

  4. eclipse安装Hadoop-0.20.2插件

    因为在使用Hadoop-0.20.2这个古董,需要使用它自带的eclipse插件,而我最初安装的是现代的eclipse4.10.0. 在经历两天,以及以下种种尝试之后,均以失败告终: 1.网上找适合的 ...

  5. windows7 Cygwin 下安装 YouCompleteMe 插件

    原创文章,欢迎指正!转载请注明~ 从上周就开始想在cygwin上安装YouCompleteMe插件,按照GITHUB上的官方教程安装,由于自己的理解失误,一直搞不清是按照在windows上安装还是按照 ...

  6. cygwin下安装NCL

      1.安装cygwin 到cygwin官网https://www.cygwin.com/下载安装程序,setup-x86.exe,注意能下载这个安装程序, setup-x86_64.exe64位不支 ...

  7. cygwin下安装c语言开发环境

    1.到官网cygwin.com下载安装程序. 2.添加清华的cygwin镜像:https://mirrors.tuna.tsinghua.edu.cn/cygwin/ 3.在安装:vim,git,gc ...

  8. 在cygwin下安装ns2

    首先下载ns2.可以到sourceforge去下载最新的all-in-one版本2.31,url为http://sourceforge.net/project/showfiles.php?group_ ...

  9. cygwin下安装scws

    安装gcc和make命令 1.找到cygwin的etc目录中有一个名为passwd的文件.   2.用UE或记事本打开passwd这个文件,找到以下部分,把其中的windows用户名admin换成ro ...

随机推荐

  1. ubuntu mint 开机启动项管理

    使用工具 sysv-rc-conf,需要安装. 点击打开链接http://blog.chinaunix.net/uid-21516619-id-1825027.html

  2. (转)myrepo

    源作者主页:https://copr.fedoraproject.org/coprs/mosquito/myrepo/ 源作者github: https://github.com/1dot75cm/m ...

  3. CSS小注意(初级)

    前言 自己的前端技术相对后台来说要薄弱了很多,这一阵子在努力的学习中,添加样式这是最简单不过的东西了,但是今天我犯了一个错误,不知道大家是不是有时候也会忽略或者做同样的事情,我觉得很大部分人不会,废话 ...

  4. [转]Vim 复制粘贴探秘

    Vim作为最好用的文本编辑器之一,使用vim来编文档,写代码实在是很惬意的事情.每当学会了vim的一个新功能,就会很大地提高工作效率.有人使用vim几十年,还没有完全掌握vim的功能,这也说明了vim ...

  5. php提取背景图片

    preg_match_all('/background\s*-\s*+image\s*:\s*url\s*\("*([^"]*)"*\)/i', $content,$ma ...

  6. jinja2 宏的简单使用总结(macro)

    Table of Contents 1. 简介 2. 用法 3. 参数和变量 4. 注意事项 4.1. macro的变量只能为如下三种: 4.2. 和block的关系: 5. 参考文档 1 简介 ji ...

  7. python调用Moxa PCOMM Lite通过串口Ymodem协议发送文件

    本文采用python 2.7编写. 经过长期搜寻,终于找到了Moxa PCOMM Lite.调用PCOMM.DLL可以非常方便的通过串口的Xmodem.Ymodem.Zmodem等协议传输文件,而无需 ...

  8. 关于DPC和workitem的简单用法

    这个随笔是记录我半个月左右的时间,从想法到查资料请教,以及到实践的成果. 我想实现的是,隔定时时间写文件,本以为调用写的函数就可以实现了,结果各种BSOD,IRQL_NOT_LESS_OR_EQUAL ...

  9. C# 合并DLL, 合并DLL进入EXE 【转】

    使用方法非常简单 在项目属性窗口中,选择"生成事件",在"生成后事件命令行"下的文本框中输入 ilmerge /ndebug /t:dll /log c:/1/ ...

  10. django开发总结:

    一,关于setting目录中的“DEBUG” DEBUG=False 把DEBUG从True改成False后就会出现(必需指定404和500错语页面,如上图的目录结构)找不到页面的错误.原因是DEBU ...