Hive server2 错误Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses

使用的是CDH4.6,用的是mapreduce,没用YARN,hive-server 使用正常,添加hive2后,错误如下:


ERROR exec.Task (SessionState.java:printError(427)) - Job Submission failed with exception 'java.io.IOException(Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.)'

java.io.IOException: Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.

        at org.apache.hadoop.mapreduce.Cluster.initialize(Cluster.java:122)

        at org.apache.hadoop.mapreduce.Cluster.(Cluster.java:84)

        at org.apache.hadoop.mapreduce.Cluster.(Cluster.java:77)

        at org.apache.hadoop.mapred.JobClient.init(JobClient.java:478)

        at org.apache.hadoop.mapred.JobClient.(JobClient.java:457)

        at org.apache.hadoop.hive.ql.exec.ExecDriver.execute(ExecDriver.java:426)

        at org.apache.hadoop.hive.ql.exec.MapRedTask.execute(MapRedTask.java:138)

        at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:138)

        at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:66)

        at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1383)

        at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1169)

        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:982)

        at org.apache.hive.service.cli.operation.SQLOperation.run(SQLOperation.java:131)

        at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatement(HiveSessionImpl.java:210)

        at org.apache.hive.service.cli.CLIService.executeStatement(CLIService.java:154)

        at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:216)

        at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1373)

        at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1358)

        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)

        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)

        at org.apache.hive.service.cli.thrift.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:38)


解决方法:

# tail  /etc/default/hive-server2 

# limitations under the License.


# The port for Hive server2 daemon to listen to.

# Unfortunatelly, there is no way to specify the interfaces 

# to which the daemon binds.

#

#PORT=

export HADOOP_MAPRED_HOME=/usr/lib/hadoop-0.20-mapreduce