一,安装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版本
目录结构:
修改配置文件:
[tank@192 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>hadoop.tmp.dir</name>

<value>/usr/hadoop/tmp</value>

备注:请先在 /usr/hadoop 目录下建立 tmp 文件夹)

<description>A base for other temporary directories.</description>

</property>

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

备注:如没有配置hadoop.tmp.dir参数,此时系统默认的临时目录为:/tmp/hadoo-hadoop。而这个目录在每次重启后都会被干掉,必须重新执行format才行,否则会出错。
 
[tank@192 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>

 
文件必须已经存在
 
[tank@192 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会连接不到!
 
 bin/hadoop namenode -format //格式化
启动:
sbin/start-all.sh
 
查看状态:

[tank@192 hadoop-2.2.0]$ jps
10680 ResourceManager //yarn
10784 NodeManager
10350 DataNode
10254 NameNode
10527 SecondaryNameNode

 
总共有5个hadoop线程 
 
访问地址查看:
http://192.168.149.128:50070/dfshealth.jsp
 
 
 

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

  1. Hadoop开发环境搭建

    hadoop是一个分布式系统基础架构,由Apache基金会所开发. 用户可以在不了解分布式底层细节的情况下,开发分布式程序.充分利用集群的威力高速运算和存储.   Hadoop实现了一个分布式文件系统 ...

  2. VSCode+Maven+Hadoop开发环境搭建

    在Maven插件的帮助下,VSCode写Java其实非常方便.这一讲我们介绍如何借助maven用VScode搭建Hadoop开发环境. 1.Java环境安装 首先我们需要搭建好Java开发环境.我们需 ...

  3. Hadoop 系列(四)—— Hadoop 开发环境搭建

    一.前置条件 Hadoop 的运行依赖 JDK,需要预先安装,安装步骤见: Linux 下 JDK 的安装 二.配置免密登录 Hadoop 组件之间需要基于 SSH 进行通讯. 2.1 配置映射 配置 ...

  4. hadoop2.2.0 单机伪分布式(含64位hadoop编译) 及 eclipse hadoop开发环境搭建

    hadoop中文镜像地址:http://mirrors.hust.edu.cn/apache/hadoop/core/hadoop-2.2.0/ 第一步,下载 wget 'http://archive ...

  5. 基于Eclipse搭建hadoop开发环境

    一.基础环境准备 1.Eclipse 下载地址:http://pan.baidu.com/s/1slArxAP 2.JDK1.8  下载地址:http://pan.baidu.com/s/1i5iNy ...

  6. Linux下搭建hadoop开发环境-超详细

    先决条件:开发机器需要联网 已安装java 已安装Desktop组 1.上传安装软件到linux上: 2.安装maven,用于管理项目依赖包:以hadoop用户安装apache-maven-3.0.5 ...

  7. Win7+Eclipse+Hadoop2.6.4开发环境搭建

    Hadoop开发环境搭建 感谢参考网站:http://www.cnblogs.com/huligong1234/p/4137133.html 一.软件准备 JDK:jdk-7u80-windows-x ...

  8. Mac OS X上搭建伪分布式CDH版本Hadoop开发环境

    最近在研究数据挖掘相关的东西,在本地 Mac 环境搭建了一套伪分布式的 hadoop 开发环境,采用CDH发行版本,省时省心. 参考来源 How-to: Install CDH on Mac OSX ...

  9. Windows下搭建Spark+Hadoop开发环境

    Windows下搭建Spark+Hadoop开发环境需要一些工具支持. 只需要确保您的电脑已装好Java环境,那么就可以开始了. 一. 准备工作 1. 下载Hadoop2.7.1版本(写Spark和H ...

随机推荐

  1. Codeforces1037F Maximum Reduction 【单调栈】

    题目分析: 没啥好说的,会单调栈就会做. 代码: #include<bits/stdc++.h> using namespace std; ; ; int n,k; int pre[max ...

  2. 异步、+回调机制、线程queue、线程Event、协程、单线程实现遇到IO切换

    # from concurrent.futures import ProcessPoolExecutor,ThreadPoolExecutor # import requests # import o ...

  3. 个人整理的数组splay板子,指针的写的太丑了就不放了。。

    splay的板子.. 由于被LCT榨干了..所以昨天去学了数组版的splay,现在整理一下板子.. 以BZOJ3224和3223为例题..暂时只有这些,序列的话等有时间把维修序列给弄上来!! BZOJ ...

  4. Codeforces191 C. Fools and Roads

    传送门:>Here< 题意:给出一颗树,和K次操作.每次操作给出a,b,代表从a到b的路径上所有边的权值都+1(边权最开始全部为0).最后依次输出每条边最终的权值 解题思路: 由于n非常大 ...

  5. python中的map函数

    def f(x): return x * x """将一个全是数字的list变成平方形式""" def f2(): ls = [1, 2, ...

  6. lemon special judge模板

    /* argv[1]:输入文件 argv[2]:选手输出文件 argv[3]:标准输出文件 argv[4]:单个测试点分值 argv[5]:输出最终得分的文件 argv[6]:输出错误报告的文件 */ ...

  7. Install Nagios (Agent) nrpe client and plugins in Ubuntu/Debian

    安装apt-get install nagios-nrpe-server nagios-plugins 修改nrpe.cfgvi /etc/nagios/nrpe.cfg修改Allow Host,添加 ...

  8. 【CodeChef】Querying on a Grid(分治,最短路)

    [CodeChef]Querying on a Grid(分治,最短路) 题面 Vjudge CodeChef 题解 考虑分治处理这个问题,每次取一个\(mid\),对于\(mid\)上的三个点构建最 ...

  9. 【LOJ#2542】[PKUWC2018]随机游走(min-max容斥,动态规划)

    [LOJ#2542][PKUWC2018]随机游走(min-max容斥,动态规划) 题面 LOJ 题解 很明显,要求的东西可以很容易的进行\(min-max\)容斥,那么转为求集合的\(min\). ...

  10. 部署KVM

    1.安装前准备1)服务器或者PC的CPU能支持VT技术2)虚拟机中安装KVM要勾选:处理器:虚拟化Intel VT-x/EPT或AMD-V/RVI(V)[root@localhost ~]# cat ...