CDH:全称Cloudera’s Distribution Including Apache Hadoop。
CDH版本衍化
hadoop是一个开源项目,所以很多公司在这个基础进行商业化,Cloudera对hadoop做了相应的改变。
Cloudera公司的发行版,我们将该版本称为CDH(Cloudera Distribution Hadoop)。
Apache Hadoop 不足之处:
版本管理混乱
部署过程繁琐、升级过程复杂
兼容性差
安全性低
Hadoop 发行版:
Apache Hadoop
Cloudera’s Distribution Including Apache Hadoop(CDH)
Hortonworks Data Platform (HDP)
MapR
EMR
Cloudera's Distribution, including Apache Hadoop(CDH):
是Hadoop众多分支中的一种,由Cloudera维护,基于稳定版本的Apache Hadoop构建
提供了Hadoop的核心
可扩展存储
分布式计算
基于Web的用户界面
![765a0c45d193f67e1ffb22d6a65b5255.png](https://img-blog.csdnimg.cn/img_convert/765a0c45d193f67e1ffb22d6a65b5255.png)
CDH的优点:
版本划分清晰
版本更新速度快
支持Kerberos安全认证
文档清晰
支持多种安装方式(Cloudera Manager方式)
安装方式有:
Cloudera Manager
Yum
Rpm
Tarball
网址:
CDH5.4
http://archive.cloudera.com/cdh5/
Cloudera Manager5.4.3:
http://www.cloudera.com/downloads/manager/5-4-3.html
安装:
首先准备三台虚拟机:
![d74a78316099f968ce5be85a8df5714f.png](https://img-blog.csdnimg.cn/img_convert/d74a78316099f968ce5be85a8df5714f.png)
这给出的内存已经很少了,因为只是模拟,在公司里面,都是物理,内存都是64以上的。。
还有:
首先得在你安装的磁盘中空闲出最少50g的内存,如:
![99d98ca73e77fa4eb5d6afd5215abdcb.png](https://img-blog.csdnimg.cn/img_convert/99d98ca73e77fa4eb5d6afd5215abdcb.png)
我现在三台虚拟机什么都没装,也没启动,先启动,
![cde376eb4e140a01a9d22af58d343f39.png](https://img-blog.csdnimg.cn/img_convert/cde376eb4e140a01a9d22af58d343f39.png)
它会先开辟预存12g占位,这还算少的了。。。。
启动后配置好静态IP,这个以前的文章有,然后开始SSH免密钥登录。
三台虚拟机,先把ssh给打理出来。
![a3ceea56b6861ae83266f784c6423ae5.png](https://img-blog.csdnimg.cn/img_convert/a3ceea56b6861ae83266f784c6423ae5.png)
![3de320e35d935ddd8ee6f6c3d0df9709.png](https://img-blog.csdnimg.cn/img_convert/3de320e35d935ddd8ee6f6c3d0df9709.png)
![f3f5906f27ada24150f5e71ec405a12b.png](https://img-blog.csdnimg.cn/img_convert/f3f5906f27ada24150f5e71ec405a12b.png)
![884c0daa87aa042e4a96d58574e7cea8.png](https://img-blog.csdnimg.cn/img_convert/884c0daa87aa042e4a96d58574e7cea8.png)
![a2fa2e31d8d44d4d50f9e5c6baed3ea1.png](https://img-blog.csdnimg.cn/img_convert/a2fa2e31d8d44d4d50f9e5c6baed3ea1.png)
然后在node07上自己免密自己,在08上免密07.
最后拷贝公钥文件到06和08:
scp authorized_keys node06:`pwd`
![64749f03f3ac68f04aac01b719393b2f.png](https://img-blog.csdnimg.cn/img_convert/64749f03f3ac68f04aac01b719393b2f.png)
然后配置好后安装JDK:
https://www.cnblogs.com/underwing/p/linux-an-zhuang-rpm-dejdk.html
然后记得对上ntp时间。
在安装mysql:
![6403ff0c3ea598244e5eba267e0581c8.png](https://img-blog.csdnimg.cn/img_convert/6403ff0c3ea598244e5eba267e0581c8.png)
![71e3a795ff552fad52b84b5555928d9e.png](https://img-blog.csdnimg.cn/img_convert/71e3a795ff552fad52b84b5555928d9e.png)
安装完成之后启动:
![16485ff391fe75abe66ea9441ea5f69b.png](https://img-blog.csdnimg.cn/img_convert/16485ff391fe75abe66ea9441ea5f69b.png)
![e6629eaad3c00d55fb629141fc4f9469.png](https://img-blog.csdnimg.cn/img_convert/e6629eaad3c00d55fb629141fc4f9469.png)
复制刚才那个路径;设置密码
![f636c5dad1cc3449e98447b5804283f0.png](https://img-blog.csdnimg.cn/img_convert/f636c5dad1cc3449e98447b5804283f0.png)
![8282fb31cd2a4124cddb2c557ca53923.png](https://img-blog.csdnimg.cn/img_convert/8282fb31cd2a4124cddb2c557ca53923.png)
![fcc48ab2cd9c3ba44573bc18f5e10159.png](https://img-blog.csdnimg.cn/img_convert/fcc48ab2cd9c3ba44573bc18f5e10159.png)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
![f23b904116acd4af285082ee22a0d073.png](https://img-blog.csdnimg.cn/img_convert/f23b904116acd4af285082ee22a0d073.png)
之后三台虚拟机的~下执行命令:
yum install -y chkconfig python bind-utils psmisc libxsltzlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb
![ae5ba23749f654b2bf4867b71a302904.png](https://img-blog.csdnimg.cn/img_convert/ae5ba23749f654b2bf4867b71a302904.png)
安装Cloudera Manager Server、Agent
所有节点创建:
![4e7c3d658c31d28525af948d2bc86ae6.png](https://img-blog.csdnimg.cn/img_convert/4e7c3d658c31d28525af948d2bc86ae6.png)
![d381666e68b0a5e9430fdef4b04f68d7.png](https://img-blog.csdnimg.cn/img_convert/d381666e68b0a5e9430fdef4b04f68d7.png)
然后上传文件:
![17d5e1ad43ba5271005febf1ce279c7a.png](https://img-blog.csdnimg.cn/img_convert/17d5e1ad43ba5271005febf1ce279c7a.png)
文件:
链接:https://pan.baidu.com/s/19KSjEflWqYuDKN13ZVbklA
提取码:wm3b
上传后解压:
![02c80a1133bb42619f8da9ad6157c0aa.png](https://img-blog.csdnimg.cn/img_convert/02c80a1133bb42619f8da9ad6157c0aa.png)
解压后:
![b2624fe586bd6979a51b50133b0cdc94.png](https://img-blog.csdnimg.cn/img_convert/b2624fe586bd6979a51b50133b0cdc94.png)
![6680e4e7ae206ccf68efc6413f97cab0.png](https://img-blog.csdnimg.cn/img_convert/6680e4e7ae206ccf68efc6413f97cab0.png)
之后给所有节点创建用户:
useradd --system --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
![e46cdd30e0a8a8b19b78918aa03ccbb6.png](https://img-blog.csdnimg.cn/img_convert/e46cdd30e0a8a8b19b78918aa03ccbb6.png)
创建Parcel目录,Server节点(node06):
mkdir -p /opt/cloudera/parcel-repo
chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo
![f5f30ffd643298ae39c48286e71dd0db.png](https://img-blog.csdnimg.cn/img_convert/f5f30ffd643298ae39c48286e71dd0db.png)
Agent节点(所有节点):
mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
![616a5deba1a498b95383ce3918dedae6.png](https://img-blog.csdnimg.cn/img_convert/616a5deba1a498b95383ce3918dedae6.png)
![dde8be1e7513f4e77305480f2e0b3ac8.png](https://img-blog.csdnimg.cn/img_convert/dde8be1e7513f4e77305480f2e0b3ac8.png)
配置CM Server数据库:
拷贝mysql jar文件到目录 /usr/share/java/(没有就创建)
![744e10ae58350614246ee6eadf77e105.png](https://img-blog.csdnimg.cn/img_convert/744e10ae58350614246ee6eadf77e105.png)
导入mysql,注意jar包名称要修改为mysql-connector-java.jar
![5ffaab2defee81d60cf5cda675dc8d26.png](https://img-blog.csdnimg.cn/img_convert/5ffaab2defee81d60cf5cda675dc8d26.png)
连接mysql,创建一个用户:
![5e35e784878f084ab52656e7c2582f3c.png](https://img-blog.csdnimg.cn/img_convert/5e35e784878f084ab52656e7c2582f3c.png)
grant all on *.* to 'temp'@'%' identified by 'temp' with grant option;
![1ceb8e0d4c72d661395d09f8cc8e3342.png](https://img-blog.csdnimg.cn/img_convert/1ceb8e0d4c72d661395d09f8cc8e3342.png)
cd /opt/cloudera-manager/cm-5.4.3/share/cmf/schema/
![9c72e5b93d4f3c8211e28aefd3d7d247.png](https://img-blog.csdnimg.cn/img_convert/9c72e5b93d4f3c8211e28aefd3d7d247.png)
./scm_prepare_database.sh mysql temp -h node06 -utemp -ptemp --scm-host node06 scm scm scm
![513af705df65d8729bea9dd6d75d24bb.png](https://img-blog.csdnimg.cn/img_convert/513af705df65d8729bea9dd6d75d24bb.png)
![ea33624765b2e20f8d965613f63dd443.png](https://img-blog.csdnimg.cn/img_convert/ea33624765b2e20f8d965613f63dd443.png)
![80508957041f5076ece9a6cbf17f563b.png](https://img-blog.csdnimg.cn/img_convert/80508957041f5076ece9a6cbf17f563b.png)
![7f57e94a0aa115c8191541bcbd0a1e14.png](https://img-blog.csdnimg.cn/img_convert/7f57e94a0aa115c8191541bcbd0a1e14.png)
![fcdfef20e6c8f6c710d59c441c9566d9.png](https://img-blog.csdnimg.cn/img_convert/fcdfef20e6c8f6c710d59c441c9566d9.png)
![543941554fbc53aa23ddef0e9cb1157b.png](https://img-blog.csdnimg.cn/img_convert/543941554fbc53aa23ddef0e9cb1157b.png)
启动CM Server、Agent:
cd /opt/cloudera-manager/cm-5.4.3/etc/init.d/
./cloudera-scm-server start
![0381851cba4708eb90ea3e7d702d279e.png](https://img-blog.csdnimg.cn/img_convert/0381851cba4708eb90ea3e7d702d279e.png)
Sever首次启动会自动创建表以及数据,不要立即关闭或重启,否则需要删除所有表及数据重新安装
然后在所有节点上启动agent:
![a5ecea7d0c72d5a63ab8f6b72be805e1.png](https://img-blog.csdnimg.cn/img_convert/a5ecea7d0c72d5a63ab8f6b72be805e1.png)
./cloudera-scm-agent start
![de09f21f5fc91a6b175f8175b21521c6.png](https://img-blog.csdnimg.cn/img_convert/de09f21f5fc91a6b175f8175b21521c6.png)
格式:数据库类型、数据库、数据库服务器、用户名、密码、cm server服务器
启动时间,短至几分钟,长至十几二十分钟,看电脑配置而定
![8d43a04c89ee82c55335882f59ed910c.png](https://img-blog.csdnimg.cn/img_convert/8d43a04c89ee82c55335882f59ed910c.png)
出现这个端口代表你可以访问了,
![2a5c0992873053efa740940fafaae5b7.png](https://img-blog.csdnimg.cn/img_convert/2a5c0992873053efa740940fafaae5b7.png)
然后就可以安装你想要安装的了,
![3172b9c44152c5175bbeb1ae31efe60a.png](https://img-blog.csdnimg.cn/img_convert/3172b9c44152c5175bbeb1ae31efe60a.png)
![bc6f62be5032541db49d8059d8e1caee.png](https://img-blog.csdnimg.cn/img_convert/bc6f62be5032541db49d8059d8e1caee.png)
![fb044ac7729746657822c23f3a11f4ec.png](https://img-blog.csdnimg.cn/img_convert/fb044ac7729746657822c23f3a11f4ec.png)
模拟的话我们就只安装几个就好了,我内存也不大,就16g,上面很多都直接能把我安蹦的
![b7e835b19edb7f5e9a3a3fb723fa2521.png](https://img-blog.csdnimg.cn/img_convert/b7e835b19edb7f5e9a3a3fb723fa2521.png)
这是根据你节点分配的,没什么要改的(在公司不一样),一直继续,
![c550feeccd4a55d70f497467aa9f09cb.png](https://img-blog.csdnimg.cn/img_convert/c550feeccd4a55d70f497467aa9f09cb.png)
![e1df036b0150f2dda60aad8f14cb2a4b.png](https://img-blog.csdnimg.cn/img_convert/e1df036b0150f2dda60aad8f14cb2a4b.png)
如果其中失败了,就去诊断看原因,去首页,找到安装那个配置,去看下。
![30f21daf23124c7a24276c42e257932b.png](https://img-blog.csdnimg.cn/img_convert/30f21daf23124c7a24276c42e257932b.png)
![b2d34d77ebe07873cff8ea8fa48e8d0e.png](https://img-blog.csdnimg.cn/img_convert/b2d34d77ebe07873cff8ea8fa48e8d0e.png)