Apache Hive Installation on Ubuntu

Apache hive installation on ubuntu

Steps to start Apache Hive 3.x installation on Ubuntu

cd /usr/localsudo wget http://apachemirror.wuchna.com/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gz
sudo tar xvzf apache-hive-3.1.2-bin.tar.gz
sudo mv apache-hive-3.1.2-bin hive

Next step is the addition of Hive Environment Variables

sudo nano ~/.bashrc
# Set HIVE_HOMEexport HIVE_HOME=/usr/local/hiveexport PATH=$PATH:$HIVE_HOME/bin
source ~/.bashrc
hdfs dfs -mkdir /bigdata/tmp
hdfs dfs -mkdir -p /bigdata/hive/warehouse
hdfs dfs -chmod g+w /bigdata/tmphdfs dfs -chmod g+w /bigdata/hive/warehouse

Steps to configuring the Hive …

cd /usr/local/hive/conf
  • hive-env.sh
sudo nano hive-env.sh
# Set HADOOP_HOME to point to a specific hadoop install directoryexport HADOOP_HOME=/usr/local/hadoop# Hive Configuration Directory can be controlled by:export HIVE_CONF_DIR=/usr/local/hive/conf# Java Homeexport JAVA_HOME=/usr

Metastore Configuration

sudo apt-get updatesudo apt-get install mysql-server
sudo mysql_secure_installation utility
sudo systemctl start mysql
sudo systemctl enable mysql
sudo apt-get install libmysql-java
ln -s /usr/share/java/mysql-connector-java.jar $HIVE_HOME/lib/mysql-connector-java.jar
mysql -u root -p
CREATE DATABASE metastore;USE metastore;SOURCE /usr/local/hive/scripts/metastore/upgrade/mysql/hive-schema-3.1.0.mysql.sql;
CREATE USER ‘hiveuser’@’%’ IDENTIFIED BY ‘hivepassword’;GRANT all on *.* to ‘hiveuser’@localhost identified by ‘hivepassword’;flush privileges;
  • hive-site.xml
cd /usr/local/hive/confsudo nano hive-site.xml
<configuration><property><name>javax.jdo.option.ConnectionURL</name><value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true</value><description>metadata is stored in a MySQL server</description></property><property><name>javax.jdo.option.ConnectionDriverName</name><value>com.mysql.jdbc.Driver</value><description>MySQL JDBC driver class</description></property><property><name>javax.jdo.option.ConnectionUserName</name><value>hiveuser</value><description>user name for connecting to mysql server</description></property><property><name>javax.jdo.option.ConnectionPassword</name><value>password</value><description>hivepassword for connecting to mysql server</description></property></configuration>
hive

Extras …

create table test(id int, name string);
mysql -u root -p
use metastore;select * from TBLS;

--

--

--

Accubits Technologies is an enterprise solutions development company focusing on AI and Blockchain technologies, based in Virginia, USA. https://accubits.com/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Fixing Intel compiler’s unfair CPU dispatcher (Part 1/2)

What is ELK Stack?

10 Questions You Should Ask A Software Outsourcing Company

Exhausted with Bugs? 8 Test Design Techniques You Need to Know

MongoDB: Godzilla of NoSQL

Photo by Samuel Scrimshaw on Unsplash

Announcing the new Wideping interface

How to Print Alphabet F in Python?

Found This Week #41

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Accubits Technologies Inc

Accubits Technologies Inc

Accubits Technologies is an enterprise solutions development company focusing on AI and Blockchain technologies, based in Virginia, USA. https://accubits.com/

More from Medium

Enabling MySQL Logs In The Linux Environment

Getting git to work in a Windows docker container

GitLab — Heroku CI/CD Pipeline in 10 minutes.