How to download old hive version - long
Installing Apache Hive on Windows 10
A step-by-step guide to install Apache Hive on Windows 10 operating system
While working on a project, we were asked to install Apache Hive on a Windows 10 operating system. Many guides were found online but unfortunately, they didn’t work. For this reason, I decided to write a step-by-step guide to help others.
The starting point of this guide was from a great video I found on Youtube which provides a working scenario for Hive 2.x without much detail.
7zip
In order to extract www.cronistalascolonias.com.ar archives, you should install the 7zip tool.
Installing Hadoop
To install Apache Hive, you must have a Hadoop Cluster installed and running: You can refer to our previously published step-by-step guide to install Hadoop on Windows
Apache Derby
In addition, Apache Hive requires a relational database to create its Metastore (where all metadata will be stored). In this guide, we will use the Apache Derby database 4.
Since we have Java 8 installed, we must install Apache Derby version (check downloads page) which can be downloaded from the following link.
Once downloaded, we must extract twice (using 7zip: the first time we extract the www.cronistalascolonias.com.ar file, the second time we extract the .tar file) the content of the www.cronistalascolonias.com.ar archive into the desired installation directory. Since in the previous guide we have installed Hadoop within “E:\hadoop-env\hadoop\” directory, we will extract Derby into “E:\hadoop-env\db-derby\” directory.
Cygwin
Since there are some Hive tools that aren’t compatible with Windows (such as schematool). We will need the Cygwin tool to run some Linux commands.
In order to download Apache Hive binaries, you should go to the following website: www.cronistalascolonias.com.ar Then, download the www.cronistalascolonias.com.ar file.
When the file download is complete, we should extract twice (as mentioned above) the www.cronistalascolonias.com.ar archive into “E:\hadoop-env\apache-hive” directory (Since we decided to use E:\hadoop-env\” as the installation directory for all technologies used in the previous guide.
After extracting Derby and Hive archives, we should go to Control Panel > System and Security > System. Then Click on “Advanced system settings”.
In the advanced system settings dialog, click on “Environment variables” button.
Now we should add the following user variables:
- HIVE_HOME: “E:\hadoop-env\apache-hive\”
- DERBY_HOME: “E:\hadoop-env\db-derby\”
- HIVE_LIB: “%HIVE_HOME%\lib”
- HIVE_BIN: “%HIVE_HOME%\bin”
- HADOOP_USER_CLASSPATH_FIRST: “true”
Besides, we should add the following system variable:
- HADOOP_USER_CLASSPATH_FIRST: “true”
Now, we should edit the Path user variable to add the following paths:
- %HIVE_BIN%
- %DERBY_HOME%\bin
Copy Derby libraries
Now, we should go to the Derby libraries directory (E:\hadoop-env\db-derby\lib) and copy all *.jar files.
Then, we should paste them within the Hive libraries directory (E:\hadoop-env\apache-hive\lib).
Configuring www.cronistalascolonias.com.ar
Now, we should go to the Apache Hive configuration directory (E:\hadoop-env\apache-hive\conf) create a new file “www.cronistalascolonias.com.ar”. We should paste the following XML code within this file:
<?xml version=""?><?xml-stylesheet type="text/xsl" href="www.cronistalascolonias.com.ar"?>
<configuration><property> <name>www.cronistalascolonias.com.artionURL</name>
<value>jdbc:derby://localhost/metastore_db;create=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property><property>
<name>www.cronistalascolonias.com.artionDriverName</name>
<value>www.cronistalascolonias.com.arDriver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>www.cronistalascolonias.com.ar</name>
<description>Enable user impersonation for HiveServer2</description>
<value>true</value>
</property>
<property>
<name>www.cronistalascolonias.com.artication</name>
<value>NONE</value>
<description> Client authentication types. NONE: no authentication check LDAP: LDAP/AD based authentication KERBEROS: Kerberos/GSSAPI authentication CUSTOM: Custom authentication provider (Use with property www.cronistalascolonias.com.ar) </description>
</property>
<property>
<name>www.cronistalascolonias.com.areateTables</name>
<value>True</value>
</property>
</configuration>
Hadoop Services
To start Apache Hive, open the command prompt utility as administrator. Then, start the Hadoop services using start-dfs and start-yarn commands (as illustrated in the Hadoop installation guide).
Derby Network Server
Then, we should start the Derby network server on the localhost using the following command:
E:\hadoop-env\db-derby\bin\StartNetworkServer -hNow, let try to open a command prompt tool and go to the Hive binaries directory (E:\hadoop-env\apache-hive\bin) and execute the following command:
hiveWe will receive the following error:
'hive' is not recognized as an internal or external command, operable program or batch file.This error is thrown since the Hive 3.x version is not built for Windows (only in some Hive 2.x versions). To get things working, we should download the necessary *.cmd files from the following link: www.cronistalascolonias.com.ar Note that, you should keep the folder hierarchy (bin\ext\util).
You can download all *.cmd files from the following GitHub repository
Now if we try to execute the “hive” command, we will receive the following error:
Exception in thread "main" www.cronistalascolonias.com.arMethodError: www.cronistalascolonias.com.arrgument(ZLjava/lang/String;Ljava/lang/Object;)Vat www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.arByClass(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.arf.<init>(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.arlize(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.arnf.<init>(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.arhemaTool.<init>(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar0(Native Method)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
at www.cronistalascolonias.com.ar(www.cronistalascolonias.com.ar)
This error is thrown due to a Bug mentioned in the following Hive issue link: HIVE
As mentioned in the comments, this issue can be solved by replacing the guavajar stored in “E:\hadoop-env\apache-hive\lib” with Hadoop’s www.cronistalascolonias.com.ar found in “E:\hadoop-env\hadoop\share\hadoop\hdfs\lib”.
Note: This file is also uploaded to the GitHub repository mentioned above.
Now, if we run hive command again, then Apache Hive will start successfully.
After ensuring that the Apache Hive started successfully. We may not be able to run any HiveQL command. This is because the Metastore is not initialized yet. Besides HiveServer2 service must be running.
To initialize Metastore, we need to use schematool utility which is not compatible with windows. To solve this problem, we will use Cygwin utility which allows executing Linux command from windows.
Creating symbolic links
First, we need to create the following directories:
Now, open the command prompt as administrator and execute the following commands:
mklink /J E:\cygdrive\e\ E:\mklink /J C:\cygdrive\c\ C:\
These symbolic links are needed to work with Cygwin utility properly since Java may cause some problems.
Initializing Hive Metastore
Open Cygwin utility and execute the following commands to define the environment variables:
export HADOOP_HOME='/cygdrive/e/hadoop-env/hadoop'export PATH=$PATH:$HADOOP_HOME/bin
export HIVE_HOME='/cygdrive/e/hadoop-env/apache-hive'
export PATH=$PATH:$HIVE_HOME/bin
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/*.jar
We can add these lines to the “~/.bashrc” file then you don’t need to write them each time you open Cygwin.
Now, we should use the schematool utility to initialize the Metastore:
$HIVE_HOME/bin/schematool -dbType derby -initSchemaStarting HiveServer2 service
Now, open a command prompt and run the following command:
hive --service hiveserver2 startWe should leave this command prompt open, and open a new one where we should start Apache Hive using the following command:
hiveStarting WebHCat Service (Optional)
In the project we are working on, we need to execute HiveQL statement from SQL Server Integration Services which can access Hive from the WebHCat server.
To start the WebHCat server, we should open the Cygwin utility and execute the following command:
$HIVE_HOME/hcatalog/sbin/webhcat_www.cronistalascolonias.com.ar start- www.cronistalascolonias.com.ar QA Website
- Apache Hive official Website
- Youtube: EASY HIVE INSTALLATION ON WINDOWS
- www.cronistalascolonias.com.ar: Apache Hive Installation on Windows 10 Step by Step Guide
-
-
-