vmwarehadoop

Connect to Hive

The Bitnami Hadoop Stack includes Hive, Pig and Spark, and starts HiveServer2, Metastore and WebHCat by default.

Connect to HiveServer2

HiveServer2 is a server interface that enables remote clients to execute queries against Hive and retrieve the results. It listens to port 10000 by default.

In order to connect to HiveServer2, you have two options:

  • (Recommended): Connect to the HiveServer2 Thrift server (running on port 10000) through an SSH tunnel (refer to the FAQ for more information about SSH tunnels).
  • Open the HiveServer2 Thrift server’s port 10000 for remote access (refer to the FAQ for more information about opening ports).

Once you have connected to the server through an SSH tunnel or you opened the port to allow the remote access, you can use the Beeline command-line utility. To connect to HiveServer2 using Beeline, run the following:

  • Connecting to HiveServer2 through an SSH tunnel:

    $ beeline -u jdbc:hive2://localhost:10000 -n hadoop
    
  • Connecting to HiveServer2 by opening the port 10000. (SERVER-IP is a placeholder, please replace it with the right value).

    $ beeline -u jdbc:hive2://SERVER-IP:10000 -n hadoop
    

After some seconds, you will be able to access the prompt:

0: jdbc:hive2://localhost:10000>

Access the HiveServer2 Web UI

HiveServer2 has a Web UI which provides different features, such as logging, metrics and configuration information. It listens on port 10002. In order to access it, you have two options:

  • (Recommended) Access the HiveServer2 Web UI (running on port 10002) through an SSH tunnel (refer to the FAQ for more information about SSH tunnels).
  • Open the HiveServer2 port 10002 for remote access (refer to the FAQ for more information about opening ports).

Access WebHCat

HCatalog is a table and storage management layer for Hadoop. HCatalog is built on top of Metastore, another component of Hadoop. WebHCat is the REST API for HCatalog, and listens to port 50111 by default.

In order to access HCatalog, you have two options:

  • (Recommended): Access the WebHCat server (running on port 50111) through an SSH tunnel (refer to the FAQ for more information about SSH tunnels).
  • Open the WebHCat port 50111 for remote access (refer to the FAQ for more information about opening ports).

You can access WebHCat with the following commands:

  • Connecting to HCatalog through an SSH tunnel:

    $ curl -s 'http://localhost:50111/templeton/v1/status?user.name=hadoop'
    
  • Connecting to HCatalog by opening the port 50111 (SERVER-IP is a placeholder, please replace it with the right value).

    $ curl -s 'http://SERVER-IP:50111/templeton/v1/status?user.name=hadoop'
    

You should see the following output:

{"version":"v1","status":"ok"}'
Last modification July 24, 2019