码迷,mamicode.com
首页 > 其他好文 > 详细

hive单用户多点模式配置

时间:2018-11-28 18:52:38      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:安装mysql   简介   nec   xxxx   asto   ring   usr   mysql安装   lse   

简介

单用户多点模式也称远程服务模式,用户非java客户端访问元数据库,在服务端启动MetaStoreServer,客户端利用Thrift协议通过MetaStoreServer访问元数据库。

mysql安装以及配置

安装mysql

apt默认安装,占据3306端口

安装机器 : dev01

sudo apt-get install mysql-server

sudo apt-get install mysql-client

配置hive用户

  1. 登陆mysql
    mysql -u root -p xxxxxx

  2. 创建hive用户

    create user ‘hive‘@‘%‘ identified by ‘hive‘;

  3. 给hive用户权限

    grant all privileges on *.* to ‘hive‘@‘%‘ with grant option;

    flush privileges;

服务端配置

修改 $HIVE_HOME/conf/hive-site.xml

<configuration>
#配置mysql
<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
 <name>hive.metastore.warehouse.dir</name>
 <value>/usr/hive/warehouse</value>
</property>
# 配置MySQL的登录名和密码
<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>hive</value>
  <description>username to use against metastore database</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>hive</value>
  <description>password to use against metastore database</description>
</property>

<property>
<name>hive.exec.scratchdir</name>
<value>/usr/hive/tmp</value>
</property>

<property>
<name>hive.querylog.location</name>
<value>/usr/hive/log</value>
</property>

<property>
<name>hive.metastore.uris</name>
<value>thrift://dev01:9083</value>
</property>
</configuration>

客户端配置

修改 $HIVE_HOME/conf/hive-site.xml

<configuration>
# 9083是服务端 metastore 启动以后的默认端口
<property>
  <name>hive.metastore.uris</name>
  <value>thrift://dev01:9083</value>
  <description>IP address (or fully-qualified domain name) and port of the metastore host</description>
</property>

<property>
 <name>hive.metastore.warehouse.dir</name>
 <value>/usr/hive/warehouse</value>
</property>

<property>  
  <name>hive.metastore.local</name>  
  <value>false</value>  
</property>  

<property>
 <name>hive.exec.scratchdir</name>
 <value>/usr/hive/tmp</value>
</property>

<property>
 <name>hive.querylog.location</name>
 <value>/usr/hive/log</value>
</property>
</configuration>

启动hive

服务端

启动metastore

hive --service metastore

客户端

beeline -u jdbc:hive2://

hive单用户多点模式配置

标签:安装mysql   简介   nec   xxxx   asto   ring   usr   mysql安装   lse   

原文地址:https://www.cnblogs.com/fengzzi/p/10033552.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!