Hive 组件安装配置

本文详细描述了如何在Linux系统中下载和解压ApacheHive安装包,使用root权限进行安装,并逐步设置Hive环境,包括卸载MariaDB、安装MySQL、配置Hive连接MySQL、环境变量设置以及初始化Hive元数据的过程。
摘要由CSDN通过智能技术生成

一,下载和解压安装文件

(1)使用 root 用户,将 Hive 安装包 /opt/software/apache-hive-2.0.0-bin.tar.gz 路解压到/usr/local/src 路径下。

(2)将解压后的 apache-hive-2.0.0-bin 文件夹更名为 hive;

(3)修改 hive 目录归属用户和用户组为 hadoop

二,设置 Hive 环境

步骤一:卸载 MariaDB 数据库

(1)关闭 Linux 系统防火墙,并将防火墙设定为系统开机并不自动启动。

(2)卸载 Linux 系统自带的 MariaDB。 1)首先查看 Linux 系统中 MariaDB 的安装情况。

2)卸载 MariaDB 软件包

步骤二:安装 MySQL 数据库

(1)按如下顺序依次按照 MySQL 数据库的 mysql common、mysql libs、mysql client 软件包。

(2)安装 mysql server 软件包。

(3)修改 MySQL 数据库配置,在/etc/my.cnf 文件中添加如表 6-1 所示的 MySQL 数据 库配置项。

(4)启动 MySQL 数据库。

(6)查询 MySQL 数据库默认密码。

MySQL 数据库是安装后随机生成的,所以每次安装后生成的默认密码不相同。 (7)MySQL 数据库初始化。 执行 mysql_secure_installation 命令初始化 MySQL 数据库,初始化过程中需要设定 数据库 root 用户登录密码,密码需符合安全规则,包括大小写字符、数字和特殊符号, 可设定密码为 Password123$。

mysql_secure_installation 命令执行过程如下:

[root@master ~]# mysql_secure_installation Securing the MySQL server deployment.  

 Enter password for user root: # 输入/var/log/mysqld.log 文件中查询 到的默认 root 用户登录密码 The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: # 输入新密码 Password123$ Re-enter new password: # 再次输入新密码 Password123$ Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y # 输入 y

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y # 输入 y

Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n # 输入 n

... skipping. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y # 输入 y

- Dropping test database... Success. - Removing privileges on test database... Success. 第 6 章 Hive 组件安装部署 7 Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y # 输入 y

Success. All done!

(8)添加 root 用户从本地和远程访问 MySQL 数据库表单的授权。

步骤三:配置 Hive 组件

(1)设置 Hive 环境变量并使其生效。

[root@master ~]# vi /etc/profile

# 在文件末尾追加以下配置内容

# 使环境变量配置生效

(2)修改 Hive 组件配置文件。

切换到 hadoop 用户执行以下对 Hive 组件的配置操作。 将/usr/local/src/hive/conf 文件夹下 hive-default.xml.template 文件,更名为 hive-site.xml。

(3)通过 vi 编辑器修改 hive-site.xml 文件实现 Hive 连接 MySQL 数据库,并设定 Hive 临时文件存储路径。

[hadoop@master ~]$  vi /usr/local/src/hive/conf/hive-site.xml

1)设置 MySQL 数据库连接。

4)配置数据库驱动。

7)在 Hive 安装目录中创建临时文件夹 tmp。

步骤四:初始化 hive 元数据

1)将 MySQL 数据库驱动(/opt/software/mysql-connector-java-5.1.46.jar)拷贝到 Hive 安装目录的 lib 下;

2)重新启动 hadooop 即可

4)启动 hive

  • 31
    点赞
  • 39
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值