您好,欢迎来到星星旅游。
搜索
您的当前位置:首页hive元数据库mysql部署

hive元数据库mysql部署

来源:星星旅游
1. 安装mysql

Ubuntu下运行代码:

sudo apt-get install mysql-server

漫长的等待之后安装完成。

之后可以用root用户登陆,配置mysql允许远程连接 Mysql–u root

(安装过程中未设置root密码,则默认密码为空)

进入mysql之后,修改root密码

Mysql>grant all privileges on *.* to root@localhost identified by “abc#123”;

然后建存放hive元数据的数据库

Mysql>create database hive_metastore;

建hive_user用户管理该数据库

Mysql>grant all privileges on hive_metastore.* to hive_user@localhost identified by “abc#123:

最后,设置允许hive_user用户远程连接mysql数据库

Mysql>grant all privileges on hive_metastore.* to hive_user@”%” identified by “abc#123”

修改my.cnf配置文件 Sudovi /etc/mysql/my.cnf

Bind-address=127.0.0.1 => bind-address=192.168.4.96

保存退出。

重启mysql数据库: /etc/init.d/mysql restart

mysql安装和配置完成

2. Hive中配置mysql连接

Hive默认是采用Derby来存储其Meta信息的,需要修改配置,让mysql来存储其meta信息。 首先把mysql-connector-java-5.1.12.jar拷贝到/home/hadoop/hive-0.6.0-bin/lib下 再修改hive-default.xml配置

javax.jdo.option.ConnectionURL

jdbc:mysql://192.168.4.96:3306/hive_metastore?createDatabaseIfNotExist=true

JDBC connect string for a JDBC metastore

javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver

Driver class name for a JDBC metastore

javax.jdo.option.ConnectionUserName hive_user

username to use against metastore database

javax.jdo.option.ConnectionPassword abc#123

password to use against metastore database

保存退出,连接mysql配置完成

3. 安装mysql客户端

sudo apt-get install mysql-client

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- stra.cn 版权所有 赣ICP备2024042791号-4

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务