Apache Hive overview
Also available as:
PDF

Install the Hive service

In Ambari, you install the Hive service as you would any other service, and in the process, you configure Hive to use a database for the Hive Metastore.

  1. Configure a database for the Hive Metastore.
    • Choose to use an existing database suitable for production work and perform the next step.
    • Choose an Ambari installed database, such as MySQL, suitable for development work only, and skip the next step.
  2. If you chose an existing database in the last step, create a hive user and database.
    If Ambari installs the database, you do not need to create a hive user and database.
    For example, create user named hive and a database named hive, using the following command, but substituting a password of your choosing for [HIVE_PASSWORD] and the Hive MetaStore FQDN for [HIVE_METASTORE_FQDN]:
     # mysql -u root -p
     CREATE USER 'hive'@'localhost' IDENTIFIED BY '[HIVE_PASSWORD]';
     GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost';
                        
     CREATE USER 'hive'@'%' IDENTIFIED BY '[HIVE_PASSWORD]';
     GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
                        
     CREATE USER 'hive'@'[HIVE_METASTORE_FQDN]' IDENTIFIED BY '[HIVE_PASSWORD]';
     GRANT ALL PRIVILEGES ON *.* TO 'hive'@'[HIVE_METASTORE_FQDN]';
                        
     FLUSH PRIVILEGES;
                        
     CREATE DATABASE hive;
  3. Obtain the JDBC driver for the database to the Ambari server node, and as root, set up the driver:
    ambari-server setup --jdbc-db=<database name> --jdbc-driver=<path to driver>
  4. In Ambari Services > Hive > Configs, test the connection to the database.
  5. Follow prompts from the Ambari wizard to complete the installation.