如何在hive-site.xml中映射Hive仓库路径?

时间:2018-07-24 23:01:42

标签: hadoop hive

我是ubuntu的新手,我正在尝试在系统上安装hive 3.0.0。 我正在关注互联网上的教程,遇到了这个命令。

hdfs dfs -mkdir -p /user/hive/warehouse
hdfs dfs -mkdir /tmp

此命令用于存储元数据。但是我在文件系统中找不到这些。

所以我的问题是,该命令的含义是什么? 以及如何在hive-site.xml上映射该元数据?

以下是我的教程中的hive-site.xml。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="confguration.xsl"?><!--
Licensed to the Apache Software Foundation (ASF) under one or more
contri utor license agreements. See the NOTICE fle distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this fle to You under the Apache License, Version 2.0
(the "License"); you may not use this fle except in compliance with
the License. You may o tain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required y applicable law or agreed to in writing, software-->




<confguration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true</value>
<description>
JDBC connect string for a JDBC metastore.
To use SSL to encrypt/authenticate the connection, provide database-specifc SSL fag in
the connection URL.
For example, jdbc:postgresql://myhost/d ?ssl=true for postgres database.
</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>javax.jdo.option.ConnectionUserName</name>
<value>hiveuser</value>
<description>Username to use against metastore database</description>
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>password@123</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>datanucleus.autoCreateSchema</name>
<value>true</value>
</property>
<property>
<name>datanucleus.fxedDatastore</name>


<value>true</value>
</property>
<property>
<name>datanucleus.autoCreateTables</name>
<value>True</value>
</property>
</confguration>

**我正在使用mysql存储元数据。请说明必要的更改(如果有)。

谢谢!!! **

1 个答案:

答案 0 :(得分:0)

  

此命令用于存储元数据

不完全是。那就是HDFS上的Hive Warehouse目录。这是原始数据而不是元数据存在的地方-完全在Mysql中。

HDFS由Hive所需的Hadoop客户端库的core-site.xml配置,而不是hive-site.xml文件

  

但是我在文件系统中找不到这些文件。

可能是因为这些是HDFS路径,而不是放置在本地文件系统上

  

此命令的含义是什么?

要创建存储Hive流程要使用的数据所需的默认仓库和临时暂存目录

相关问题