Apache Hive 2.1 Installation with TroubleShooting


Apache Hive is considered the defacto standard for interactive SQL queries over petabytes of data in Hadoop.Apache Hive 2.1 was released almost about a year ago,in this blog i will tell you all the installation steps for apache hive 2.1

lets get started first of all download apache hive 2.1 release from here https://hive.apache.org/downloads.html now lets start with following steps

  • extract the tar file that you downloaded
  • set your hive_home path in your bash rc
  • add HADOOP_HOME variable in your hadoop-env.sh other wise you will get the exception
    "Cannot find hadoop installation: $HADOOP_HOME must be set or hadoop must be in the path"
    
  • Disable The Schema Version Verification

    Hive now records the schema version in the metastore database and verifies that the metastore schema version is compatible with the Hive binaries that are going to access the metastore. The Hive properties to implicitly create or alter the existing schema are disabled by default. Hence, Hive will not attempt to change the metastore schema implicitly. When you execute a Hive query against an old schema, it will fail to access the metastore displaying an error message as follows:

    $ hduser@knoldus:/home/knoldus/Documents/apache-hive-2.1.1-bin$ hive -e "show tables"
    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
    

    The error log will contain an entry similar to the following:

    ...
    Caused by: MetaException(message:Version information not found in metastore. )
            at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:5638)
    ...

    To suppress the schema check and allow the metastore to implicitly modify the schema, you need to set thehive.metastore.schema.verification configuration property to false in hive-site.xml create this file if not there

  • initilize the derby schema with following command
    schematool -initSchema -dbType derby

    blog.pngnote:your metastore will be created in the directory from where you hit this command i create metastore in my hive root directory

    this is the most common problem with most of users

  • blog2It is because you’re not in the same folder where you have created your metadata. I was facing the same problem for many hours
  • if you get the error FUNCTION ‘NUCLEUS_ASCII’ already exists when running this command delete the metastore_db folder
  • delete the duplicated log4j-slf4j jar from hive lib folder because it is already there in hadoop we will use hadoop one,other wise you will get the exception for multiple bindings
  • now start hive cli launch it from directory where you created the derby metastoreblog3

i hope this blog will be helpfull for starters

KNOLDUS-advt-sticker

Advertisements
This entry was posted in Scala. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s