Database Reference
In-Depth Information
Figure 17-1. Hive architecture
The Metastore
The
metastore
is the central repository of Hive metadata. The metastore is divided into
two pieces: a service and the backing store for the data. By default, the metastore service
runs in the same JVM as the Hive service and contains an embedded Derby database in-
stance backed by the local disk. This is called the
embedded metastore
configuration (see
Figure 17-2
)
.
Using an embedded metastore is a simple way to get started with Hive; however, only one
embedded Derby database can access the database files on disk at any one time, which
means you can have only one Hive session open at a time that accesses the same
metastore. Trying to start a second session produces an error when it attempts to open a
connection to the metastore.
The solution to supporting multiple sessions (and therefore multiple users) is to use a stan-
dalone database. This configuration is referred to as a
local metastore
, since the metastore
service still runs in the same process as the Hive service but connects to a database run-
ning in a separate process, either on the same machine or on a remote machine. Any
JDBC-compliant database may be used by setting the
javax.jdo.option.*
config-
uration properties listed in
Table 17-1
.
[
108
]