一,安装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
 任意主机之间可以无密码登录。
 authorized_keys包含了所有主机的密钥,多主机这里可以通过nfs 挂载同步文件authorized_keys,一改全改
 
 
四,设置HSOT
  vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.183.130 tank1
192.168.183.131 tank2
192.168.183.132 tank3
192.168.183.133 tank4
 
五,安装hadoop 环境
 
这里用的是hadoop2.20版本
目录结构:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASsAAAD7CAYAAAAy7bIvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACHrSURBVHhe7Z3bkx3Ffcf3r9GDnmyXU8U+x66U48KVchl5N+aW4ENCJbEpiI0hBQhMlpUpjlLJg4qykzykpNiJAoIjgexlkYRkIYQkBOiy0uq2sJL2hkBCq+tqf5meOTPb02dmuqdPT0/3Od+Hqd090/f+/j7z656z/RtYWloiXBgDaAAacFUDN27coA0bNtCAqw1Eu2A80AA0wDRgBFY3Fl6lxYtNujr9Ml05t44unxmly6fX0ReTI3TpxC9p4fhamjv6NM2feImuzOyABwcvFhqABkprwACsbgegepluX3ud7tyepatzr9DnZ1+kUwefpFuLb9OdW+8m182rb9LM0RdLNxJPVjxZoQFowACsliJYXd8aXkRL4XXug0fo6N5n6dqlV2np5o7g3hjduvoWTR98DLDCUxUagAZKa8A4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pSLYsDPX2x6SFVhFZ7zjqOT6DADw8WfsrcOqvoAR/Nnq3HKPLQnj5WFqWVZ2GRgvK9P50uG8ontJHEKE+oI3BY9aWQNWYaX6PSvzASPEN3n831zE5cEGNWLPqpsgE6kN9k5INhosyGq0cQ+vyp8nO7yweufKKqxUJ7t3A0bg6w+qGkC6esHg4vg7CaveDRgBWLloBGiTH2B0ElZMPL0ZMAKwAhj8AIOL8+QsrFwcLLQJhgYN1KcBwApvY5TfxsBQ6zNUjH2w2rpxgzZs2ED/D9wreqzgsLCzAAAAAElFTkSuQmCC" alt="" />
设置环境变量:
export HADOOP_HOME=/data/hadoop/hadoop-2.2.0
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
 
注意:$HADOOP/bin 和$HADOOP/sbin 目录下的文件都有可执行的权限
 
修改配置文件:
[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><description>(备注:请先在 /usr/hadoop 目录下建立 tmp 文件夹)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
<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 yarn-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>192.168.149.128:9001</value>
</property>
</configuration>
 
 
注意上面一定要填Ip,不要填localhost,不然eclipse会连接不到!
 
设置主从关系$HADOOP_HOME/etc/hadoop/目录下:
[hadoop@tank1 hadoop]$ vi masters 
192.168.183.130

//主机特有,从机可以不需要
[hadoop@tank1 hadoop]$ vi slaves

192.168.183.131
192.168.183.132
192.168.183.133

 
[hadoop@tank1 hadoop]$ hadoop namenode -format   //第一次需要
 
启动:
sbin/start-all.sh
 
查看状态:主机

[tank@192 hadoop-2.2.0]$ jps
2751 ResourceManager
2628 SecondaryNameNode
2469 NameNode

查看状态:从机
[hadoop@tank2 sbin]$ jps
1745 NodeManager
1658 DataNode

 

 
总共有5个hadoop线程 
 
访问地址查看hdfs 的运行状态:
http://192.168.149.128:50070/dfshealth.jsp
 
 
 从机运行一段时间后NodeManager停止了,查看日志信息:
 
 FATAL org.apache.hadoop.yarn.server.nodemanager.NodeManager: Error starting NodeManager
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.net.ConnectException: Call From tank2/192.168.183.131 to 0.0.0.0:8031 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
        at org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl.serviceStart(NodeStatusUpdaterImpl.java:181)
 
解决方案:
yarn-site.xml 中添加配置
<property>
    <name>yarn.resourcemanager.hostname</name>
    <value>192.168.183.130</value>//主机IP
 </property>
停止,重启
 

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

  1. Hadoop Eclipse开发环境搭建

        This document is from my evernote, when I was still at baidu, I have a complete hadoop developme ...

  2. Hadoop项目开发环境搭建(Eclipse\MyEclipse + Maven)

    写在前面的话 可详细参考,一定得去看 HBase 开发环境搭建(Eclipse\MyEclipse + Maven) Zookeeper项目开发环境搭建(Eclipse\MyEclipse + Mav ...

  3. (转)Hadoop Eclipse开发环境搭建

    来源:http://www.cnblogs.com/justinzhang/p/4261851.html This document is from my evernote, when I was s ...

  4. 【原创干货】大数据Hadoop/Spark开发环境搭建

    已经自学了好几个月的大数据了,第一个月里自己通过看书.看视频.网上查资料也把hadoop(1.x.2.x).spark单机.伪分布式.集群都部署了一遍,但经历短暂的兴奋后,还是觉得不得门而入. 只有深 ...

  5. Hadoop基本开发环境搭建(原创,已实践)

    软件包: hadoop-2.7.2.tar.gz hadoop-eclipse-plugin-2.7.2.jar hadoop-common-2.7.1-bin.zip eclipse  jdk1.8 ...

  6. 【hadoop之翊】——windows 7使用eclipse下hadoop应用开发环境搭建

    由于一些缘故,这节内容到如今才写.事实上弄hadoop有一段时间了,能够编写一些小程序了,今天来还是来说说环境的搭建.... 说明一下:这篇文章的步骤是接上一篇的hadoop文章的:http://bl ...

  7. ubuntu14.04 Hadoop单机开发环境搭建MapReduce项目

    Hadoop官网:http://hadoop.apache.org/ 目前最新的版本是Hadoop 3.0.0-alpha1前提:java 1.6 版本以上 首先从官网下载压缩包(hadoop-3.0 ...

  8. hadoop分布式的环境搭建

    版本: 使用hadoop1.1.2    JDK为java7 1.下载hadoop 2.配置hadoop文件 3测试 1.下载hadoop: 1.1 在https://archive.apache.o ...

  9. hadoop本地开发环境搭建

    1:下载hadoop2.7.3并解压 2:配置hadoop2.7.3环境变量 HADOOP_HOME %HADOOP_HOME%\bin 3:下载hadoop-eclipse-plugin插件 网址: ...

随机推荐

  1. docker--Dockerfile-nginx

    # 基础镜像 FROM alpine # 作者信息 MAINTAINER NGINX Docker Maintainers "1024331014@qq.com" # 修改源 RU ...

  2. DRF 序列化组件

    Serializers 序列化组件 Django的序列化方法 class BooksView(View): def get(self, request): book_list = Book.objec ...

  3. springMVC整理02--常用注解的使用

    1.使用@RequestMapping  映射请求 1.1在类和方法上添加@RequestMappingSpringMVC 使用@RequestMapping 为控制器指定可以处理哪些 URL 请求. ...

  4. 常用 git 基础命令

    git config --global credential.helper store记住密码 git config user.name xxx配置帐号 git config user.email x ...

  5. 「POJ - 1003」Hangover

    BUPT 2017 summer training (16) #2C 题意 n个卡片可以支撑住的长度是1/2+1/3+1/4+..+1/(n+1)个卡片长度.现在给出需要达到总长度,求最小的n. 题解 ...

  6. THUSC2017 Day1题解

    THUSC2017 Day1题解 巧克力 题目描述 "人生就像一盒巧克力,你永远不知道吃到的下一块是什么味道." 明明收到了一大块巧克力,里面有若干小块,排成n行m列.每一小块都有 ...

  7. 【题解】 bzoj3555: [Ctsc2014]企鹅QQ (字符串Hash)

    题面戳我 Solution 我们分析题意,他要求的是两个字符串只有一个字符不同,然后我们再看长度\(L \leq 200\),显然我们就可以把每一位删除后\(Hash\),然后判断相同个数即可 我一开 ...

  8. [NOIp2008] 双栈排序 (二分图染色 + 贪心)

    题意 给你一个长为 \(n\) 的序列 \(p\) ,问是否能够通过对于两个栈进行 push, pop(print) 操作使得最后输出序列单调递增(即为 \(1 \cdots n\) ),如果无解输出 ...

  9. <Android基础>(二) Activity Part 2

    1.活动生命周期 1)返回栈 2)活动状态 3)活动的生存期 2.活动的启动模式 1)standard 2)singleTop 3)singleTask 4)singleInstance 3.活动的优 ...

  10. scrapy 基本命令

    创建scrapy项目 scrapy startproject project_name 创建爬虫文件 scrapy genspider [-t template] <name> <d ...