You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ambari.apache.org by Kaliyug Antagonist <ka...@gmail.com> on 2015/11/05 12:06:44 UTC

Hive service not starting

I have installed HDP 2.3 using Ambari 2.1.2.

When I attempt to start the Hive Metastore, I get :

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

Traceback (most recent call last):
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
line 219, in <module>
    HiveMetastore().execute()
  File
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
line 219, in execute
    method(env)
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
line 55, in start
    self.configure(env)  # FOR SECURITY
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
line 66, in configure
    hive(name = 'metastore')
  File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py",
line 89, in thunk
    return fn(*args, **kwargs)
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py",
line 292, in hive
    user = params.hive_user
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py",
line 154, in __init__
    self.env.run()
  File
"/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
line 152, in run
    self.run_action(resource, action)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
line 118, in run_action
    provider_action()
  File
"/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py",
line 260, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
70, in inner
    result = function(command, **kwargs)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
92, in checked_call
    tries=tries, try_sleep=try_sleep)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
140, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
291, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of 'export
HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ;
/usr/hdp/current/hive-metastore/bin/schematool -initSchema -dbType mysql
-userName hive -passWord [PROTECTED]' returned 1. WARNING: Use "yarn jar"
to launch YARN applications.
Metastore connection URL: jdbc:mysql://
l1033lab.sss.se.company.com:3306/hive?createDatabaseIfNotExist=true
Metastore Connection Driver : com.mysql.jdbc.Driver
Metastore connection User: hive
org.apache.hadoop.hive.me


In the Hive config., I have selected 'New MySQL database'.

On the machine l1033lab, there is a MySQL running :


[root@l1033lab ~]# mysql -u hive
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 441
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.

mysql>
mysql>
mysql> select
User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv from
mysql.user;
+------+-------------+-------------+-------------+-------------+-------------+
| User | Select_priv | Insert_priv | Update_priv | Delete_priv |
Create_priv |
+------+-------------+-------------+-------------+-------------+-------------+
| root | Y           | Y           | Y           | Y           | Y
  |
| root | Y           | Y           | Y           | Y           | Y
  |
| root | Y           | Y           | Y           | Y           | Y
  |
| hive | Y           | Y           | Y           | Y           | Y
  |
+------+-------------+-------------+-------------+-------------+-------------+
4 rows in set (0.00 sec)

mysql>
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

How shall I proceed ?

Re: Hive service not starting

Posted by Adhi Tj <mi...@gmail.com>.
I have problem too. I fix it with flush privileges to hive database. If you
have same problem i think you must backup your hive database and delete
your hive database. Try to running your service again.

Best regards
On Nov 5, 2015 7:07 PM, "Steve Howard" <st...@gmail.com> wrote:

> MySQL has differing user permissions based on the origin of the request.
> Ambari should do this for you when it connects as a privileged user, but
> try connecting as root to MySQL, then issue...
>
>
> grant all on hive.* to 'hive@'your_ambari_host_ip' identified by
> 'your_hive_password';
> flush privileges;
>
> On Thu, Nov 5, 2015 at 6:06 AM, Kaliyug Antagonist <
> kaliyugantagonist@gmail.com> wrote:
>
>> I have installed HDP 2.3 using Ambari 2.1.2.
>>
>> When I attempt to start the Hive Metastore, I get :
>>
>> stderr:   /var/lib/ambari-agent/data/errors-811.txt
>>
>> Traceback (most recent call last):
>>   File
>> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
>> line 219, in <module>
>>     HiveMetastore().execute()
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
>> line 219, in execute
>>     method(env)
>>   File
>> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
>> line 55, in start
>>     self.configure(env)  # FOR SECURITY
>>   File
>> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
>> line 66, in configure
>>     hive(name = 'metastore')
>>   File
>> "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line
>> 89, in thunk
>>     return fn(*args, **kwargs)
>>   File
>> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py",
>> line 292, in hive
>>     user = params.hive_user
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line
>> 154, in __init__
>>     self.env.run()
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
>> line 152, in run
>>     self.run_action(resource, action)
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
>> line 118, in run_action
>>     provider_action()
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py",
>> line 260, in action_run
>>     tries=self.resource.tries, try_sleep=self.resource.try_sleep)
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
>> 70, in inner
>>     result = function(command, **kwargs)
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
>> 92, in checked_call
>>     tries=tries, try_sleep=try_sleep)
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
>> 140, in _call_wrapper
>>     result = _call(command, **kwargs_copy)
>>   File
>> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
>> 291, in _call
>>     raise Fail(err_msg)
>> resource_management.core.exceptions.Fail: Execution of 'export
>> HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ;
>> /usr/hdp/current/hive-metastore/bin/schematool -initSchema -dbType mysql
>> -userName hive -passWord [PROTECTED]' returned 1. WARNING: Use "yarn jar"
>> to launch YARN applications.
>> Metastore connection URL: jdbc:mysql://
>> l1033lab.sss.se.company.com:3306/hive?createDatabaseIfNotExist=true
>> Metastore Connection Driver : com.mysql.jdbc.Driver
>> Metastore connection User: hive
>> org.apache.hadoop.hive.me
>>
>>
>> In the Hive config., I have selected 'New MySQL database'.
>>
>> On the machine l1033lab, there is a MySQL running :
>>
>>
>> [root@l1033lab ~]# mysql -u hive
>> Welcome to the MySQL monitor.  Commands end with ; or \g.
>> Your MySQL connection id is 441
>> Server version: 5.1.73 Source distribution
>>
>> Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights
>> reserved.
>>
>> Oracle is a registered trademark of Oracle Corporation and/or its
>> affiliates. Other names may be trademarks of their respective
>> owners.
>>
>> Type 'help;' or '\h' for help. Type '\c' to clear the current input
>> statement.
>>
>> mysql>
>> mysql>
>> mysql> select
>> User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv from
>> mysql.user;
>>
>> +------+-------------+-------------+-------------+-------------+-------------+
>> | User | Select_priv | Insert_priv | Update_priv | Delete_priv |
>> Create_priv |
>>
>> +------+-------------+-------------+-------------+-------------+-------------+
>> | root | Y           | Y           | Y           | Y           | Y
>>     |
>> | root | Y           | Y           | Y           | Y           | Y
>>     |
>> | root | Y           | Y           | Y           | Y           | Y
>>     |
>> | hive | Y           | Y           | Y           | Y           | Y
>>     |
>>
>> +------+-------------+-------------+-------------+-------------+-------------+
>> 4 rows in set (0.00 sec)
>>
>> mysql>
>> mysql> show databases;
>> +--------------------+
>> | Database           |
>> +--------------------+
>> | information_schema |
>> | mysql              |
>> | test               |
>> +--------------------+
>> 3 rows in set (0.00 sec)
>>
>> How shall I proceed ?
>>
>>
>>
>

Re: Hive service not starting

Posted by Steve Howard <st...@gmail.com>.
MySQL has differing user permissions based on the origin of the request.
Ambari should do this for you when it connects as a privileged user, but
try connecting as root to MySQL, then issue...


grant all on hive.* to 'hive@'your_ambari_host_ip' identified by
'your_hive_password';
flush privileges;

On Thu, Nov 5, 2015 at 6:06 AM, Kaliyug Antagonist <
kaliyugantagonist@gmail.com> wrote:

> I have installed HDP 2.3 using Ambari 2.1.2.
>
> When I attempt to start the Hive Metastore, I get :
>
> stderr:   /var/lib/ambari-agent/data/errors-811.txt
>
> Traceback (most recent call last):
>   File
> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
> line 219, in <module>
>     HiveMetastore().execute()
>   File
> "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
> line 219, in execute
>     method(env)
>   File
> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
> line 55, in start
>     self.configure(env)  # FOR SECURITY
>   File
> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
> line 66, in configure
>     hive(name = 'metastore')
>   File
> "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line
> 89, in thunk
>     return fn(*args, **kwargs)
>   File
> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py",
> line 292, in hive
>     user = params.hive_user
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line
> 154, in __init__
>     self.env.run()
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
> line 152, in run
>     self.run_action(resource, action)
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
> line 118, in run_action
>     provider_action()
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py",
> line 260, in action_run
>     tries=self.resource.tries, try_sleep=self.resource.try_sleep)
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
> 70, in inner
>     result = function(command, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
> 92, in checked_call
>     tries=tries, try_sleep=try_sleep)
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
> 140, in _call_wrapper
>     result = _call(command, **kwargs_copy)
>   File
> "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
> 291, in _call
>     raise Fail(err_msg)
> resource_management.core.exceptions.Fail: Execution of 'export
> HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ;
> /usr/hdp/current/hive-metastore/bin/schematool -initSchema -dbType mysql
> -userName hive -passWord [PROTECTED]' returned 1. WARNING: Use "yarn jar"
> to launch YARN applications.
> Metastore connection URL: jdbc:mysql://
> l1033lab.sss.se.company.com:3306/hive?createDatabaseIfNotExist=true
> Metastore Connection Driver : com.mysql.jdbc.Driver
> Metastore connection User: hive
> org.apache.hadoop.hive.me
>
>
> In the Hive config., I have selected 'New MySQL database'.
>
> On the machine l1033lab, there is a MySQL running :
>
>
> [root@l1033lab ~]# mysql -u hive
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 441
> Server version: 5.1.73 Source distribution
>
> Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights
> reserved.
>
> Oracle is a registered trademark of Oracle Corporation and/or its
> affiliates. Other names may be trademarks of their respective
> owners.
>
> Type 'help;' or '\h' for help. Type '\c' to clear the current input
> statement.
>
> mysql>
> mysql>
> mysql> select
> User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv from
> mysql.user;
>
> +------+-------------+-------------+-------------+-------------+-------------+
> | User | Select_priv | Insert_priv | Update_priv | Delete_priv |
> Create_priv |
>
> +------+-------------+-------------+-------------+-------------+-------------+
> | root | Y           | Y           | Y           | Y           | Y
>   |
> | root | Y           | Y           | Y           | Y           | Y
>   |
> | root | Y           | Y           | Y           | Y           | Y
>   |
> | hive | Y           | Y           | Y           | Y           | Y
>   |
>
> +------+-------------+-------------+-------------+-------------+-------------+
> 4 rows in set (0.00 sec)
>
> mysql>
> mysql> show databases;
> +--------------------+
> | Database           |
> +--------------------+
> | information_schema |
> | mysql              |
> | test               |
> +--------------------+
> 3 rows in set (0.00 sec)
>
> How shall I proceed ?
>
>
>

Fwd: Hive service not starting

Posted by Kaliyug Antagonist <ka...@gmail.com>.
An update : I executed the following with -verbose. I dunno why I am still
getting the access exception :


[root@l1033lab ~]# /usr/hdp/current/hive-metastore/bin/schematool
-initSchema -dryRun -verbose -dbType mysql -userName hive -password go4hive
WARNING: Use "yarn jar" to launch YARN applications.
Metastore connection URL:        jdbc:mysql://
l1033lab.sss.se.company.com:3306/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.
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema
version.
        at
org.apache.hive.beeline.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:80)
        at
org.apache.hive.beeline.HiveSchemaTool.getConnectionToMetastore(HiveSchemaTool.java:114)
        at
org.apache.hive.beeline.HiveSchemaTool.testConnectionToMetastore(HiveSchemaTool.java:160)
        at
org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:258)
        at
org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:244)
        at
org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:483)
        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.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.sql.SQLException: Access denied for user 'hive'@'
l1033lab.sss.se.company.com' (using password: YES)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:935)
        at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4101)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1300)
        at
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2337)
        at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2370)
        at
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
        at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
        at java.sql.DriverManager.getConnection(DriverManager.java:571)
        at java.sql.DriverManager.getConnection(DriverManager.java:215)
        at
org.apache.hive.beeline.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:76)
        ... 11 more

---------- Forwarded message ----------
From: Kaliyug Antagonist <ka...@gmail.com>
Date: Thu, Nov 5, 2015 at 12:06 PM
Subject: Hive service not starting
To: user@ambari.apache.org


I have installed HDP 2.3 using Ambari 2.1.2.

When I attempt to start the Hive Metastore, I get :

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

Traceback (most recent call last):
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
line 219, in <module>
    HiveMetastore().execute()
  File
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
line 219, in execute
    method(env)
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
line 55, in start
    self.configure(env)  # FOR SECURITY
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
line 66, in configure
    hive(name = 'metastore')
  File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py",
line 89, in thunk
    return fn(*args, **kwargs)
  File
"/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py",
line 292, in hive
    user = params.hive_user
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py",
line 154, in __init__
    self.env.run()
  File
"/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
line 152, in run
    self.run_action(resource, action)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/environment.py",
line 118, in run_action
    provider_action()
  File
"/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py",
line 260, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
70, in inner
    result = function(command, **kwargs)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
92, in checked_call
    tries=tries, try_sleep=try_sleep)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
140, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File
"/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line
291, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of 'export
HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ;
/usr/hdp/current/hive-metastore/bin/schematool -initSchema -dbType mysql
-userName hive -passWord [PROTECTED]' returned 1. WARNING: Use "yarn jar"
to launch YARN applications.
Metastore connection URL: jdbc:mysql://
l1033lab.sss.se.company.com:3306/hive?createDatabaseIfNotExist=true
Metastore Connection Driver : com.mysql.jdbc.Driver
Metastore connection User: hive
org.apache.hadoop.hive.me


In the Hive config., I have selected 'New MySQL database'.

On the machine l1033lab, there is a MySQL running :


[root@l1033lab ~]# mysql -u hive
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 441
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.

mysql>
mysql>
mysql> select
User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv from
mysql.user;
+------+-------------+-------------+-------------+-------------+-------------+
| User | Select_priv | Insert_priv | Update_priv | Delete_priv |
Create_priv |
+------+-------------+-------------+-------------+-------------+-------------+
| root | Y           | Y           | Y           | Y           | Y
  |
| root | Y           | Y           | Y           | Y           | Y
  |
| root | Y           | Y           | Y           | Y           | Y
  |
| hive | Y           | Y           | Y           | Y           | Y
  |
+------+-------------+-------------+-------------+-------------+-------------+
4 rows in set (0.00 sec)

mysql>
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

How shall I proceed ?