Besides the Hive metastore, Hive components could be broadly classified as Hive clients and Hive servers. Hive servers provide interfaces to make the metastore available to external applications and check for user's authorization and authentication, and Hive clients are various applications used to access and execute Hive queries on the Hadoop cluster.
The metastore service starts as a Java process in the backend. You can start the Hive metastore service with the following command:
hive --service metastore &
HiveServer2 is an interface that allows clients to execute Hive queries and get the result. It is based on Thrift RPC and supports multiple clients a against single client in HiveServer. It also provisioned for the authentication and authorization of the user.
The HiveServer2 service also starts as a Java process in the backend. You can start HiveServer2 with the following command:
hive --service hiveserver2 &
The following are the different clients available in Hive to query metastore data or to submit Hive queries to Hive servers.
Hive Command-line Interface (CLI) can be used to run Hive queries in either interactive or batch mode.
To run Hive CLI, use the following command:
$ HIVE_HOME/bin/hive
Queries are submitted by username of the user logged in to the UNIX system.