Unable to get past step 9 – Hive Metastore start – fails

to create new topics or reply. | New User Registration

This topic contains 14 replies, has 6 voices, and was last updated by  Brenda Bell 1 month, 4 weeks ago.

  • Creator
    Topic
  • #58733

    Mark Boddy
    Participant

    Error is that the Hive Metastore does not start and I see this:

    stderr: /var/lib/ambari-agent/data/errors-85.txt

    2014-08-13 17:04:13,454 – Error while executing command ‘start':
    Traceback (most recent call last):
    File “/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py”, line 111, in execute
    method(env)
    File “/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_metastore.py”, line 42, in start
    self.configure(env) # FOR SECURITY
    File “/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_metastore.py”, line 37, in configure
    hive(name=’metastore’)
    File “/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py”, line 108, in hive
    not_if = check_schema_created_cmd
    File “/usr/lib/python2.6/site-packages/resource_management/core/base.py”, line 148, in __init__
    self.env.run()
    File “/usr/lib/python2.6/site-packages/resource_management/core/environment.py”, line 149, in run
    self.run_action(resource, action)
    File “/usr/lib/python2.6/site-packages/resource_management/core/environment.py”, line 115, in run_action
    provider_action()
    File “/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py”, line 239, in action_run
    raise ex
    Fail: Execution of ‘export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED]’ returned 1. Metastore connection URL: jdbc:mysql://hadoop.monicoinc.local/hive?createDatabaseIfNotExist=true
    Metastore Connection Driver : com.mysql.jdbc.Driver
    Metastore connection User: hive
    org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
    *** schemaTool failed ***

    stdout: /var/lib/ambari-agent/data/output-85.txt – (actual text of this file is output)

Viewing 14 replies - 1 through 14 (of 14 total)

You must be to reply to this topic. | Create Account

  • Author
    Replies
  • #70985

    Brenda Bell
    Participant

    I’m having this same issue, but my scenario is during an automated installation from a blueprint that was exported from a running instance.

    I’m using Ambari 1.7.0 and HDP 2.2. Of the 96 tasks submitted when I post my blueprint, 81 are successful. Then I hit this error on task 82:


    Fail: Execution of 'export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/hdp/current/hive-client/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED]' returned 1. 15/05/02 15:32:14 WARN conf.HiveConf: HiveConf of name hive.optimize.mapjoin.mapreduce does not exist
    15/05/02 15:32:14 WARN conf.HiveConf: HiveConf of name hive.heapsize does not exist
    15/05/02 15:32:14 WARN conf.HiveConf: HiveConf of name hive.server2.enable.impersonation does not exist
    15/05/02 15:32:14 WARN conf.HiveConf: HiveConf of name hive.auto.convert.sortmerge.join.noconditionaltask does not exist
    Metastore connection URL: jdbc:mysql://bbtestmgmt0.bbtest.ruetracking.com/hive?createDatabaseIfNotExist=true
    Metastore Connection Driver : com.mysql.jdbc.Driver
    Metastore connection User: hive
    org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
    *** schemaTool failed ***

    Is there a way to fix the root cause in my blueprint? Or some other way to *fix* the environment before the blueprint starts to post?

    Collapse
    #68813

    Alejandro Fernandez
    Participant

    +1 on Chakra Sankaraiah’s comment.
    I ran into the same problem,

    Step 1, enable verbosity. E.g.,
    $ export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/hdp/current/hive-metastore/bin/schematool -dbType mysql -userName hive -passWord xxxx -initSchema -verbose
    Caused by: java.sql.SQLException: Access denied for user 'hive'@'localhost' (using password: YES)

    Step 2) Grant permissions if needed
    mysql -uroot
    GRANT ALL ON *.* to 'hive'@'localhost' IDENTIFIED BY 'xxxx';
    exit;

    Step 3) Run the command again,
    Initialization script completed
    schemaTool completed

    Collapse
    #67011

    Chakra Sankaraiah
    Participant

    There could be multiple reasons for why you might be getting schema tool failed.

    Best way to know what the error is to run the verbose command as mentioned below —

    /usr/hdp/current/hive-client/bin/schematool -initSchema -dbType mysql -userName hive -passWord chakra -verbose

    This was the error that showed up for me –>
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ‘hive’@’%’ to database ‘hive’

    So logged into mysql and created a new user and password
    mysql> create user ‘hive1’@’%’ identified by ‘hive1′;
    mysql> grant all privileges on hive.* to hive1;
    mysql> flush privileges;

    Then logged into Ambari and changed the userid and password to hive1 & hive1.
    Was able to restart the hive service.

    Collapse
    #59703

    Bharath Putta
    Participant

    Finally got it working. All i had to do was add mysql port to jdbc url in /etc/alternatives/hive-conf/hive-site.xml.

    Please let me know better way to fix this.

    Collapse
    #59701

    Bharath Putta
    Participant

    When i run command manually on command prompt after creating user, database hive and granting privileges, they run fine. But how do i make this run through Ambari?

    export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -initSchema -dbType mysql -userName hive -passWord *****

    Collapse
    #59700

    Bharath Putta
    Participant

    Am trying to install 2.1.5 and struggling to get hive metastore start. Created hive database, gave all permissions to hive user. if anyone has got this error and resolved it could you please share.

    2014-09-03 05:51:43,108 – Error while executing command ‘start':
    Traceback (most recent call last):
    File “/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py”, line 111, in execute
    method(env)
    File “/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_metastore.py”, line 42, in start
    self.configure(env) # FOR SECURITY
    File “/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_metastore.py”, line 37, in configure
    hive(name=’metastore’)
    File “/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py”, line 108, in hive
    not_if = check_schema_created_cmd
    File “/usr/lib/python2.6/site-packages/resource_management/core/base.py”, line 148, in __init__
    self.env.run()
    File “/usr/lib/python2.6/site-packages/resource_management/core/environment.py”, line 149, in run
    self.run_action(resource, action)
    File “/usr/lib/python2.6/site-packages/resource_management/core/environment.py”, line 115, in run_action
    provider_action()
    File “/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py”, line 239, in action_run
    raise ex
    Fail: Execution of ‘export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED]’ returned 1. Exception in thread “main” java.lang.NoSuchFieldError: METASTORE_SCHEMA_VERIFICATION
    at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:469)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

    Collapse
    #59003

    Mark Boddy
    Participant

    Alejandro,

    Ultimately, I created the Hive user in MySQL manually and that got me past this so that I was able to complete the install.

    Thank-You for your help!
    Mark

    Collapse
    #58837

    Alejandro Fernandez
    Participant

    You can also try to run the schematool command that is failing, with some additional flags

    /usr/lib/hive/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED] -verbose -dryRun
    /usr/lib/hive/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED] -verbose

    Collapse
    #58835

    Mark Boddy
    Participant

    Hello Alejandro,

    I uninstalled everything and started over again just to make sure that MySQL was running. It was, nothing has changed, I get the same error.

    Thanks for the follow up, I am still looking through log files to see if I’ve missed anything.
    Mark

    Collapse
    #58818

    Alejandro Fernandez
    Participant

    Hi Mark, any update on whether the mysqld service was running at the time of installation, or if it works after retrying while mysqld is running?

    Collapse
    #58774

    Mark Boddy
    Participant

    Hello Alejandro,

    Yes, I did install Hive and selected to use a new MySQL database and mysqld is running…I don’t recall it being installed prior to starting the Ambari installation but I will check to make sure it was not.

    Collapse
    #58770

    Alejandro Fernandez
    Participant

    Hi Mark, I’m guessing you installed Hive and selected to use a new MySQL database.
    Can you check if the mysqld service is running?
    > /sbin/service mysqld status
    If you have an existing installation of sql, it may be called “mysql” without the “d”

    Collapse
    #58745

    Mark Boddy
    Participant

    My apologies, those *minor” details…

    1. CentOS 6.5
    2. Ambari 1.6.1-98
    3. HDP 2.1 stack
    4. I am having Ambari install the MySQL instance for me using defaults, database=hive, user=hive.

    I have updated the OS and chose what I thought were the basic default options throughout. and only running on a single server.

    Thank-you!

    Collapse
    #58735

    Jeff Sposetti
    Moderator

    Hi, a few questions:

    1) Which OS?
    2) What version of Ambari?
    3) What Stack did you choose?
    4) You are using an existing MySQL or having Ambari install the MySQL instance for you?

    Thanks.

    Collapse
Viewing 14 replies - 1 through 14 (of 14 total)
Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.