在我运行Hive的任何地方创建metastore_db [英] metastore_db created wherever I run Hive
问题描述
在我运行Hive查询的任何目录中创建文件夹 metastore_db
。有没有办法在一个定义的位置只有一个 metastore_db
,并阻止它在各个位置被创建?它与 hive.metastore.local
?
这里感兴趣的属性是 javax.jdo.option.ConnectionURL
。此属性的默认值是 jdbc:derby:; databaseName = metastore_db; create = true
。此值指定您将使用嵌入式德比作为您的Hive Metastore,并且Metastore的位置是 metastore_db
。如果它尚不存在,则会创建metastore。
metastore_db
)是相对路径。因此,它会在您启动Hive的地方创建。如果您将此属性(在您的hive-site.xml中)更新为某个位置的绝对路径,则会从该位置使用Metastore。 我必须警告您,尽管嵌入式德比肿瘤转移一次只能由一个用户访问。 Hive默认使用嵌入式德比来允许开箱即用的体验并且易于测试。对于任何实际的系统,我都会建议转移到像MySQL或PostgreSQL这样的独立真实数据库。有关如何做到这一点的说明可用这里。
Folder metastore_db
is created in any directory where I run Hive query. Is there any way to have only one metastore_db
in a defined location and stop it from being created all over the places? Does it have anything to do with hive.metastore.local
?
The property of interest here is javax.jdo.option.ConnectionURL
. The default value of this property is jdbc:derby:;databaseName=metastore_db;create=true
. This value specifies that you will be using embedded derby as your Hive metastore and the location of the metastore is metastore_db
. Also the metastore will be created if it doesn't already exist.
Note that the location of the metastore (metastore_db
) is a relative path. Therefore, it gets created where you launch Hive from. If you update this property (in your hive-site.xml) to be, say an absolute path to a location, the metastore will be used from that location.
I must warn you though that embedded derby metastore can only be accessed by one user at a time. Hive uses embedded derby by default to allow an out of the box experience and for ease of testing. For any practical system, I would recommend moving to standalone "real" database like MySQL or PostgreSQL. Instructions on how to do that are available here.
这篇关于在我运行Hive的任何地方创建metastore_db的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!