hive配置远程metastore

本文介绍了如何配置Hive使用远程Metastore服务,包括在服务器A上设置MySQL存储Metastore并启动服务,以及在服务器B上修改hive-site.xml配置文件以连接到远程Metastore,最后通过执行HQL测试连接成功。
摘要由CSDN通过智能技术生成

    hive配置远程metastore的方法:

    1)首先配置hive使用本地mysql存储metastore(服务器A 111.121.21.23)(也可以使用远程mysql存储)

    2)配置完成后,在服务器A启动服务:bin/hive --service metastore  (默认监听端口是:9083)

    3)配置hive客户端,修改hive-site.xml:(服务器B-需要有hadoop环境)

        <property>
          <name>hive.metastore.local</name>
          <value>false</value>
          <description>controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM</description>
        </property>
        
        <property>
          <name>hive.metastore.uris</name>
          <value>thrift://111.121.21.23:9083</value>
          <description></description>
        </property>

     4)运行:bin/hive ,执行测试hql


     5)hive客户端连接成功后,hive服务器端输出以下日志:

Starting Hive Metastore Server
11/10/31 18:07:27 INFO metastore.HiveMetaStore: 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
11/10/31 18:07:27 INFO metastore.ObjectStore: ObjectStore, initialize called
11/10/31 18:07:27 ERROR DataNucleus.Plugin: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.resources" but it cannot be resolved.
11/10/31 18:07:27 ERROR DataNucleus.Plugin: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.runtime" but it cannot be resolved.
11/10/31 18:07:27 ERROR DataNucleus.Plugin: Bundle "org.eclipse.jdt.core" requires "org.eclipse.text" but it cannot be resolved.
11/10/31 18:07:27 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored
11/10/31 18:07:27 INFO DataNucleus.Persistence: Property javax.jdo.option.NonTransactionalRead unknown - will be ignored
11/10/31 18:07:27 INFO DataNucleus.Persistence: ================= Persistence Configuration ===============
11/10/31 18:07:27 INFO DataNucleus.Persistence: DataNucleus Persistence Factory - Vendor: "DataNucleus"  Version: "2.0.3"
11/10/31 18:07:27 INFO DataNucleus.Persistence: DataNucleus Persistence Factory initialised for datastore URL="jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true" driver="com.mysql.jdbc.Driver" userName="hive"
11/10/31 18:07:27 INFO DataNucleus.Persistence: ===========================================================
11/10/31 18:07:28 INFO Datastore.Schema: Creating table `DELETEME1320055648261`
11/10/31 18:07:28 INFO Datastore.Schema: Schema Name could not be determined for this datastore
11/10/31 18:07:28 INFO Datastore.Schema: Dropping table `DELETEME1320055648261`
11/10/31 18:07:28 INFO Datastore.Schema: Initialising Catalog "hive", Schema "" using "None" auto-start option
11/10/31 18:07:28 INFO Datastore.Schema: Catalog "hive", Schema "" initialised - managing 0 classes
11/10/31 18:07:28 INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
11/10/31 18:07:28 INFO DataNu

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值