MapR 5.0 Documentation : Managing Hive Services

This page includes the following topics:

Starting Hive

You can start the Hive shell from HIVE_HOME/bin/ with the hive command. Example:

/opt/mapr/hive/hive-<version>/bin/hive

When the Hive shell starts, it reads an initialization file called .hiverc which is located in the HIVE_HOME/bin/ or $HOME/ directories. You can edit this file to set custom parameters or commands that initialize the Hive command-line environment, one command per line.

When you run the Hive shell, you can specify a MySQL initialization script file using the -i option. Example:

/opt/mapr/hive/hive-<version>/bin/hive -i <filename>

Managing Hive Metastore

The Hive Metastore is started automatically by the warden at installation time if the mapr-hivemetastore package is installed. It is sometimes necessary to start or stop the service (for example, after changing the configuration). You can start and stop Hive Metastore in two ways:

  • Using the maprcli node services command - Using this command, you can start Hive Metastore on multiple nodes at one time.
  • Using the MapR Control System

To start Hive Metastore using the maprcli:

  1. Make a list of nodes on which Hive Metastore is configured.
  2. Issue the maprcli node services command:

     maprcli node services -name hivemeta -action start -nodes <space delimited list of nodes>

To stop Hive Metastore using the maprcli:

  1. Make a list of nodes on which Hive Metastore is configured.
  2. Issue the maprcli node services command:

     maprcli node services -name hivemeta -action stop -nodes <space delimited list of nodes>

To start or stop Hive Metastore using the MapR Control System:

  1. In the Navigation pane, expand the Cluster Views pane and click Dashboard.
  2. In the Services pane, click Hive Metastore to open the Nodes screen displaying all the nodes on which Hive Metastore is configured.
  3. On the Nodes screen, click the hostname of each node to display its Node Properties screen.
  4. On each Node Properties screen, use the Stop/Start button in the Hive Metastore row under Manage Node Services to start Hive Metastore.

Managing Hiveserver2

Hiveserver2 is started automatically at installation time by the warden if the mapr-hiveserver2 package is installed. It is sometimes necessary to start or stop the service (for example, after changing the configuration). You can start and stop Hiveserver2 in two ways:

  • Using the maprcli node services command - Using this command, you can start Hiveserver2 on multiple nodes at one time.
  • Using the MapR Control System

To start Hiveserver2 using the maprcli:

  1. Make a list of nodes on which Hiveserver2 is configured.
  2. Issue the maprcli node services command:

     maprcli node services -name hs2 -action start -nodes <space delimited list of nodes>

To stop Hiveserver2 using the maprcli:

  1. Make a list of nodes on which Hiveserver2 is configured.
  2. Issue the maprcli node services command:

     maprcli node services -name hs2 -action stop -nodes <space delimited list of nodes>

To start or stop Hiveserver2 using the MapR Control System:

  1. In the Navigation pane, expand the Cluster Views pane and click Dashboard.
  2. In the Services pane, click Hiveserver2 to open the Nodes screen displaying all the nodes on which Hiveserver2 is configured.
  3. On the Nodes screen, click the hostname of each node to display its Node Properties screen.
  4. On each Node Properties screen, use the Stop/Start button in the Hiveserver2 row under Manage Node Services to start Hiveserver2.