FAILED: Error in metadata: java.lang.IllegalArgumentException: URI: does not have a scheme
2011-09-22 11:54:57,890 ERROR [main] session.SessionState$LogHelper(343): FAILED: Error in metadata: java.lang.IllegalArgumentException: URI: does not have a scheme
org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.IllegalArgumentException: URI: does not have a scheme
at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1028)
at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1013)
at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:1691)
at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:289)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:130)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1063)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:900)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:748)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
Caused by: java.lang.IllegalArgumentException: URI: does not have a scheme
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:127)
at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:1855)
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:1865)
at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1024)
... 11 more
复制代码
然后启动后在控制台也收到这样一条Log:hive-log4j.properties not found
控制台输出如下: Run path:/home/hadoop/workspace/hive-0.7.0/bin/
Exception in thread "main" java.lang.NullPointerException
at com.guoyun.hive.study.basic.PrintSourcePath.main(PrintSourcePath.java:12) 在获取hive-default.xml文件源时报来空指针异常,现在将hive_home/conf下到文件拷到hive/bin下,再运行这个类就不会报错了,我的运行结果如下: Run path:/home/hadoop/workspace/hive-0.7.0/bin/ hive-default.xml path:/home/hadoop/workspace/hive-0.7.0/bin/hive-default.xml 之后再来调试Hive源码,Log:hive-log4j.properties not found已经不出现了。同时也没这个错误来。该问题解决! 错误类型2:
hive> show tables;
Logging initialized using configuration in file:/root/hive-0.8.1/conf/hive-log4j.properties
12/11/14 17:14:50 INFO SessionState: Logging initialized using configuration in file:/root/hive-0.8.1/conf/hive-log4j.properties
Hive history file=/tmp/root/hive_job_log_root_201211141714_197217004.txt
12/11/14 17:14:50 INFO exec.HiveHistory: Hive history file=/tmp/root/hive_job_log_root_201211141714_197217004.txt
hive> show tables;
12/11/14 17:14:56 INFO ql.Driver: <PERFLOG method=compile>
12/11/14 17:14:56 INFO parse.ParseDriver: Parsing command: show tables
12/11/14 17:14:56 INFO parse.ParseDriver: Parse Completed
12/11/14 17:14:56 INFO ql.Driver: Semantic Analysis Completed
错误类型3:没有权限
起因是我重装了mysql数据库。
安装之后 把访问权限都配置好 :
GRANT ALL PRIVILEGES ON*.* TO 'hive'@'%' Identified by 'hive';
GRANT ALL PRIVILEGES ON*.* TO 'hive'@'localhost' Identified by 'hive';
GRANT ALL PRIVILEGES ON*.* TO 'hive'@'127.0.0.1' Identified by 'hive';
本机地址: 192.168.103.43 机器名字:192-168-103-43
flush privileges;
启动hive 发生下面的错误:
hive> show tables;
FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClientFAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
cd ${HIVE_HOME}/bin
./hive -hiveconf hive.root.logger=DEBUG,console
hive> show tables;
复制代码
得到如下的错误信息(当然 不同的问题所产生的日志是不同的):
Caused by: javax.jdo.JDOFatalDataStoreException: Access denied for user 'hive'@'192-168-103-43' (using password: YES)
NestedThrowables:
java.sql.SQLException: Access denied for user 'hive'@'192-168-103-43' (using password: YES)
at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:298)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:601)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:286)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1958)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1953)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:262)
at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:291)
at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:224)
at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:199)
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
at org.apache.hadoop.hive.metastore.RetryingRawStore.<init>(RetryingRawStore.java:62)
at org.apache.hadoop.hive.metastore.RetryingRawStore.getProxy(RetryingRawStore.java:71)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:413)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:401)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:439)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:325)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:285)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:53)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:58)
at org.apache.hadoop.hive.metastore.HiveMetaStore.newHMSHandler(HiveMetaStore.java:4102)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:121)
... 28 more
复制代码
发现数据库的权限 HIVE需要的是
'hive'@'192-168-103-43' 这个IP地址
然后试着在mysql中加上权限:
GRANT ALL PRIVILEGES ON*.* TO 'hive'@'192-168-103-43' Identified by 'hive';