Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

CDH 5.4 Zookeeper Server failure at startup

Highlighted

CDH 5.4 Zookeeper Server failure at startup

Explorer

I am building a Single node Psuedo Cluster using the latest CDH 5.4 and Cloudera Documentation.  The zookeeper server fails to startup with the following message in *.out file:

 

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/zookeeper/server/quorum/QuorumPeerMain : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.apache.zookeeper.server.quorum.QuorumPeerMain. Program will exit.

 

Also here is my /etc/zookeeper/conf/zoo.cfg file contents:

 

maxClientCnxns=50
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper
# the port at which the clients will connect
clientPort=2181
# the directory where the transaction logs are stored.
dataLogDir=/var/lib/zookeeper
# Export JAVA_HOME and JRE_HOME
export JAVA_HOME=/opt/jdk1.7.0_75
export JRE_HOME=/opt/jdk1.7.0_75/jre
export CLASSPATH=$CLASSPATH:/usr/lib/zookeeper/zookeeper.jar

 

All services including hive, hbase and spark are working with 5.3. and older.

4 REPLIES 4

Re: CDH 5.4 Zookeeper Server failure at startup

Hello Anant, is this a brand new 5.4 install or an upgrade?

Can you check if you have JDK1.6 installed on this host and if so, is it practical to uninstall it then try starting ZooKeeper again?
Regards,
Gautam Gopalakrishnan

Re: CDH 5.4 Zookeeper Server failure at startup

Explorer
Hi Gautam,
I believe this is 5.4 install. This was a 5.3 install first. The problem started with the "hbase shell" command hanging. I reinstalled HBase and the problem remained. I kept getting the zookeeper Java error. I uninstalled zookeeper, which uninstalled everything. I then uninstalled HBase too and started again from scratch. So, I now have 5.4.0. Along the way, I installed jdk 1.7.0.75 as per 5.4 requirements:
[root@psvc01nodecdh4 ~]# alternatives --config java

There are 3 programs which provide 'java'.

Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
3 /usr/lib/jvm/jre-1.5.0-gcj/bin/java

Enter to keep the current selection[+], or type selection number:
[root@psvc01nodecdh4 ~]# env | grep JAVA
JAVA_HOME=/opt/jdk1.7.0_75
[root@psvc01nodecdh4 ~]# env | grep JRE
JRE_HOME=/opt/jdk1.7.0_75/jre
[root@psvc01nodecdh4 ~]#
Here is the output of:
[root@psvc01nodecdh4 ~]# yum info hadoop-conf-pseudo
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos-mirror.jchost.net
* epel: archive.linux.duke.edu
* extras: centos-distro.cavecreek.net
* updates: centos.escapemg.com
Installed Packages
Name : hadoop-conf-pseudo
Arch : x86_64
Version : 2.6.0+cdh5.4.0+521
Release : 1.cdh5.4.0.p0.59.el6
Size : 24 k
Repo : installed
>From repo : cloudera-cdh5
Summary : Hadoop installation in pseudo-distributed mode
URL : http://hadoop.apache.org/core/
License : ASL 2.0
Description : Installation of this RPM will setup your machine to run in pseudo-distributed mode
: where each Hadoop daemon runs in a separate Java process.
Should I uninstall the 1.6 version?

Re: CDH 5.4 Zookeeper Server failure at startup

Cloudera Employee

openjdk has been known to cause conflicts so I would uninstall openJDK. Oracle JDK is required

Re: CDH 5.4 Zookeeper Server failure at startup

Explorer
Hi Gautam, looking back, I installed openjdk version 75 somewhere in the middle of the uninstall-install cycle. Your recommendation makes a lot of sense. Thanks, Anant