你好,游客 登录
背景:
阅读新闻

hadoop hive安装教程

[日期:2013-06-19] 来源:CSDN  作者:duxianghe [字体: ]


以下是本人hive的安装过程:
hive 是hadoop中最常用的工具,可以说是必装工具。
按apache官方文档,推荐使用svn下载后编译,文档地址:https://cwiki.apache.org/confluence/display/Hive/AdminManual+Installation
但build时,因为依赖关系,整了很久,下了很多包也没有成功。
推荐使用tar.gz包,直接安装,文档地址:https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-InstallationandConfiguration
很简单,直接成功!

首次运行hive时报错:

Exception in thread "main" java.lang.NoSuchFieldError: ALLOW_UNQUOTED_CONTROL_CHARS
        at org.apache.hadoop.hive.ql.udf.generic.GenericUDTFJSONTuple.<clinit>(GenericUDTFJSONTuple.java:59)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:113)
        at org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerGenericUDTF(FunctionRegistry.java:545)
        at org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerGenericUDTF(FunctionRegistry.java:539)
        at org.apache.hadoop.hive.ql.exec.FunctionRegistry.<clinit>(FunctionRegistry.java:472)
        at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:202)
        at org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:86)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:635)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:613)
        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 org.apache.hadoop.util.RunJar.main(RunJar.java:156)


ALLOW_UNQUOTED_CONTROL_CHARS是关键字 
原因:

hive 里的 jackson jar 包 和 hadoop 里的不一致, hadoop 里的用的是老的 1.0.1 的, hive 里的是 1.8.8.
将hadoop 里的jar 替换成和 hive 一样的就ok了, 
找不到jar包的可以find一下。





收藏 推荐 打印 | 录入: | 阅读:
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数
点评:
       
评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款