Sunday, November 13, 2016

Hive installation

Hive is based on Hadoop. Before you install and run Hive, make sure Hadoop is up and running.

  • Download and unpack it
  • Add Hive to the system path by opening /etc/profile or ~/.bashrc and add the following two rows
    • export HIVE_HOME=/home/yao/mysoft/apache-hive-2.1.0-bin
    • export PATH=$PATH:$HIVE_HOME/bin:$HIVE_HOME/conf
  • Enable the settings by executing this command
    • source /etc/profile 
  • Create the configuration files
    • cd conf
    • cp hive-default.xml.template hive-site.xml
    • cp
    • cp
    • cp
  • Modify the configuration file
    • replace <value>${}/${}</value>  with <value>$HIVE_HOME/iotmp</value>
    • replace <value>${}/${}_resources</value> with <value>$HIVE_HOME/iotmp</value>
    • replace <value>${}/${}</value> with <value>$HIVE_HOME/iotmp</value>
    • you may need create the directory iotmp
  • Modify
    • add these two
    • export HADOOP_HOME=/home/yao/mysoft/hadoop-2.7.3
    • export HIVE_CONF_DIR=/home/yao/mysoft/apache-hive-2.1.0-bin/conf
  • Make sure Hadoop is running
  • Run Hive
    •  $HIVE_HOME/bin/hiveserver2
  • Run beeline  
    • $HIVE_HOME/bin/beeline -u jdbc:hive2://

No comments:

Post a Comment