hadoop 开发环境搭建

一,安装java环境

添加java环境变量

vi /etc/profile

# add by tank
export JAVA_HOME=/data/soft/jdk/jdk1.7.0_71
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

二,修改文件句柄数

vi  /etc/security/limits.conf

# add by tank

* soft nofile 65536
* hard nofile  65536

三,设置ssh无密码登录

参考:http://www.cnblogs.com/tankaixiong/p/4172942.html

四,安装hadoop 环境

这里用的是hadoop2.20版本

目录结构:

修改配置文件:

[[email protected] hadoop]$ vi core-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
  <property>
     <name>fs.default.name</name>
     <value>hdfs://192.168.149.128:9000</value>
  </property>
</configuration>

[[email protected] hadoop]$ vi hdfs-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
  <property>
      <name>dfs.namenode.name.dir</name>
      <value>file:/data/soft/hadoop/hadoop-2.2.0/hdfs/name</value>
        <final>true</final>
   </property>
   <property>
        <name>dfs.datanode.data.dir</name>
        <value>file:/data/soft/hadoop/hadoop-2.2.0/hdfs/data</value>
   </property>
</configuration>

文件必须已经存在

[[email protected] hadoop]$ vi mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
   <property>
     <name>mapred.job.tracker</name>
     <value>192.168.149.128:9001</value>
   </property>
</configuration>
~
~

注意上面一定要填Ip,不要填localhost,不然eclipse会连接不到!

启动:

sbin/start-all.sh

查看状态:

[[email protected] hadoop-2.2.0]$ jps
5402 NodeManager
24718 Jps
4885 NameNode
5155 SecondaryNameNode

5295 ResourceManager

总共有5个hadoop线程

访问地址查看:

http://192.168.149.128:50070/dfshealth.jsp

时间: 2024-10-25 06:20:22

hadoop 开发环境搭建的相关文章

Hadoop开发环境搭建 windows下Eclipse

Hadoop开发环境搭建 windows下Eclipse 下载Eclipse www.eclipse.org 解压. 下载Hadoop的Eclipse Plugin 将插件包放到eclipse的plugins目录下.重启eclipse. 下载hadoop的安装包 将下载的hadoop安装包,解压到任一目录,最好是英文且无空格目录. 配置eclipse Hadoop instllation directory:设置为hadoop安装包解压的目录. Window->open persperctive

Hadoop开发环境搭建(linux)

Hadoop开发环境搭建(linux) 零.安装xwindows apt-get install ubuntu-desktop 一.安装Eclipse 下载Eclipse,解压安装,例如安装到/usr/local,即/usr/local/eclipse 二.在eclipse上安装hadoop插件 1.下载hadoop插件 下载地址:http://pan.baidu.com/s/1mgiHFok 此zip文件包含了源码,我们使用使用编译好的jar即可,解压后,release文件夹中的hadoop.

hadoop开发环境搭建(1)

作为初学Hadoop的新手,搭建Hadoop开发环境花了我很大功夫.倒不是hadoop搭建复杂,由于hadoop本身是一个分布式.多jvm进程的运行环境,我们想达到能用eclipse进行代码跟踪调试目的,还真不是一般的费劲. 一边在网上向给位前辈学习,一边自己动手尝试,花了我整整一天的时间终于完成了,为了使自己好不太容易完成的成就,后续被轻易忘记,也为了帮助其他hadoop小白同类脱贫致富,花了一晚上总结了此篇博文,以兹鼓励. 一.准备篇 言归正传,首先是准备篇.这里我们需要准备不少东东: 1.

hadoop开发环境搭建

很早就听说hadoop,但项目中一直没怎么接触,今天终于下定决心,花了一天的时间,搭起了基本的开发环境,总结如下. 一.软件准备 jdk.hadoop软件包.eclipse软件包(linux版) 二.安装java 详见http://blog.csdn.net/tonytfjing/article/details/42167599 三.安装hadoop(单机伪分布式) 3.1创建hadoop用户 为hadoop创建一个专门的用户,具体如下: groupadd hadoopGroup //创建had

Hadoop开发环境搭建(不定时更新)

参考链接 hadoop家族.strom.spark.Linux.flume等jar包.安装包汇总下载(持续更新) http://www.aboutyun.com/thread-8178-1-1.html Win7中使用Eclipse连接虚拟机中的Ubuntu中的Hadoop2.4经验总结 http://www.aboutyun.com/thread-7784-1-1.html

Hadoop那些事儿(二)---MapReduce开发环境搭建

上一篇文章介绍了在ubuntu系统中安装Hadoop的伪分布式环境,这篇文章主要为MapReduce开发环境的搭建流程. 1.HDFS伪分布式配置 使用MapReduce时,如果需要与HDFS建立连接,及使用HDFS中的文件,还需要做一些配置. 首先进入Hadoop的安装目录 cd /usr/local/hadoop/hadoop2 在HDFS中创建用户目录 ./bin/hdfs dfs -mkdir -p /user/hadoop 创建input目录,并将./etc/hadoop中的xml文件

搭建基于MyEclipse的Hadoop开发环境

前面我们已经搭建了一个伪分布模式的Hadoop运行环境. 我们绝大多数都习惯在Eclipse或MyEclipse中做Java开发,本次随笔我就教大家如何搭建一个基于MyEclipse IDE的Hadoop开发环境. 闲话少说,走起! 第一步 安装MyEclipse的Hadoop插件 1 打开MyEclipse,查看是否已经安装过 window  ->  preferences 没有显示Hadoop Map/Reduce,所以说明是MyEclipse是没有安装过Eclipse的插件. 首先,确认你

(转)Hadoop Eclipse开发环境搭建

来源:http://www.cnblogs.com/justinzhang/p/4261851.html This document is from my evernote, when I was still at baidu, I have a complete hadoop development/Debug environment. But at that time, I was tired of writing blogs. It costs me two day’s spare tim

windows 7使用eclipse下hadoop应用开发环境搭建

因为一些缘故,这节内容到现在才写,其实弄hadoop有一段时间了,可以编写一些小程序了,今天来还是来说说环境的搭建.... 说明一下:这篇文章的步骤是接上一篇的hadoop文章的:http://blog.csdn.net/enson16855/article/details/37725771 ,如果不是按照上篇的方式安装hadoop,可能会有些错误~百度一下就能解决的哈~ 准备环境: 不用多说了,我用eclipse版本是最新JavaEE版本,叫什么LUA Kepler,本来是用Juno的,因为操