Cloudera Manager(简称CM)是Cloudera公司开发的一款大数据集群安装部署利器,这款利器具有集群自动化安装、中心化管理、集群监控、报警等功能,使得安装集群从几天的时间缩短在几小时以内,运维人员从数十人降低到几人以内,极大的提高集群管理的效率。CM 有免费版和企业版,免费版也可用于商用 而且基本够用了。安装后,基本面如下:
尝试过ambari HDP 及自己手动搭建等多种方式,最终选择了使用CM。ambari是apache开源顶级项目,但是在安装后的使用过程中,不同版本有不同的问题,解决比较费时费力。它的优势在于完全开源,可定制开发,组件丰富。缺点是稳定性差,比较折腾人。手动搭建就不用多说了,自己玩玩学习一下就行了。
Cloucera Manager 5:Cloudera Manager 5.x
Cloudera Manager 6:Cloudera Manager 6.x
Cloudera Manager Demos 视频
5.x.x官网安装文档
6.3.x官方安装文档
-------------------------------------------------------华丽的分割线--------------------------------------------------------------------
Ubuntu16.04 server - 3台机器
192.168.10.111 master.cdh.com
192.168.10.112 s1.cdh.com
192.168.10.113 s2.cdh.com
对应的hostname为: master.cdh.com/s1.cdh.com/s2.cdh.com
下载cm6.3.0包
cm6.3.0-ubuntu1604
scp cm*.gz [email protected]
tar -zxvf cm6.3.0-ubuntu1604.tar.gz
apt install apache2
###等待安装完成
cd /var/www/html/
ln -s /home/ubuntu/cm6.3.0 ./
所有机器都需要安装
apt install chrony
根据需要设置时间同步服务器,以显示*号为准:
最好是以master为主服,其余的用master的服务器时间
所有节点都执行
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authroized_keys
然后把master节点的authorized_keys分发到所有子节点中去,很简单
deb [arch=amd64] http://192.168.10.31/cm6.3.0/ubuntu1604/apt xenial-cm6.3.0 contrib
保存文件为cloudera-manager.list,放到/etc/apt/soures.list.d/下面
wget http://192.168.10.31/cm6.3.0/archive.key
apt-key add archive.key
apt-get update
等待完成
master节点安装数据库相关
apt-get install libmysql-java #数据库连接器
apt-get install mysql-server
java包,java包可自行上传,但所在位置必须为/usr/java/这个目录下面,没有/user/java自行创建
mkdir /usr/java
ln -s /ubuntu/home/jdk1.8.0_112 /usr/java/
apt install python2.7
cm 包(master节点)
sudo apt-get install cloudera-manager-daemons cloudera-manager-server cloudera-manager-agent
cm包(slave节点)
sudo apt-get install cloudera-manager-daemons cloudera-manager-agent
修改mysql的配置
vi /etc/mysql/mysql.conf.c/mysqld.cnf
注释掉127.0.0.1这一行
重启服务service mysql restart
CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON metastore.* TO 'hive'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY '123456_';
CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY '123456_';
GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY '123456_';
flush privileges;
执行以下代码
cd /opt/cloudera/cm/schema/
./scm_prepare_database.sh mysql scm scm 123456_
./scm_prepare_database.sh mysql amon amon 123456_
./scm_prepare_database.sh mysql hue hue 123456_
./scm_prepare_database.sh mysql nav nav 123456_
./scm_prepare_database.sh mysql navms navms 123456_
./scm_prepare_database.sh mysql oozie oozie 123456_
./scm_prepare_database.sh mysql rman rman 123456_
./scm_prepare_database.sh mysql sentry sentry 123456_
小建议:
echo 10 > /proc/sys/vm/swappiness
上传下载好后,上传到master节点的 /opt/cloudera/parcel-repo/这个目录下
这里要注意一个文件:
CDH-6.3.0-1.cdh6.3.0.p0.1279813-xenial.parcel.sha1
要修改名称,为
CDH-6.3.0-1.cdh6.3.0.p0.1279813-xenial.parcel.sha
不然在部署的时候,下载好的文件识别不了。
这是个大坑,注意以下
启动服务:
service cloudera-scm-server start
查看日志:
sudo tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
访问地址:
http://192.168.10.111:7180