使用hcatalog rest从配置单元访问表

9wbgstp7  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(451)

我用cdh4安装了hcatalog(在ubuntu12.0464位上),目前我正在尝试用rest访问表信息
我重新启动了webhcat服务器 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 错误,但我怀疑这与此有关

utugiqy6

utugiqy61#

可能您的类路径中有许多不同版本的slf4j jar。这是运行java程序时引发的常见错误。有关详细信息,请检查配置单元日志(配置单元历史记录文件)。请尝试删除不必要的jar版本。

相关问题