使用交互式安装脚本,只需在主节点操作即可. 脚本自动将代码下发部署到其他远程主机,包括修改环境变量,修改相关配置,集群统一起停等.
目录
前言
1.相关环境
2.部署规划
3.代码获取
4.前提依赖
5.开始安装
6.基本操作
6.1 重置集群数据目录
6.2 启动hdfs集群
6.3 启动mapred集群
6.4 查看集群状态
6.5 查看帮助
前言
使用交互式安装脚本,只需在主节点操作即可.
脚本自动将代码下发部署到其他远程主机,包括修改环境变量,修改相关配置,集群统一起停等.
@Author duangr
@Website http://www.linuxidc.com/Linux/2014-03/98600.htm
1.相关环境
| Host Name | OS | IP |
| duangr-1 | CentOS 64 x86_64 | 192.168.56.10 |
| duangr-2 | CentOS 64 x86_64 | 192.168.56.11 |
| duangr-3 | CentOS 64 x86_64 | 192.168.56.12 |
2.部署规划
| 项 | 值 |
| 安装用户 | Hadoop |
| Hadoop版本 | hadoop-2.0.0-cdh4.5.0 |
| 安装路径 | /export/home/tools/hadoop |
| 主节点 | duangr-1 |
| 从节点 | duangr-2,duangr-3 |
3.代码获取
- hadoop-2.0.0-cdh4.5.0.tar.gz
- hadoop-native-2.0.0+1518-1.cdh4.5.0.p0.24.el6.x86_64.tar.gz
- hadoop2-plugin-install.tar.gz
4.前提依赖
- 多主机之间配置好SSH密钥
- 关闭SELinux
5.开始安装
只需主节点安装
mkdir -p /export/home/tools/hadoop
tar -zxf hadoop-2.0.0-cdh4.5.0.tar.gz -C /export/home/tools/hadoop
tar -zxf hadoop-native-2.0.0+1518-1.cdh4.5.0.p0.24.el6.x86_64.tar.gz -C /export/home/tools/hadoop/hadoop-2.0.0-cdh4.5.0/lib
tar -zxf hadoop2-plugin-install.tar.gz -C /export/home/tools/hadoop/hadoop-2.0.0-cdh4.5.0
cd /export/home/tools/hadoop/hadoop-2.0.0-cdh4.5.0/install
./install.sh ## 根据交互提示进行输入
. ~/.bash_profile
6.基本操作
如下操作只适用于主节点
6.1 重置集群数据目录
1 |
$ hadoop-cluster.sh reset |
6.2 启动hdfs集群
1 |
$ hadoop-cluster.sh dfs start |
6.3 启动mapred集群
1 |
$ hadoop-cluster.sh yarn start |
6.4 查看集群状态
1 |
$ hadoop-cluster.sh status |
6.5 查看帮助
$ hadoop-cluster.sh
Usage: hadoop-cluster.sh [task] [task-options]
Tasks:
reset - Reset hadoop data and Clear logs
dfs - dfs Options (required options)
yarn - yarn Options (required options)
status - show hadoop status
Task [dfs] options:
start - dfs Start
stop - dfs Stop
status - dfs status
Task [yarn] options:
start - yarn Start
stop - yarn Stop
status - yarn status
相关阅读:
Ubuntu 13.04上搭建Hadoop环境 http://www.linuxidc.com/Linux/2013-06/86106.htm
Ubuntu 12.10 +Hadoop 1.2.1版本集群配置 http://www.linuxidc.com/Linux/2013-09/90600.htm
Ubuntu上搭建Hadoop环境(单机模式+伪分布模式) http://www.linuxidc.com/Linux/2013-01/77681.htm
Ubuntu下Hadoop环境的配置 http://www.linuxidc.com/Linux/2012-11/74539.htm
单机版搭建Hadoop环境图文教程详解 http://www.linuxidc.com/Linux/2012-02/53927.htm
搭建Hadoop环境(在Winodws环境下用虚拟机虚拟两个Ubuntu系统进行搭建) http://www.linuxidc.com/Linux/2011-12/48894.htm
更多Hadoop相关信息见Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13
