Hadoop2.0 简易安装
使用交互式安装脚本,只需在主节点操作即可. 脚本自动将代码下发部署到其他远程主机,包括修改环境变量,修改相关配置,集群统一起停等.
目录
前言
1.相关环境
2.部署规划
3.代码获取
4.前提依赖
5.开始安装
6.基本操作
6.1 重置集群数据目录
6.2 启动hdfs集群
6.3 启动mapred集群
6.4 查看集群状态
6.5 查看帮助
前言
使用交互式安装脚本,只需在主节点操作即可.
脚本自动将代码下发部署到其他远程主机,包括修改环境变量,修改相关配置,集群统一起停等.
@Author duangr
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 重置集群数据目录
<span style="background-color: #fcfcfc; font-family: Consolas; color: #afafaf;">1</span> | <span style="background-color: #fcfcfc; font-family: Consolas; color: #40aa53;">$ hadoop-cluster.sh reset</span> |
6.2 启动hdfs集群
<span style="background-color: #fcfcfc; font-family: Consolas; color: #afafaf;">1</span> | <span style="background-color: #fcfcfc; font-family: Consolas; color: #40aa53;">$ hadoop-cluster.sh dfs start</span> |
6.3 启动mapred集群
<span style="background-color: #fcfcfc; font-family: Consolas; color: #afafaf;">1</span> | <span style="background-color: #fcfcfc; font-family: Consolas; color: #40aa53;">$ hadoop-cluster.sh yarn start</span> |
6.4 查看集群状态
<span style="background-color: #fcfcfc; font-family: Consolas; color: #afafaf;">1</span> | <span style="background-color: #fcfcfc; font-family: Consolas; color: #40aa53;">$ hadoop-cluster.sh status</span> |
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
相关阅读: