Cloudera Hadoop-基于yum安装包部署Cloudera Manager(离线部署)
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.数据库授权
1>.安装数据库
我们在“大数据集群系统环境配置”章节中介绍了关于MySQL 5.7主从复制。由于元数据库还是比较重要的,在生成环境使用时,我用的是主从复制机制。 你也可以使用Keepalive + MySQL部署一个主-主双活的数据库,以提升其可用性。具体做法网上有大量的例子,大家注意搜索5.7版本的做法即可,以免配置项有出入。
2>.配置授权用户(创建所需的表和账号)
创建scm,rman,hive,oozie,hue,sentry等这6套库和授权用户(其实根据官方提示,需要创建的库可不止这些哟,但我们实验环境使用这几个库就够用了),分别用户Cloudera Manager,Reports Manager,hive,oozie,hue,sentry存储数据。 官方说需要创建的数据库有:https://www.cloudera.com/documentation/enterprise/5-16-x/topics/cm_ig_installing_configuring_dbs.html#cmig_topic_5_1
[root@node106.yinzhengjie.org.cn ~]# mysql -uroot -pyinzhengjie mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.25-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> mysql> CREATE DATABASE scm DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; #创建scm数据库并制定字符集为uft8mb4,排序规则为utf8mb4_unicode_ci,这里的ci表示字母不区分大小写。 Query OK, 1 row affected (0.00 sec) mysql> mysql> CREATE USER scm@'172.30.1.10%' IDENTIFIED WITH mysql_native_password BY 'yinzhengjie'; #创建'scm'@'172.30.1.10%'用户,指定加密类型为:"mysql_notive_password"(MySQ5.7可以不指定加密类型,因为这是默认的,而Mysql 8.0及以上版本就机密类型变更为:"caching_sha2_password",因此建议大家养成习惯,指定加密类型),并制定密码为"yinzhengjie" Query OK, 0 rows affected (0.00 sec) mysql> mysql> GRANT ALL PRIVILEGES ON scm.* TO scm@'172.30.1.10%'; #将scm数据库下的表的所有权限授权给咱们创建的'scm'@'172.30.1.10%'用户。 Query OK, 0 rows affected (0.01 sec) mysql>
mysql> CREATE DATABASE rman DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; Query OK, 1 row affected (0.01 sec) mysql> mysql> CREATE USER rman@'172.30.1.10%' IDENTIFIED WITH mysql_native_password BY 'yinzhengjie'; Query OK, 0 rows affected (0.00 sec) mysql> mysql> GRANT ALL PRIVILEGES ON rman.* TO rman@'172.30.1.10%'; Query OK, 0 rows affected (0.00 sec) mysql>