最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Windows下安装hadoop2.7.4

运维笔记admin3浏览0评论

Windows下安装hadoop

案例环境

该压缩包是已经简化配置后的

hadoop2.7.4下载地址文件分享 (weiyun)

安装步骤

解压压缩包

配置环境变量

在系统变量中添加

在path中添加

拷贝hadoop2.7.4\bin\hadoop.dll到目录C:\Windows\System32

配置文件

把/etc/hadoop/ 下目录的相关配置文件都配置一遍,直接复值下面内容即可

①yarn-site.xml

<configuration>
<!-- Site specific YARN configuration properties -->
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
    <property>
        <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
        <value>org.apache.hadoop.mapred.ShuffleHandler</value>
    </property>

</configuration>

②hdfs-site.xml

<configuration>
    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
    <property>
        <name>dfs.namenode.name.dir</name>
        <value>file:/hadoop/data/dfs/namenode</value>
    </property>
    <property>
        <name>dfs.datanode.data.dir</name>
        <value>file:/hadoop/data/dfs/datanode</value>
    </property>
</configuration>

③core-site.xml

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
    </property>
</configuration>

4、复制一份mapred-site.xml.template,并重命名为mapred-site.xml,修改里面的内容

<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
</configuration>

选做:配置JAVA_HOME的路径变量到/etc/hadoop/hadoop-env.cmd

情况1:自己电脑的jdk和hadoop安装在同一磁盘 ,如果自己的电脑的环境变量中有JAVA_HOME且该变量配置正确可以跳过该步骤。

因为hadoop-env.cmd中已经引用了JAVA_HOME,无需再次配置

情况2:自己电脑的jdk和hadoop安装在同一磁盘,自己的电脑的环境变量没有JAVA_HOME

配置JAVA_HOME即可

提示:hadoop-env.cmd中内容无需修改


情况三:自己电脑的jdk和hadoop没有在同一磁盘

如何解决:将自己JAVA_HOME的绝对路径配置在hadoop-env.cmd即可

验证是否安装成功

输入hadoop version

hadoop格式化(只能格式化一次)

hdfs namenode -format

启动hadoop

在cmd中执行 start-all.cmd 命令,启动Hadoop,

查看是否启动成功

注意 Hadoop2.x的namenode界面默认访问端口默认是:50070,和3.x不同

打开浏览器输入http://localhost:50070/

jps命令查看进程

发布评论

评论列表(0)

  1. 暂无评论
ok 不同模板 switch ($forum['model']) { /*case '0': include _include(APP_PATH . 'view/htm/read.htm'); break;*/ default: include _include(theme_load('read', $fid)); break; } } break; case '10': // 主题外链 / thread external link http_location(htmlspecialchars_decode(trim($thread['description']))); break; case '11': // 单页 / single page $attachlist = array(); $imagelist = array(); $thread['filelist'] = array(); $threadlist = NULL; $thread['files'] > 0 and list($attachlist, $imagelist, $thread['filelist']) = well_attach_find_by_tid($tid); $data = data_read_cache($tid); empty($data) and message(-1, lang('data_malformation')); $tidlist = $forum['threads'] ? page_find_by_fid($fid, $page, $pagesize) : NULL; if ($tidlist) { $tidarr = arrlist_values($tidlist, 'tid'); $threadlist = well_thread_find($tidarr, $pagesize); // 按之前tidlist排序 $threadlist = array2_sort_key($threadlist, $tidlist, 'tid'); } $allowpost = forum_access_user($fid, $gid, 'allowpost'); $allowupdate = forum_access_mod($fid, $gid, 'allowupdate'); $allowdelete = forum_access_mod($fid, $gid, 'allowdelete'); $access = array('allowpost' => $allowpost, 'allowupdate' => $allowupdate, 'allowdelete' => $allowdelete); $header['title'] = $thread['subject']; $header['mobile_link'] = $thread['url']; $header['keywords'] = $thread['keyword'] ? $thread['keyword'] : $thread['subject']; $header['description'] = $thread['description'] ? $thread['description'] : $thread['brief']; $_SESSION['fid'] = $fid; if ($ajax) { empty($conf['api_on']) and message(0, lang('closed')); $apilist['header'] = $header; $apilist['extra'] = $extra; $apilist['access'] = $access; $apilist['thread'] = well_thread_safe_info($thread); $apilist['thread_data'] = $data; $apilist['forum'] = $forum; $apilist['imagelist'] = $imagelist; $apilist['filelist'] = $thread['filelist']; $apilist['threadlist'] = $threadlist; message(0, $apilist); } else { include _include(theme_load('single_page', $fid)); } break; default: message(-1, lang('data_malformation')); break; } ?>