61581229 发表于 2015-5-14 13:06:09

win7下Cygwin搭建Hadoop开发环境(由于win7环境不同导致本文章并不一定适合所有的win7用户)



第一步:安装JDK
  略。
  

  

第二步:安装Cygwin
  官方网址:http://www.cygwin.com/下载setup.exe
  安装时选择相应的安装包:
  Base-->sed
  Editors-->vim
  Libs-->
  Net-->OpenSSH
  

  

第三步:配置Windows系统变量
  jdk安装:



JAVA_HOME=E:\Program Files\Java\jdk1.6.0_22
  path中添加 jdk,jre:



%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
  path中添加cygwinbin路径:



E:\Program Files\cygwin\bin;E:\Program Files\cygwin\usr\sbin;
  环境变量中-->新建变量-->CYGWIN-->对应的值为:ntsec tty
  

  

  

第四步:安装并配置sshd服务
  键入命令:



ssh-host-config
  本人第一次配置的时候没有成功,然后又卸载Cgywin(卸载cygwin,也不是一件容易的事情),卸载sshd服务,网上有的方法几乎都试过,总算迷迷糊糊就给设置好了。
  可参考一下文章:http://pwcrab.blog.163.com/blog/static/16990382220107267443810/ (Cygwin上安装、启动ssh服务失败、ssh localhost失败的解决方案)
  http://blog.iyunv.com/souichiro/article/details/6284172(如何在Cygwin中安装并配置SSH)
  http://blog.iyunv.com/cybercode/article/details/7080729(cygwin使用总结)
  http://blog.iyunv.com/woshizy/article/details/4139868   (在windows下安装SSH)
  注意:在安装ssh服务的时候仔细阅读,cygwin上的Info信息。



*** 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.
  
  win7下安装ssh服务,不是一路顺风的。
  我的win7安装ssh服务后的变化如下:
  

  具体什么原因,我也不是很清楚。
  最后记得,测试你的ssh服务是否安装成功。
  

  

第五步:配置Hadoop安装包
  下载Hadoop安装包
  修改配置文件:
           hadoop-env.sh



export JAVA_HOME=/cygdrive/E/Progra~1/Java/jdk1.6.0_22
注意:Program Files改为Progra~1否则 启动Hadoop的时候会报错。
           core-site.xml





fs.default.name
hdfs://localhost:9000


           hdfs-site.xml





dfs.replication
1


           mapred-site.xml





mapred.job.tracker
localhost:9001


  
  
  启动Hadoop
格式化HDFS文件系统:(执行此命令,必须进入hadoop的bin目录,而且hadoop的路径不能有空格,所以建议将hadoop安装在根目录)


  
   启动Hadoop守护进程:

  
  验证Hadoop是否启动:

  

历经千辛万苦,多少个不眠的日夜,多少人都劝我还是去Linux下,也曾经想放弃了,终于还是凭着坚强毅力,成功了。当然,这仅仅是第一步。
页: [1]
查看完整版本: win7下Cygwin搭建Hadoop开发环境(由于win7环境不同导致本文章并不一定适合所有的win7用户)