为了账号安全,请及时绑定邮箱和手机立即绑定

hive无法启动 远程连接mysql失败,求大神帮忙看看,万分感谢!!!

hive无法启动 远程连接mysql失败,求大神帮忙看看,万分感谢!!!

Kevin丶Z 2017-03-16 21:39:32
我的mysql是装在本地机器win7操作系统下的,服务正常,本地登录正常。hive装在linux虚拟机上,虚拟机与本机网络没有问题,防火墙已关,hadoop安装也没有问题。 我在liunx虚拟机上安装了mysql的客户端,通过命令mysql -uhive -paxx1314 -h192.168.120.1 正常登录,信息如下[root@zchlinux conf]# mysql -uhive -paxx1314 -h192.168.120.1 Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 9 to server version: 5.0.18-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | hivedb             | | test               | +--------------------+ 3 rows in set (0.03 sec)mysql>但当我启动hive时报错,报错信息如下:[root@zchlinux conf]# hiveLogging initialized using configuration in jar:file:/opt/apache-hive-0.13.0-bin/lib/hive-common-0.13.0.jar!/hive-log4j.properties Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiateorg.apache.hadoop.hive.metastore.HiveMetaStoreClient    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:344)    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)    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:601)    at org.apache.hadoop.util.RunJar.main(RunJar.java:160) Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient    at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1412)    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.(RetryingMetaStoreClient.java:62)    at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:72)    at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2444)    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2456)    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:338)    ... 7 more Caused by: java.lang.reflect.InvocationTargetException    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:525)    at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1410)    ... 12 more Caused by: javax.jdo.JDOFatalDataStoreException: Unable to open a test connection to the given database. JDBC url =jdbc:mysql://192.168.120.1:3306/hivedb?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8, username =hive. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). OriginalException: ------ java.sql.SQLException: Access denied for user 'hive'@'192.168.120.128' (using password: YES)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)    .........    .....    ..hive的配置文件hivehive-site.xml内容如下:<?xml version="1.0"?>< ?xml-stylesheet type="text/xsl" href="configuration.xsl"?>javax.jdo.option.ConnectionURLjdbc:mysql://192.168.120.1:3306/hivedb?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8javax.jdo.option.ConnectionDriverNamecom.mysql.jdbc.Driverjavax.jdo.option.ConnectionUserNamehivejavax.jdo.option.ConnectionPassWordaxx1314
查看完整描述

1 回答

?
Finit

TA贡献222条经验 获得超80个赞

Caused by: javax.jdo.JDOFatalDataStoreException: Unable to open a test connection to the given database. JDBC url =

jdbc:mysql://192.168.120.1:3306/hivedb?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8, username =

jdbc的URL出问题了,再次检查下配置文件

查看完整回答
反对 回复 2017-03-17
  • Kevin丶Z
    Kevin丶Z
    检查了无数遍了,mysql版本和驱动都换了好几个 还是报这个错!
  • Finit
    Finit
    那就都卸载了 重头再来 熟能生巧
  • Kevin丶Z
    Kevin丶Z
    就在刚刚重搞了 还是报错
  • 1 回答
  • 0 关注
  • 5625 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信