1 背景说明
根据CDH 官网文档的说明,CDH的如下组件必须有数据库的支持才能运行: Cloudera Manager Server, Oozie Server, Sqoop Server, Activity Monitor, Reports Manager, Hive Metastore Server, Hue Server, Sentry Server, Cloudera Navigator Audit Server, 和 Cloudera Navigator Metadata Server. https://www.cndba.cn/cndba/dave/article/3374https://www.cndba.cn/cndba/dave/article/3374
不同组件包含的数据内容和大小参考下表:
组件
数据说明及大小
Cloudera Manager Server
Contains all the information about services you have configured and their role assignments, all configuration history, commands, users, and running processes. This relatively small database (< 100 MB) is the most important to back up.
该数据非常重要,当这部分配置数据不能访问时,CM也将无法启动。建议定期对该数据进行备份。
Oozie Server
Contains Oozie workflow, coordinator, and bundle data. Can grow very large.
Sqoop Server
Contains entities such as the connector, driver, links and jobs. Relatively small.
Activity Monitor
Contains information about past activities. In large clusters, this database can grow large. Configuring an Activity Monitor database is only necessary if a MapReduce service is deployed.
Reports Manager
Tracks disk utilization and processing activities over time. Medium-sized.
Hive Metastore Server
Contains Hive metadata. Relatively small.
Hue Server
Contains user account information, job submissions, and Hive queries. Relatively small.
Sentry Server
Contains authorization metadata. Relatively small.
Cloudera Navigator Audit Server
Contains auditing information. In large clusters, this database can grow large.
Cloudera Navigator Metadata Server
Contains authorization, policies, and audit report metadata. Relatively small.
CDH 支持MariaDB,MySQL,PostgreSQL和Oracle 数据库来存储这些组件的数据。 我们这里仅看MySQL数据库的安装配置。
2 MySQL 安装配置
2.1 注意事项
CDH对MySQL有一些限制,具体如下:
1) 对于MySQL 5.6 以后的版本,Cloudera Manager Agent包的安装依赖MySQL-shared-compat 或MySQL-shared包,所以在安装数据库时必须安装这2个MySQL包。
2) MySQL默认的datadir 目录是/var/lib/mysql,要确保该目录存在的分区有足够的空间。
3) 如果MySQL 启用了GTID复制,会导致Cloudera Manager安装失败。
4) 对于5.6.6以后版本的MySQL,在安装或升级Cloudera Navigator时,必须确保MySQL 服务的系统变量:explicit_defaults_for_timestamp被禁用(设置为0),否则会导致操作失败。https://www.cndba.cn/cndba/dave/article/3374
2.2 安装MySQL
从官网下载Mysql文件,注意这里要下载5.6. 因为5.7 的安装文件里没有MySQL-shared包。
[root@www.cndba.cn dave]# ls
MySQL-5.6.44-1.el6.x86_64.rpm-bundle.tar
[root@www.cndba.cn dave]# tar xvf MySQL-5.6.44-1.el6.x86_64.rp