pig to hadoop issue: Server IPC version 7 cannot communicate with client version 4
Asked Answered
L

2

7

I am trying to get pig started and failing:

 $ pig
2013-05-10 18:03:22,972 [main] INFO  org.apache.pig.Main - Apache Pig version 0.11.1 (r1459641) compiled Mar 22 2013, 02:13:53
2013-05-10 18:03:22,972 [main] INFO  org.apache.pig.Main - Logging error messages to: /Users/barclaydunn/Environment/pig-0.11.1/pig_1368223402970.log
2013-05-10 18:03:23,151 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://stage-hadoop101.cluster:8020/hbase
2013-05-10 18:03:23,704 [main] ERROR org.apache.pig.Main - ERROR 2999: Unexpected internal error. Failed to create DataStorage
Details at logfile: /Users/barclaydunn/Environment/pig-0.11.1/pig_1368223402970.log

Logfile contents:

 $ cat /Users/barclaydunn/Environment/pig-0.11.1/pig_1368223402970.log
Error before Pig is launched
----------------------------
ERROR 2999: Unexpected internal error. Failed to create DataStorage

java.lang.RuntimeException: Failed to create DataStorage
    at org.apache.pig.backend.hadoop.datastorage.HDataStorage.init(HDataStorage.java:75)
    at org.apache.pig.backend.hadoop.datastorage.HDataStorage.<init>(HDataStorage.java:58)
    at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:204)
    at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:117)
    at org.apache.pig.impl.PigContext.connect(PigContext.java:240)
    at org.apache.pig.PigServer.<init>(PigServer.java:213)
    at org.apache.pig.PigServer.<init>(PigServer.java:198)
    at org.apache.pig.tools.grunt.Grunt.<init>(Grunt.java:47)
    at org.apache.pig.Main.run(Main.java:535)
    at org.apache.pig.Main.main(Main.java:157)
    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)
Caused by: org.apache.hadoop.ipc.RemoteException: Server IPC version 7 cannot communicate with client version 4
    at org.apache.hadoop.ipc.Client.call(Client.java:1070)
    at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
    at com.sun.proxy.$Proxy1.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
    at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:119)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:238)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:203)
    at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386)
    at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:123)
    at org.apache.pig.backend.hadoop.datastorage.HDataStorage.init(HDataStorage.java:72)
    ... 14 more
================================================================================

Searching on "Server IPC version 7 cannot communicate with client version 4" doesn't turn up anything useful.

Layton answered 10/5, 2013 at 22:15 Comment(0)
T
5

Set HADOOP_HOME to point to the hadoop you are using.

From the pig getting started page:

(You can run Pig with different versions of Hadoop by setting HADOOP_HOME to point to the directory where you have installed Hadoop. If you do not set HADOOP_HOME, by default Pig will run with the embedded version, currently Hadoop 1.0.0.)

IPC version 4 is for Hadoop 1.0, whereas version 7 is for Hadoop 2.0, so it sounds like you're running pig with its embedded hadoop version but trying to talk to a Hadoop 2 cluster.

Tyeshatyg answered 10/5, 2013 at 22:38 Comment(1)
HADOOP_HOME is deprecated in favor of HADOOP_PREFIX. however, your key point - that i was using v4 locally and the cluster is v7 - was the fix i was looking for. thanks. i would have expected our cluster to be a stable version of hadoop but our sysops are apparently cowboys.Layton
N
0

Error "Server IPC version 7 cannot communicate with client version 4" may be caused when cdh3 job is trying to comunicate with cdh4 HDFS.

Check your mapred.job.tracker and fs.default.name settings

Neolith answered 9/9, 2013 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.