"java.net.ConnectException: Connection refused" in zookeeper -


i installed zookeeper follows :

wget http://archive.cloudera.com/cdh/3/zookeeper-3.3.3-cdh3u1.tar.gz 

here zoo.cf:

# number of milliseconds of each tick ticktime=2000 # number of ticks initial # synchronization phase can take initlimit=10 # number of ticks can pass between # sending request , getting acknowledgement synclimit=5 # directory snapshot stored. datadir=/home/reach121/basf/data/zookeeper/data1 # maximum client connection maxclientcnxns=500 # port @ clients connect clientport=2183 server.1=localhost:2878:3878 server.2=localhost:2879:3879 server.3=localhost:2880:3880 

and started

/bin/zkserver.sh start zoo.cfg 

and when do?

bin/zkcli.sh -server 127.0.0.1:2183 

it gives me error:

connecting 127.0.0.1:2183 2011-10-13 14:11:28,433 - info  [main:environment@97] - client environment:zookeeper.version=3.3.3-cdh3u1--1, built on 07/18/2011 15:17 gmt 2011-10-13 14:11:28,437 - info  [main:environment@97] - client environment:host.name=cignexnew 2011-10-13 14:11:28,437 - info  [main:environment@97] - client environment:java.version=1.6.0_22 2011-10-13 14:11:28,438 - info  [main:environment@97] - client environment:java.vendor=sun microsystems inc. 2011-10-13 14:11:28,438 - info  [main:environment@97] - client environment:java.home=/usr/lib/jvm/java-6-openjdk/jre 2011-10-13 14:11:28,439 - info  [main:environment@97] - client environment:java.class.path=/home/reach121/basf/zookeeper-3.3.3-cdh3u1/bin/../build/classes:/home/reach121/basf/zookeeper-3.3.3-cdh3u1/bin/../build/lib/*.jar:/home/reach121/basf/zookeeper-3.3.3-cdh3u1/bin/../zookeeper-3.3.3-cdh3u1.jar:/home/reach121/basf/zookeeper-3.3.3-cdh3u1/bin/../lib/log4j-1.2.15.jar:/home/reach121/basf/zookeeper-3.3.3-cdh3u1/bin/../lib/jline-0.9.94.jar:/home/reach121/basf/zookeeper-3.3.3-cdh3u1/bin/../src/java/lib/*.jar:/home/reach121/basf/zookeeper-3.3.3-cdh3u1/bin/../conf: 2011-10-13 14:11:28,439 - info  [main:environment@97] - client environment:java.library.path=/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib 2011-10-13 14:11:28,440 - info  [main:environment@97] - client environment:java.io.tmpdir=/tmp 2011-10-13 14:11:28,440 - info  [main:environment@97] - client environment:java.compiler=<na> 2011-10-13 14:11:28,441 - info  [main:environment@97] - client environment:os.name=linux 2011-10-13 14:11:28,441 - info  [main:environment@97] - client environment:os.arch=amd64 2011-10-13 14:11:28,441 - info  [main:environment@97] - client environment:os.version=2.6.35.4-rscloud 2011-10-13 14:11:28,442 - info  [main:environment@97] - client environment:user.name=reach121 2011-10-13 14:11:28,443 - info  [main:environment@97] - client environment:user.home=/home/reach121 2011-10-13 14:11:28,443 - info  [main:environment@97] - client environment:user.dir=/home/reach121/basf/zookeeper-3.3.3-cdh3u1 2011-10-13 14:11:28,446 - info  [main:zookeeper@373] - initiating client connection, connectstring=127.0.0.1:2183 sessiontimeout=30000 watcher=org.apache.zookeeper.zookeepermain$mywatcher@5311a775 welcome zookeeper! 2011-10-13 14:11:28,472 - info  [main-sendthread():clientcnxn$sendthread@1041] - opening socket connection server /127.0.0.1:2183 jline support enabled 2011-10-13 14:11:28,487 - warn  [main-sendthread(localhost:2183):clientcnxn$sendthread@1161] - session 0x0 server null, unexpected error, closing socket connection , attempting reconnect java.net.connectexception: connection refused         @ sun.nio.ch.socketchannelimpl.checkconnect(native method)         @ sun.nio.ch.socketchannelimpl.finishconnect(socketchannelimpl.java:592)         @ org.apache.zookeeper.clientcnxn$sendthread.run(clientcnxn.java:1119) [zk: 127.0.0.1:2183(connecting) 0] 2011-10-13 14:11:30,374 - info  [main-sendthread(localhost:2183):clientcnxn$sendthread@1041] - opening socket connection server localhost/127.0.0.1:2183 2011-10-13 14:11:30,376 - warn  [main-sendthread(localhost:2183):clientcnxn$sendthread@1161] - session 0x0 server null, unexpected error, closing socket connection , attempting reconnect java.net.connectexception: connection refused         @ sun.nio.ch.socketchannelimpl.checkconnect(native method)         @ sun.nio.ch.socketchannelimpl.finishconnect(socketchannelimpl.java:592)         @ org.apache.zookeeper.clientcnxn$sendthread.run(clientcnxn.java:1119) 

are servers coming up? not given:

server.1=localhost:2878:3878 server.2=localhost:2879:3879 server.3=localhost:2880:3880 

if running 3 servers on same host need each have different config - in particular datadir location must different, , need assure each datadir has myid file corresponding server line (ie server.# in config).

typically when want run in distributed mode need have separate hosts. in case why not run in standalone (default) mode?

i'd suggest read more in admin guide first: http://zookeeper.apache.org/doc/r3.3.3/zookeeperadmin.html


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -