title: Exception :Server IPC version 9 cannot communicate with client version 4: using Hcatalog with Hive-0.14.0
body: <p>I have following tools :
      <strong>Hadoop-2.6.0, 
      Hive-0.14.0, 
      hbase-0.94.8, 
      sqoop-1.4.5, 
      pig-0.14.0</strong> installed in a psuedo distributed environment on <strong>Ubuntu 14.0.4.</strong></p>
  
  <p>My goal is to use Hcatalog as an interface to work with Hive, Pig, MapReduce applications.</p>
  
  <p><strong>Steps I did:</strong>
  1. I have Mysql configured as remote metastore, with mysql-connector-java-5.1.37 jar copied in HIVE_HOME/lib. I have created hive-site.xml in HIVE_HOME/conf for remote metastore but running on same machine.
  2. I have hive-env.sh file with HADOOP_HOME pointing to Hadoop-2.6.0 home.
  3. I have remote metastore running at port 9083
  4. in bashrc file I have following env variables set:</p>
  
  <pre><code>#Hadoop variables start
  export JAVA_HOME=/usr/lib/jvm/java-7-oracle
  export HADOOP_HOME=/home/user/hadoop-2.6.0
  export PATH=$PATH:$HADOOP_HOME/bin
  export PATH=$PATH:$HADOOP_HOME/sbin
  export HADOOP_MAPRED_HOME=$HADOOP_HOME
  export HADOOP_COMMON_HOME=$HADOOP_HOME
  export HADOOP_HDFS_HOME=$HADOOP_HOME
  export YARN_HOME=$HADOOP_HOME
  export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
  export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
  #Hadoop variables end
  
  export HADOOP_USER_CLASSPATH_FIRST=true
  export PIG_USER_CLASSPATH_FIRST=true
  
  #PIG ENV VARIABLE
  export PIG_HOME=/home/user/pig-0.14.0
  export PATH=$PATH:$PIG_HOME/bin
  
  #Hive Env Variable
  export HIVE_HOME=/home/user/hive-0.14.0/apache-hive-0.14.0-bin
  export PATH=$PATH:$HIVE_HOME/bin
  
  #HCatalog env 
  export HCAT_HOME=$HIVE_HOME/hcatalog
  export HCAT_HOME
  export PATH=$PATH:$HCAT_HOME/bin
  
  HCATJAR=$HCAT_HOME/share/hacatalog/hive-hcatalog-core-0.14.0.jar
  export HCATJAR
  
  HCATPIGJAR=$HCAT_HOME/share/hcatalog/hive-hcatalog-pig-adapter-0.14.0.jar
  export HCATPIGJAR
  
  export HADOOP_CLASSPATH=$HCATJAR:$HCATPIGJAR:$HIVE_HOME/lib/hive-exec-0.14.0.jar\
  :$HIVE_HOME/lib/hive-metastore-0.14.0.jar:$HIVE_HOME/lib/jdo-api-*.jar:$HIVE_HOME/lib/libfb303-*.jar\
  :$HIVE_HOME/lib/libthrift-*.jar:$HIVE_HOME/conf:$HADOOP_HOME/etc/hadoop
  
  #Pig hcatalog integration
  export PIG_OPTS=-Dhive.metastore.uris=thrift://localhost:9083
  export PIG_CLASSPATH=$HCAT_HOME/share/hcatalog/*:$HIVE_HOME/lib/*:$HCATPIGJAR:$HIVE_HOME/conf:$HADOOP_HOME/etc/hadoop
  </code></pre>
  
  <p><strong>I am trying to invoke "hcat" command on HIVE_HOME/hcatalog/bin path. Below are the errors which is being generated:</strong></p>
  
  <pre><code>Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot communicate with client version 4
      at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:444)
      at org.apache.hive.hcatalog.cli.HCatCli.main(HCatCli.java:149)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
  **Caused by: org.apache.hadoop.ipc.RemoteException: Server IPC version 9 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.$Proxy5.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.&lt;init&gt;(DFSClient.java:238)
      at org.apache.hadoop.hdfs.DFSClient.&lt;init&gt;(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.hadoop.hive.ql.session.SessionState.start(SessionState.java:427)
      ... 6 more
  </code></pre>
  
  <p><strong>Observation:</strong> After Googling a lot, If I understand right "Server IPC version 9 cannot communicate with client version 4" is hadoop version mismatch. 
  So I added HADOOP_HOME in hive-env.sh to refer to hadoop-2.6.0. 
  Error still persists. I am not sure what I am missing. Any help on this will be really appreciated.</p>