当前位置:   article > 正文

hive --service hiveserver2 报错thrift.ThriftCLIService (ThriftBinaryCLIService.java:run(113)) - Error:_error initializing thriftbinarycliservice

error initializing thriftbinarycliservice

今天启动hive,想用squirrel-sql客户端连接hive,报错一直如下

2018-08-28 09:31:55,881 INFO  [main]: service.AbstractService (AbstractService.java:start(104)) - Service:HiveServer2 is started.
2018-08-28 09:31:56,070 ERROR [Thread-7]: thrift.ThriftCLIService (ThriftBinaryCLIService.java:run(113)) - Error: 
java.lang.NoSuchMethodError: org.apache.thrift.server.TThreadPoolServer$Args.requestTimeout(I)Lorg/apache/thrift/server/TThreadPoolServer$Args;
        at org.apache.hive.service.cli.thrift.ThriftBinaryCLIService.run(ThriftBinaryCLIService.java:99)
        at java.lang.Thread.run(Thread.java:748)
2018-08-28 09:31:56,074 INFO  [Thread-3]: server.HiveServer2 (HiveStringUtils.java:run(623)) - SHUTDOWN_MSG: 
/************************************************************

解决思路: 基本原因是jar包问题--libthrift-*.jar

先去$HIVE_HOME/logs下面看启动日志:

如果args=[],请检查hive-env.sh是否配置正确,以下是我的配置

# Set HADOOP_HOME to point to a specific hadoop install directory
# HADOOP_HOME=${bin}/../../hadoop
HADOOP_HOME=/home/ocetl/app/hadoop-2.5.0-cdh5.2.1
ZOOKEEPER_HOME=/home/ocetl/app/zookeeper-3.4.5-cdh5.8.0
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/home/ocetl/app/hive-0.13.1-cdh5.2.1/conf

export JAVA_HOME=/home/ocetl/app/jdk1.8.0_161

export HADOOP_HEAPSIZE=1024
export HIVE_HOME=/home/ocetl/app/hive-0.13.1-cdh5.2.1

export HIVE_AUX_JARS_PATH=/home/ocetl/app/hive-0.13.1-cdh5.2.1/lib
 

 

上面是正确的日志,下面是错误日志:

下面看下这两行的代码,这里的代码我反编译出来的:

    public void run()
    {
        try
        {
            hiveAuthFactory = new HiveAuthFactory();
            TTransportFactory transportFactory = hiveAuthFactory.getAuthTransFactory();
            TProcessorFactory processorFactory = hiveAuthFactory.getAuthProcFactory(this);
            String portString = System.getenv("HIVE_SERVER2_THRIFT_PORT");
            if(portString != null)
                portNum = Integer.valueOf(portString).intValue();
            else
                portNum = hiveConf.getIntVar(org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT);
            String hiveHost = System.getenv("HIVE_SERVER2_THRIFT_BIND_HOST");
            if(hiveHost == null)
                hiveHost = hiveConf.getVar(org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST);
            if(hiveHost != null && !hiveHost.isEmpty())
                serverAddress = new InetSocketAddress(hiveHost, portNum);
         

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/634741
推荐阅读
相关标签
  

闽ICP备14008679号