[转帖]windows 下的hadoop的安装 ._Hadoop,ERP及大数据讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Hadoop,ERP及大数据讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3067 | 回复: 0   主题: [转帖]windows 下的hadoop的安装 .        下一篇 
jie.liang
注册用户
等级:少校
经验:1003
发帖:77
精华:0
注册:2013-10-11
状态:离线
发送短消息息给jie.liang 加好友    发送短消息息给jie.liang 发消息
发表于: IP:您无权察看 2013-10-17 17:14:47 | [全部帖] [楼主帖] 楼主

1、去网站下载最新的cygwin 版本http://cygwin.com/install.html

2、下载jdk6及以上版本。

3、下载hadoop的稳定版本。去官网上看。

好的,下载的东西就这么多了。下来开始安装。

一、cygwin的安装。

北京联动北方科技有限公司

按照图中说明选择下一步。

北京联动北方科技有限公司

需要说明的是:在Root Directory 中的目录,最好不要有空格。这里的路径选择为 D:\SoftInstallProgramFiles\cygwin

北京联动北方科技有限公司

在上图所示的对话框中,设置Cygwin安装包存放目录,然后点击“下一步”,进入如上图所示对话框:目录设置为:D:\SoftInstallProgramFiles\cygwin\download

北京联动北方科技有限公司

选择下一步。

北京联动北方科技有限公司

然后从上图的的链接中选择一个连接,开始下载。如果不行,就换下一个链接。

二、安装hadoop的过程。

需要注意的细节:

1、必须在cygwin中将对hadoop-1.2.1.tar.gz解压,模拟linux下文件解压(tar -zxf  hadoop-1.2.1.tar.gz)。解压后文件可以放入到cygwin/opt/中,opt文件夹是新建的(这个依照自己爱好)。

2、接下来,需要修改hadoop的配置文件,它们位于conf子目录下,分别是hadoop-env.sh、core-site.xml、hdfs-site.xml和mapred-site.xml共四个文件。
� 修改hadoop-env.sh
a 、只需要将JAVA_HOME修改成JDK的安装目录即可,请注意JDK必须是1.6或以上版本。

b、设置JDK的安装目录时,路径不能是windows风格的目录(d:\java\jdk1.6.0_13), 而是LINUX风格(/cygdrive/d/java/jdk1.6.0_13)。

在hadoop-env.sh中设定JDK的安装目录:export  JAVA_HOME=/cygdrive/d/java/jdk1.6.0_13
� 修改core-site.xml
为简化core-site.xml配置,将d:cygwin\opt\hadoop-1.2.1\src\core目录下的core-default.xml文件复制到d:cygwin\opt\hadoop-1.2.1\conf目录下,并将core-default.xml文件名改成core-site.xml。修改fs.default.name的值。

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/opt/tmp/hadoop-${user.name}</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
</configuration>


� 修改hdfs-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
</configuration>


� 修改mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
<description>The host and port that the MapReduce job tracker runs
at.  If "local", then jobs are run in-process as a single map
and reduce task.
</description>
</property>
<property>
<name>mapred.child.tmp</name>
<value>/opt/temp</value>
<description> To set the value of tmp directory for map and reduce tasks.
If the value is an absolute path, it is directly assigned. Otherwise, it is
prepended with task's working directory. The java tasks are executed with
option -Djava.io.tmpdir='the absolute path of the tmp dir'. Pipes and
streaming are set with environment variable,
TMPDIR='the absolute path of the tmp dir'
</description>
</property>
</configuration>


3、在执行./start-all.sh 前,最好执行 hadoop  namenode -format 。建立hadoop临时目录。在core-site.xml 的hadoop.tmp.dir已经指定。

4、成功开启后的标志是:有如下的五个java进程。分别对应:namenode jobtracker  datanode secondarynamenode  tasktracker。
如果启动不成功,请查看logs文件中的对应节点的相应错误。

查看某一个未启动,最直接的方法是执行:stop-all.sh查看。

北京联动北方科技有限公司

5、当然如果安装的路径中含有空格的时候,需要处理下,网上有对应的方法。因为linux 不能识别空格。

         这个过程耗费了我好长时间,苦于没有人指导,只能慢慢试,网上也没有很好的关于细节的一次性成功的教程。希望可以给其他人一点经验。




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论