基于Cloudera Manager Server的WebUI添加Hive服务实战案例

      基于Cloudera Manager Server的WebUI添加Hive服务实战案例

                                      作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

 

 

 

 

一.MySQL授权hive用户的准备工作 

[root@cdh101.yinzhengjie.org.cn ~]# mysql -uroot -pyinzhengjie
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 5.5.64-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
MariaDB [(none)]> CREATE DATABASE hive  CHARACTER SET = utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> 
MariaDB [(none)]> GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'172.200.2.%' IDENTIFIED BY 'yinzhengjie' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> 
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> 
MariaDB [(none)]> SELECT user,host,password FROM mysql.user;
+------+-------------+-------------------------------------------+
| user | host        | password                                  |
+------+-------------+-------------------------------------------+
| root | localhost   | *BD0B1F48FDC55BD27555FC2F22FF29A68A25A1D7 |
| root | 127.0.0.1   | *BD0B1F48FDC55BD27555FC2F22FF29A68A25A1D7 |
| root | ::1         | *BD0B1F48FDC55BD27555FC2F22FF29A68A25A1D7 |
| hive | 172.200.2.% | *BD0B1F48FDC55BD27555FC2F22FF29A68A25A1D7 |
| cm   | 172.200.2.% | *BD0B1F48FDC55BD27555FC2F22FF29A68A25A1D7 |
+------+-------------+-------------------------------------------+
rows in set (0.00 sec)

MariaDB [(none)]> 
MariaDB [(none)]> SHOW GRANTS FOR 'hive'@'172.200.2.%';
+---------------------------------------------------------------------------------------------------------------+
| Grants for hive@172.200.2.%                                                                                   |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'hive'@'172.200.2.%' IDENTIFIED BY PASSWORD '*BD0B1F48FDC55BD27555FC2F22FF29A68A25A1D7' |
| GRANT ALL PRIVILEGES ON `hive`.* TO 'hive'@'172.200.2.%' WITH GRANT OPTION                                    |
+---------------------------------------------------------------------------------------------------------------+
rows in set (0.00 sec)

MariaDB [(none)]> 
MariaDB [(none)]> QUIT
Bye
[root@cdh101.yinzhengjie.org.cn ~]# 
[root@cdh101.yinzhengjie.org.cn ~]# mysql -u hive -pyinzhengjie -h cdh101.yinzhengjie.org.cn
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 5.5.64-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hive               |
+--------------------+
rows in set (0.00 sec)

MariaDB [(none)]> 
MariaDB [(none)]> QUIT
Bye
[root@cdh101.yinzhengjie.org.cn ~]# 
[root@cdh101.yinzhengjie.org.cn ~]# 

 

二.安装Hive服务

1>.如下图所示,点击"yinzhengjie_hadoop"集群的下拉菜单,点击"添加服务"按钮

2>.选择需要安装的Hive服务,并点击"继续"

3>.选择Hive的依赖环境

4>.自定义Hive的角色分配

5>.数据库连接信息设置

6>.自定义Hive在HDFS的数据存储路径,一般情况下默认即可

7>.等待Hive环境安装过程

8>.Hive环境安装完成后,点击"继续"

9>.Hive安装成功

10>.点击"Hive",进入到Hive的管理界面

11>.依次点击"操作","启动"按钮来启动Hive服务

12>.点击启动"启动"会自动去执行Hive相关的命令

13>.等待Hive服务启动过程,首次启动可能会比较耗费时间,因为得去Hdfs集群上创建相应的目录

14>.Hive服务启动完成

15>.查看Hive的实例

16>.查看Hive的WebUI界面

17>.查看HIve的WebUI

 

posted @ 2020-03-04 23:30  JasonYin2020  阅读(460)  评论(0编辑  收藏  举报