Look at this local metastore architecture:
[cid:87afe275-ff1d-4dc3-88ed-b2081163c512] If I set different database name in javax.jdo.option.ConnectionURL, say, "jdbc:mysql://xxxxx/hivemeta_1?createDatabaseIfNotExist=true&characterEncoding=UTF-8" and "jdbc:mysql://xxxxx/hivemeta_2?createDatabaseIfNotExist=true&characterEncoding=UTF-8", will the to metastore services work fine? In short, I want to use the same RDBMS database for the two hive metastore services, and the meta data is isolated form each other. How can I achieve that? ________________________________ 发件人: Peter Vary <pv...@cloudera.com> 发送时间: 2016年10月26日 0:49 收件人: user@hive.apache.org 主题: Re: Can I specify database name in hive metastore service? Hi Huang, Hive metastore is a component of the "Hive database". See: https://cwiki.apache.org/confluence/display/Hive/Design The metastore uses traditional RDBMS to store "the structure information of the various tables and partitions in the warehouse". The javax.jdo.option.ConnectionURL and the javax.jdo.option.ConnectionDriverName configuration options are used to access this RDBMS database. The hive.metastore.uris is the endpoint where the metastore will communicate with the other Hive components, like the HiveServer2. So you can change the database name in the connectionUrl, which will change only the database name where the metadata is stored in the relational database and you can not add a database name to the thrift uri (metastore uri) since HiveServer2 will use the same uri to access metadata regardless of which Hive database is used by the client. I hope this helps, Peter 2016. okt. 25. 17:32 ezt írta ("Huang Meilong" <ims...@outlook.com<mailto:ims...@outlook.com>>): Hi, To use hive metastore service, I must set `javax.jdo.option.ConnectionURL`, `javax.jdo.option.ConnectionDriverName` and `hive.metastore.uris` in hive-site.xml, like this: <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://xxxxx/hivemeta?createDatabaseIfNotExist=true&characterEncoding=UTF-8</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <property> <name>hive.metastore.uris</name> <value>thrift://xxx:9083</value> </property> I'm confused that can I change the database name (usually it's `hivemeta`) for other names? If I changed the database name from `hivemeta` to `my_hivemeta`, can hive metastore work? We can not specify database name in `hive.metastore.uris`, we can only specify hostname and port of metastore service.