1

我用 CDH4 安装了 Hcatalog(在 Ubuntu 12.04 64 位上),我目前正在尝试使用 REST 访问表信息

我重新启动了 webhcat-server service webhcat-server restart。然后我在终端执行了这个,

curl http://localhost:50111/templeton/v1/ddl/database/?user.name=hive

我得到了,

{"databases":["default","testas"]}

正如预期的那样(并且正确)。

我尝试了几次并得到了相同的输出。

然后我在浏览器中尝试了同样的方法,我得到了,

{"statement":"show databases like '*';","error":"unable to show databases for: *","exec":
{"stdout":"","stderr":"Hive history file=/tmp/hive/hive_job_log_9f5d4411-e8f4-4c7e-a8db-
3bc53a565db8_2034639464.txt\nSLF4J: Class path contains multiple SLF4J bindings.\nSLF4J: 
Found binding in [jar:file:/usr/lib/zookeeper/lib/slf4j-log4j12-
1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]\nSLF4J: Found binding in 
[jar:file:/usr/lib/hive/lib/slf4j-log4j12-
1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]\nSLF4J: See 
http://www.slf4j.org/codes.html#multiple_bindings for an explanation.\n","exitcode":143}}

然后我回到终端并尝试,

curl http://localhost:50111/templeton/v1/ddl/database/?user.name=hive

现在不起作用,并输出

{"statement":"show databases like '*';","error":"unable to show databases for: *","exec":
{"stdout":"","stderr":"Hive history file=/tmp/hive/hive_job_log_ce3f8d69-35b1-4617-b3a5-
624be0a500cc_268094038.txt\nSLF4J: Class path contains multiple SLF4J bindings.\nSLF4J: 
Found binding in [jar:file:/usr/lib/zookeeper/lib/slf4j-log4j12-
1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]\nSLF4J: Found binding in 
[jar:file:/usr/lib/hive/lib/slf4j-log4j12-
1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]\nSLF4J: See 
http://www.slf4j.org/codes.html#multiple_bindings for an explanation.\nOK\nFAILED: Hive 
Internal Error: java.lang.IllegalStateException(Shutdown in progress, cannot add a 
shutdownHook)\njava.lang.IllegalStateException: Shutdown in progress, cannot add a 
shutdownHook\n\tat 
org.apache.hadoop.util.ShutdownHookManager.addShutdownHook(ShutdownHookManager.java:152)\n\t
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2352)\n\tat 
org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2324)\n\tat 
org.apache.hadoop.fs.FileSystem.get(FileSystem.java:351)\n\tat 
org.apache.hadoop.fs.Path.getFileSystem(Path.java:194)\n\tat 
org.apache.hadoop.hive.ql.Context.clear(Context.java:381)\n\tat 
org.apache.hadoop.hive.ql.Driver.close(Driver.java:1553)\n\tat 
org.apache.hcatalog.cli.HCatCli.processCmd(HCatCli.java:276)\n\tat 
org.apache.hcatalog.cli.HCatCli.processLine(HCatCli.java:205)\n\tat 
org.apache.hcatalog.cli.HCatCli.main(HCatCli.java:164)\n\tat 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n\tat 
sun.reflect.D","exitcode":143}}

为什么会这样?

笔记:

在 中/etc/hcatalog/proto-hive-site.xml,我javax.jdo.option.ConnectionPassword从预先存在PASSWORD的密码更改为hive.

我知道有log4j错误,但我怀疑这与此有关

4

1 回答 1

0

可能你的类路径中有许多不同版本的 slf4j jar。这是运行 java 程序时抛出的常见错误。请检查配置单元日志(配置单元历史文件)以获取更多信息。请尝试删除不必要的 jar 版本。

于 2014-06-17T20:09:59.513 回答