zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Barlock <barl...@us.ibm.com>
Subject Re: ZooKeeper Class Will Not Connect
Date Fri, 24 Jul 2015 16:16:09 GMT
Ran some more tests.  My code works fine up through ZK 3.4.2, but then 
fails with 3.4.3.  I did have to add the following to the Import-Package 
list in the ZK MANIFEST.MF:

org.slf4 j,javax.security.auth.login,javax.security.sasl

I could really use some help here, ZK folks!  Is my code incorrect with 
newer versions of ZK, or is ZK broken?

Chris





From:   Chris Barlock/Raleigh/IBM@IBMUS
To:     user@zookeeper.apache.org
Date:   07/23/2015 09:34 PM
Subject:        Re: ZooKeeper Class Will Not Connect



I tried the 3.5.0 alpha build to see if it made any difference.  It did 
not.

But, I had to hack the MANIFEST.MF file in the JAR because the 
"3.50-alpha" version fails tests in OSGi bundles that import the ZK 
classes which have something like:

version="[3.2,4)"

I suggest that if you want to name the JAR "3.50-alpha" that all the 
internals just use a version of 3.50.

Chris

IBM Tivoli Systems
Research Triangle Park, NC
(919) 224-2240
Internet:  barlock@us.ibm.com



From:   Chris Barlock/Raleigh/IBM@IBMUS
To:     user@zookeeper.apache.org
Date:   07/23/2015 01:37 PM
Subject:        ZooKeeper Class Will Not Connect



We are attempting to upgrade from Kafka 0.8.0, which includes ZK 3.3.4 to 
Kafka 0.8.2.1 with ZK 3.4.6.  My code which attempts to connect to ZK is 
pretty straightforward:

            try {
                ZooKeeper zk = new ZooKeeper(connectString, sessionTimeout
, this);
                int connectAttempts = 0;

                while (!zk.getState().isConnected() && connectAttempts < 
MAX_ZK_CONNECT_ATTEMPTS) {
                    try {
                        Thread.sleep(ZK_CONNECT_WAIT);
                    } catch (InterruptedException e) {
                        // Ignore
                    }
                    connectAttempts++;
                }
            } catch (IOException e) {
                trace.exception(CLASS_NAME, methodName, e);
            }

With some additional tracing, States is always CONNECTING.  Has something 
changed with 3.4.6 about how I should connect to the server?  I can 
connect just fine with the zookeeper-shell.sh that Kafka ships.  This code 


always runs on the same system as ZK, so the connectString is always 
"localhost:2181"

Chris


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message