环境
三台天翼云主机 (node209, node452, node440)
OS:CentOS 6.5 64位
JDK:Oracle JDK 1.7.0_45
sudo mkdir -p /hadoop/data/yarn/logs
sudo chown -R yarn:yarn /hadoop/data/yarn/logs
NodeManager(node209, node452, node440):
sudo service hadoop-yarn-nodemanager start
MapReduce JobHistory Server(node440):
sudo service hadoop-mapreduce-historyserver start
安装ZooKeeper(集群模式)
Node Type:
node229, node452, node440
1.所有节点安装zookeeper, zookeeper-server
yum install -y zookeeper zookeeper-server
2.所有节点修改zookeeper配置文件
vi /etc/zookeeper/conf/zoo.cfg
增加节点的配置
server.1=node229:2888:3888
server.2=node452:2888:3888
server.3=node440:2888:3888
server.2=node452:2888:3888
server.3=node440:2888:3888
3.所有节点初始化zookeeper-server
每个节点的myid唯一
node229:service zookeeper-server init --myid=1
node452:service zookeeper-server init --myid=2
node440:service zookeeper-server init --myid=3
4.所有节点启动zookeeper
service zookeeper-server start
5.查看zookeeper状态
zookeeper-server status
安装CDH(集群模式,HDFS+YARN)
Node Type:
namenode: node229
datanode: node229, node452, node440
yarn-resourcemanager: node452
yarn-nodemanager: node229, node452, node440
mapreduce-historyserver: node440
yarn-proxyserver: node440
node1:
yum install hadoop-hdfs-namenode
node2:
yum install hadoop-yarn-resourcemanager
node3:
yum install hadoop-mapreduce-historyserver hadoop-yarn-proxyserver
所有节点:
yum install hadoop-client
yum install hadoop-yarn-nodemanager hadoop-hdfs-datanode hadoop-mapreduce
部署CDH
1.部署HDFS
(1) 配置文件
core-site.xml
<property>
<name>fs.defaultFS</name>
<value>hdfs://node229:8020</value>
</property>
<name>fs.defaultFS</name>
<value>hdfs://node229:8020</value>
</property>
<property>
<name>fs.trash.interval</name>
<value>1440</value>
</property>
<name>fs.trash.interval</name>
<value>1440</value>
</property>
hdfs-site.xml
<property>
<name>dfs.permissions.superusergroup</name>
<value>hadoop</value>
</property>
<name>dfs.permissions.superusergroup</name>
<value>hadoop</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/hadoop/hdfs/namenode</value>
</property>
<name>dfs.namenode.name.dir</name>
<value>/hadoop/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/hadoop/hdfs/datanode</value>
</property>
<name>dfs.datanode.data.dir</name>
<value>/hadoop/hdfs/datanode</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
slaves
node209
node452
node440
(2)创建namenode和datanode文件夹
namenode:
mkdir -p /hadoop/hdfs/namenode
chown -R hdfs:hdfs /hadoop/hdfs/namenode
chmod 700 /hadoop/hdfs/namenode
chown -R hdfs:hdfs /hadoop/hdfs/namenode
chmod 700 /hadoop/hdfs/namenode
datanode:
mkdir -p /hadoop/hdfs/datanode
chown -R hdfs:hdfs /hadoop/hdfs/datanode
chmod 700 /hadoop/hdfs/datanode
mkdir -p /hadoop/hdfs/datanode
chown -R hdfs:hdfs /hadoop/hdfs/datanode
chmod 700 /hadoop/hdfs/datanode
(3)格式化namenode
sudo -u hdfs hadoop namenode -format
(4)启动hdfs
namenode(node209):
service hadoop-hdfs-namenode start
datanode(node209, node452, node440):
service hadoop-hdfs-datanode start
(for x in `cd /etc/init.d ; ls hadoop-hdfs-*` ; do sudo service $x start ; done)
(5)查看hdfs状态
sudo -u hdfs hdfs dfsadmin -report
sudo -u hdfs hadoop fs -ls -R -h /
(6)创建HDFS临时文件夹
sudo -u hdfs hadoop fs -mkdir /tmp
sudo -u hdfs hadoop fs -chmod -R 1777 /tmp
2.部署YARN
(1)配置YARN
mapred-site.xml:
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.jobhistory.address</name>
<value>node440:10020</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>node440:19888</value>
</property>
<name>mapreduce.jobhistory.address</name>
<value>node440:10020</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>node440:19888</value>
</property>
yarn-site.xml
<property>
<name>yarn.resourcemanager.address</name>
<value>node452:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>node452:8030</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>node452:8088</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>node452:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>node452:8033</value>
</property>
<property>
<description>Classpath for typical applications.</description>
<name>yarn.application.classpath</name>
<value>
$HADOOP_CONF_DIR,
$HADOOP_COMMON_HOME/*,$HADOOP_COMMON_HOME/lib/*,
$HADOOP_HDFS_HOME/*,$HADOOP_HDFS_HOME/lib/*,
$HADOOP_MAPRED_HOME/*,$HADOOP_MAPRED_HOME/lib/*,
$HADOOP_YARN_HOME/*,$HADOOP_YARN_HOME/lib/*
</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.nodemanager.local-dirs</name>
<value>/hadoop/data/yarn/local</value>
</property>
<property>
<name>yarn.nodemanager.log-dirs</name>
<value>/hadoop/data/yarn/logs</value>
</property>
<property>
<name>yarn.aggregation.enable</name>
<value>true</value>
</property>
<property>
<description>Where to aggregate logs</description>
<name>yarn.nodemanager.remote-app-log-dir</name>
<value>/var/log/hadoop-yarn/apps</value>
</property>
<property>
<name>yarn.resourcemanager.address</name>
<value>node452:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>node452:8030</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>node452:8088</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>node452:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>node452:8033</value>
</property>
<property>
<description>Classpath for typical applications.</description>
<name>yarn.application.classpath</name>
<value>
$HADOOP_CONF_DIR,
$HADOOP_COMMON_HOME/*,$HADOOP_COMMON_HOME/lib/*,
$HADOOP_HDFS_HOME/*,$HADOOP_HDFS_HOME/lib/*,
$HADOOP_MAPRED_HOME/*,$HADOOP_MAPRED_HOME/lib/*,
$HADOOP_YARN_HOME/*,$HADOOP_YARN_HOME/lib/*
</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.nodemanager.local-dirs</name>
<value>/hadoop/data/yarn/local</value>
</property>
<property>
<name>yarn.nodemanager.log-dirs</name>
<value>/hadoop/data/yarn/logs</value>
</property>
<property>
<name>yarn.aggregation.enable</name>
<value>true</value>
</property>
<property>
<description>Where to aggregate logs</description>
<name>yarn.nodemanager.remote-app-log-dir</name>
<value>/var/log/hadoop-yarn/apps</value>
</property>
<property>
<name>yarn.app.mapreduce.am.staging-dir</name>
<value>/user</value>
</property>
<name>yarn.app.mapreduce.am.staging-dir</name>
<value>/user</value>
</property>
(2)所有nodemanager创建本地目录
sudo mkdir -p /hadoop/data/yarn/local
sudo chown -R yarn:yarn /hadoop/data/yarn/local
sudo chown -R yarn:yarn /hadoop/data/yarn/local
sudo mkdir -p /hadoop/data/yarn/logs
sudo chown -R yarn:yarn /hadoop/data/yarn/logs
(3)创建HDFS目录
sudo -u hdfs hadoop fs -mkdir -p /user/history
sudo -u hdfs hadoop fs -chmod -R 1777 /user/history
sudo -u hdfs hadoop fs -chown yarn /user/history
sudo -u hdfs hadoop fs -chmod -R 1777 /user/history
sudo -u hdfs hadoop fs -chown yarn /user/history
sudo -u hdfs hadoop fs -mkdir -p /var/log/hadoop-yarn
sudo -u hdfs hadoop fs -chown yarn:mapred /var/log/hadoop-yarn
sudo -u hdfs hadoop fs -chown yarn:mapred /var/log/hadoop-yarn
(4)启动YARN
ResourceManager(node452):
sudo service hadoop-yarn-resourcemanager start
sudo service hadoop-yarn-resourcemanager start
NodeManager(node209, node452, node440):
sudo service hadoop-yarn-nodemanager start
MapReduce JobHistory Server(node440):
sudo service hadoop-mapreduce-historyserver start
(5)创建YARN的HDFS用户目录
sudo -u hdfs hadoop fs -mkdir -p /user/$USER
sudo -u hdfs hadoop fs -chown $USER /user/$USER
sudo -u hdfs hadoop fs -chown $USER /user/$USER
(6)测试
查看节点状态
yarn node -all -list
hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar randomwriter input
(7)关闭
sudo service hadoop-yarn-resourcemanager stop
sudo service hadoop-yarn-nodemanager stop
sudo service hadoop-mapreduce-historyserver stop
安装和部署HBase
Node Type:
hbase-master: node229, node440
hbase-regionserver: node229, node452, node440
hbase-thrift: node440
hbase-rest: node229, node452, node440
hbase-regionserver: node229, node452, node440
hbase-thrift: node440
hbase-rest: node229, node452, node440
1.安装HBase
(1)修改配置
/etc/security/limits.conf,增加配置
hdfs - nofile 32768
hbase - nofile 32768
hdfs - nofile 32768
hbase - nofile 32768
hdfs-site.xml,增加配置
<property>
<name>dfs.datanode.max.xcievers</name>
<value>4096</value>
</property>
<name>dfs.datanode.max.xcievers</name>
<value>4096</value>
</property>
(2)安装HBase
hbase-master:
sudo yum install hbase hbase-master
hbase-regionserver:
hbase-regionserver:
sudo yum install hbase hbase-regionserver
hbase-thrift:
hbase-thrift:
sudo yum install hbase-thrift
hbase-rest:
hbase-rest:
sudo yum install hbase-rest
(3)配置HBase
hbase-site.xml
<property>
<name>hbase.rest.port</name>
<value>60050</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>node229, node452, node440</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/hadoop/hbase</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://node229:8020/hbase/</value>
<name>hbase.rest.port</name>
<value>60050</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>node229, node452, node440</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/hadoop/hbase</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://node229:8020/hbase/</value>
</property>
(4)创建本地目录
mkdir -p /hadoop/hbase
chown -R hbase:hbase /hadoop/hbase
(5)创建hbase的HDFS目录
sudo -u hdfs hadoop fs -mkdir /hbase/
sudo -u hdfs hadoop fs -chown hbase /hbase
(6)启动HBase
hbase-master:
sudo service hbase-master start
hbase-regionserver: sudo service hbase-regionserver start
hbase-thrift: sudo service hbase-thrift start
hbase-rest: sudo service hbase-rest start
http://blog.csdn.net/beckham008/article/details/19028853
相关推荐
- **安装CDH组件**:使用YUM工具安装CDH组件及相关依赖包。 - **配置Cloudera Manager**:配置Cloudera Manager Server,包括初始化数据库、创建管理员账户等。 - **启动服务**:启动所有必需的服务,确保集群...
【yum安装CDH5.5 hive、impala的过程详解】 在大数据处理中,Hive和Impala是两个关键组件,它们分别提供了数据仓库和实时分析的功能。本文将详细阐述通过YUM包管理器在CDH5.5环境下安装Hive和Impala的步骤,以及...
[root@localhost ~]# yum install -y cdh5-hadoop cdh5-hbase cdh5-hive ``` 4. **配置CDH**:安装完成后,需要配置各个组件的配置文件,包括`core-site.xml`, `hdfs-site.xml`, `yarn-site.xml`, `mapred-site....
url: http://archive.cloudera.com/cdh5/parcels/ 2. 不作任何操作,配置好 yum repo 远程下载库,Cloudera Manager 会从远程 url 自动下载。 缺点:需要网速比较快,下载耗时。 三、环境需求 1. 主机名称和 ...
《CDH5简要安装教程》 CDH5(Cloudera Distribution Including Apache Hadoop, Version 5)是Cloudera公司提供的一款基于Apache Hadoop的开源大数据平台,包含了Hadoop生态系统中的多个组件,如HDFS、MapReduce、...
在配置完成后,我们可以尝试使用yum命令来安装软件包,例如: yum -y install httpd 如果安装成功,表明我们的配置正确。 5. 解除挂载 在完成配置后,我们需要将介质从原先文件解除挂载。 6. 启动http服务 ...
### CentOS 6本地快速安装CDH 5.x详解 #### 一、背景及目标 本文档旨在提供一个详细的指南,帮助读者理解如何在CentOS 6环境下快速搭建Cloudera Data Hub (CDH) 5.x集群。此教程涵盖了从准备环境到最终成功部署的...
### CDH5离线安装与配置详解 #### 一、CDH5简介 **CDH**(Cloudera's Distribution including Apache Hadoop)是由Cloudera公司维护并开发的一个Hadoop发行版。它基于Apache Hadoop的稳定版本构建,并集成了大量的...
### 大数据部署离线安装CDH操作指南 #### 环境准备 为了搭建一个稳定的大数据平台,首先需要准备好必要的硬件资源。本指南基于三台机器进行部署: - **cdh1**:作为CM Server及DB Server,内存至少6GB。 - **cdh2...
本篇将详细阐述使用Cloudera Manager在CDH5上安装和配置Hive、HBase、Impala以及Spark的服务步骤。 **一、安装前准备工作** 在开始安装CDH5之前,确保完成以下准备工作: 1. **下载安装所需文件**:这包括...
使用本地类库安装CDH5** 在Cloudera Manager中,可以指定使用本地仓库安装CDH组件,以避免在线安装时的网络问题。这涉及选择本地仓库路径,配置CM以使用该仓库,然后按照提示安装所需的CDH组件。 **6. HDFS启用HA...
安装Cloudera Manager Server需要使用yum install命令安装cloudera-manager-daemons、cloudera-manager-agent和cloudera-manager-server软件包。 二、配置MySQL数据库 MySQL数据库是大数据平台的元数据存储库,...
然后使用yum list | grep cloudera命令查看jdk,使用yum install oracle-j2sdk1.7.x86_64命令安装jdk(版本为1.7)。最后,设置java环境变量并使文件立即生效。 知识点六:MySQL安装 在CentOS6.5系统下安装CDH5.8.2...
在本文中,我们将详细探讨在REDHAT7.2操作系统上安装Cloudera Distribution including Apache Hadoop(CDH)5.10版本以及Kudu1.2的过程。这个过程将分为几个关键步骤,从前期准备到集群的完整性检查,都包含在内。 ...
在这个"Impala 用CM4.5 Free Edition详细安装 CDH"的主题中,我们将探讨如何在CDH(Cloudera Data Hub)平台上,利用Cloudera Manager(CM)4.5的免费版进行Impala的安装和配置。 首先,我们需要了解CDH是什么。CDH...
http://archive-primary.cloudera.com/cdh5/parcels/latest/manifest.json ``` 3. **创建repo文件**: - 创建repo文件以支持本地`yum`操作,便于安装Cloudera Manager和其他必要组件。 ```bash $> cd cm $> ...
5. **安装基础软件**:确保`scm-node2`和`scm-node3`上已经安装了CDH和MySQL等必要软件。 6. **其他配置**:还需完成NTP时钟同步以及双机互信等配置。 #### 三、安装NFS NFS (Network File System) 是一种允许...