【问题标题】:Start hive-metastore启动 hive-metastore
【发布时间】:2014-08-27 14:52:37
【问题描述】:

我们正在尝试在我们的 Linux 服务器上启动 hive-metastore,但我们遇到了一个问题。如果我们尝试使用以下命令启动 hive-metastore 服务:

sudo hive --service metastore

我们会遇到很多这样的错误:

原因:java.sql.SQLException: Access denied for user 'hive'@'sandbox.hortonworks.com' (使用密码: YES) 在 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) 在 com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597) 在 com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529) 在 com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:935) 在 com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4101) 在 com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1300) 在 com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2337) 在 com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2370) 在 com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154) 在 com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:792) 在 com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:49) 在 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 在 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 在 java.lang.reflect.Constructor.newInstance(Constructor.java:513) 在 com.mysql.jdbc.Util.handleNewInstance(Util.java:411) 在 com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381) 在 com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) 在 java.sql.DriverManager.getConnection(DriverManager.java:582) 在 java.sql.DriverManager.getConnection(DriverManager.java:154) 在 com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:254) 在 com.jolbox.bonecp.BoneCP.(BoneCP.java:305) ... 48 更多

我们还尝试重置用户配置单元的密码,但没有帮助。

我们要启动 hive-metastore 的原因是,端口 9083 没有在我们的服务器上侦听。我们也不知道为什么在服务器重启后 metastore-service 不再运行。

如果您知道任何其他重新启动 hive 元存储的命令或任何其他可能解决此问题的方法,请告诉我。

提前致谢

编辑:我显示了用户配置单元的授权:

mysql> show grants for 'hive'@'sandbox.hortonworks.com';
+--------------------------------------------------------------------------------+
| Grants for hive@sandbox.hortonworks.com                                        |
+--------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'hive'@'sandbox.hortonworks.com'                |
| GRANT ALL PRIVILEGES ON `metastore`.* TO 'hive'@'sandbox.hortonworks.com'      |
| GRANT ALL PRIVILEGES ON `hive`.`metastore` TO 'hive'@'sandbox.hortonworks.com' |
+--------------------------------------------------------------------------------+
3 rows in set (0.01 sec)

在这里我选择了 mysql.user 表的主机用户和密码。用户 hive 没有密码!

mysql> select host, user, password from mysql.user;
+-------------------------+------+----------+
| host                    | user | password |
+-------------------------+------+----------+
| localhost               | root |          |
| sandbox.hortonworks.com | root |          |
| 127.0.0.1               | root |          |
| localhost               |      |          |
| sandbox.hortonworks.com |      |          |
| sandbox.hortonworks.com | hive |          |
| localhost               | hive |          |
+-------------------------+------+----------+
7 rows in set (0.01 sec)

编辑:我发现了另一个错误消息:

我使用 serverip:8080 连接到 Ambari 并检查了一些服务的状态。如果我尝试手动启动 hive-metastore,则会收到以下错误消息:

Hive Metastore status
CRITICAL: Error accessing Hive Metastore status [14/08/25 04:41:55 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive

错误发生在启动 Hive 服务的 4 个步骤的最后一步。步骤“Hive Metastore start”和“Hiveserver 2 start”已经完成且没有错误。名为“Hive Check execute”的步骤失败。这是标准输出的错误消息:

notice: /Stage[2]/Hdp-hcat::Hcat::Service_check/Exec[hcatSmoke.sh prepare]/returns: 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
err: /Stage[2]/Hdp-hcat::Hcat::Service_check/Exec[hcatSmoke.sh prepare]/returns: change from notrun to 0 failed: su - ambari-qa -c 'sh /tmp/hcatSmoke.sh hcatsmokeidd4b2a272_date472514 prepare' returned 1 instead of one of [0] at /var/lib/ambari-agent/puppet/modules/hdp-hcat/manifests/hcat/service_check.pp:54
notice: /Stage[2]/Hdp-hcat::Hcat::Service_check/Hdp-hadoop::Exec-hadoop[hcat::service_check::test]/Hdp::Exec[hadoop --config /etc/hadoop/conf fs -test -e /apps/hive/warehouse/hcatsmokeidd4b2a272_date472514]/Anchor[hdp::exec::hadoop --config /etc/hadoop/conf fs -test -e /apps/hive/warehouse/hcatsmokeidd4b2a272_date472514::begin]: Dependency Exec[hcatSmoke.sh prepare] has failures: true
notice: /Stage[2]/Hdp-hcat::Hcat::Service_check/Hdp-hadoop::Exec-hadoop[hcat::service_check::test]/Hdp::Exec[hadoop --config /etc/hadoop/conf fs -test -e /apps/hive/warehouse/hcatsmokeidd4b2a272_date472514]/Exec[hadoop --config /etc/hadoop/conf fs -test -e /apps/hive/warehouse/hcatsmokeidd4b2a272_date472514]: Dependency Exec[hcatSmoke.sh prepare] has failures: true

烟雾测试是否有缺陷?

【问题讨论】:

  • 检查 mysql 中 'hive' 用户对 'metastore' 数据库的权限
  • 我在 mysql 中只有 4 个数据库。这些是 Information_schema、hive、mysql 和 test。不幸的是,没有“元存储”数据库

标签: mysql hadoop hive hortonworks-data-platform


【解决方案1】:

在 mysql 中授予 hive 用户权限

GRANT ALL ON metastore.* TO 'hive'@'sandbox.hortonworks.com';
GRANT ALL ON metastore TO 'hive'@'sandbox.hortonworks.com';
FLUSH PRIVILEGES;

【讨论】:

  • 执行第二个查询时出现错误。 “错误 1046 (3D000):未选择数据库”
  • 检查数据库名称是否为metastore。检查 hive-site.xml 的数据库名称。
  • 我在 hive-site.xml 中找不到任何数据库名称。我是否应该将整个 hive-site.xml 添加到我的帖子中,以便您可以看到其中的内容?编辑:我在 MySQL 中有 4 个数据库:Information_schema、hive、mysql、test。我没有名为 Metastore 的数据库。
  • 在您的情况下,数据库名称为hive。请尝试并检查。
【解决方案2】:

我不知道为什么,但存储的密码不正确。我做了以下更改,hive metastore 和 hive 工作:

  1. 连接mysql,执行下一条命令修改“password”的hive用户密码(原密码加密未知):

为 'hive'@'sandbox.hortonworks.com' 设置密码 = PASSWORD('password');

  1. 将以下内容添加到 hive-site.xml

<property> <name>javax.jdo.option.ConnectionPassword</name> <value>password</value> </property>

  1. 启动 Hive Metastore

hive --service 元存储

但是,当我重新启动 HDP 虚拟机时,Hive Metastore 不再自动启动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-01
    • 2018-09-23
    • 1970-01-01
    • 1970-01-01
    • 2019-01-30
    • 1970-01-01
    • 2022-06-14
    相关资源
    最近更新 更多