Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zookeeper close connection when start broker #3

Open
veerapatyok opened this issue Nov 7, 2018 · 3 comments
Open

zookeeper close connection when start broker #3

veerapatyok opened this issue Nov 7, 2018 · 3 comments

Comments

@veerapatyok
Copy link

hi,
I create api include kafka and I create test and use embedded kafka but I have a problem when I use

(ns ...
  (:require [embedded-kafka.core :as k])

(comment
 (def z (k/create-zookeeper))
   (def k (k/create-broker))
   (.startup k))

after that a zookeeper server close socket connection and then my repl close too.

my info log when start zookeeper

11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:java.io.tmpdir=/tmp
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:java.compiler=<NA>
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:os.name=Linux
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:os.arch=amd64
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:os.version=4.15.0-3-amd64
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:user.name=appsmith
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:user.home=/home/appsmith
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Server environment:user.dir=/home/appsmith/Desktop/project/tao2/winglue-well
11:49:28 INFO  o.a.zookeeper.server.ZooKeeperServer - Created server with tickTime 500 minSessionTimeout 1000 maxSessionTimeout 10000 datadir /tmp/embedded-kafka/zookeeper-snapshot/version-2 snapdir /tmp/embedded-kafka/zookeeper-log/version-2
11:49:28 INFO  o.a.z.server.NIOServerCnxnFactory - binding to port 0.0.0.0/0.0.0.0:2182
11:49:28 ERROR o.a.zookeeper.server.ZooKeeperServer - ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes

my info log when start broker

11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:java.io.tmpdir=/tmp
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:java.compiler=<NA>
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:os.name=Linux
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:os.arch=amd64
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:os.version=4.15.0-3-amd64
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:user.name=appsmith
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:user.home=/home/appsmith
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Client environment:user.dir=/home/appsmith/Desktop/project/tao2/winglue-well
11:49:34 INFO  org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=127.0.0.1:2182 sessionTimeout=6000 watcher=org.I0Itec.zkclient.ZkClient@5e4f74bd
11:49:34 INFO  org.I0Itec.zkclient.ZkClient - Waiting for keeper state SyncConnected
11:49:34 INFO  org.apache.zookeeper.ClientCnxn - Opening socket connection to server 127.0.0.1/127.0.0.1:2182. Will not attempt to authenticate using SASL (unknown error)
11:49:34 INFO  o.a.z.server.NIOServerCnxnFactory - Accepted socket connection from /127.0.0.1:44038
11:49:34 INFO  org.apache.zookeeper.ClientCnxn - Socket connection established to 127.0.0.1/127.0.0.1:2182, initiating session
11:49:34 INFO  o.a.zookeeper.server.ZooKeeperServer - Client attempting to establish new session at /127.0.0.1:44038
11:49:34 INFO  o.a.z.server.persistence.FileTxnLog - Creating new log file: log.17
11:49:34 INFO  o.a.zookeeper.server.ZooKeeperServer - Established session 0x166ec80fc460000 with negotiated timeout 6000 for client /127.0.0.1:44038
11:49:34 INFO  org.apache.zookeeper.ClientCnxn - Session establishment complete on server 127.0.0.1/127.0.0.1:2182, sessionid = 0x166ec80fc460000, negotiated timeout = 6000
11:49:34 INFO  org.I0Itec.zkclient.ZkClient - zookeeper state changed (SyncConnected)
11:49:35 INFO  org.I0Itec.zkclient.ZkEventThread - Terminate ZkClient event thread.
11:49:35 INFO  o.a.z.server.PrepRequestProcessor - Processed session termination for sessionid: 0x166ec80fc460000
11:49:35 INFO  org.apache.zookeeper.ZooKeeper - Session: 0x166ec80fc460000 closed
11:49:35 INFO  o.a.zookeeper.server.NIOServerCnxn - Closed socket connection for client /127.0.0.1:44038 which had sessionid 0x166ec80fc460000
11:49:35 INFO  org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x166ec80fc460000

How to fix this problem?
Thank you

@jeffh
Copy link
Contributor

jeffh commented Nov 8, 2018

Hey @veerapatyok, thanks for submitting an issue.

What does your list of dependencies look like? Are you using another version of kafka / zookeeper that the one that embedded-kafka depends on?

I'm just guessing that newer versions of ZK API now expects a shutdown handler that we're not providing.

Thanks,
Jeff

@veerapatyok
Copy link
Author

This is a list of dependencies I use
I use kafka client version 1.1.0

[embedded-kafka "0.6.0"]
[org.apache.kafka/kafka-clients "1.1.0"]
[ovotech/kafka-avro-confluent "0.8.0" :exclusions [org.clojure/clojure]]
[org.apache.kafka/kafka-streams "1.1.0" :exclusions [org.rocksdb/rocksdbjni com.fasterxml.jackson.core/jackson-core]]
[io.confluent/kafka-avro-serializer "4.0.0" :exclusions [com.fasterxml.jackson.core/jackson-core]]
[io.confluent/common-config "4.0.0"]
[io.confluent/common-utils "4.0.0"]
[io.confluent/kafka-schema-registry-client "4.0.0" :exclusions [com.fasterxml.jackson.core/jackson-core]]
[io.confluent/kafka-streams-avro-serde "4.0.0" :exclusions [org.slf4j/slf4j-api com.fasterxml.jackson.core/jackson-core]]

@veerapatyok
Copy link
Author

veerapatyok commented Nov 20, 2018

I solved this problem.
I added [org.apache.kafka/kafka_2.12 "1.1.0"]

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants