ZooKeeper@Docker – シングルノード

表題の環境を試す。

■ 環境

  • ZooKeeper 3.4.9
  • Docker for Mac 1.12.1
  • Mac OSX ElCapitan

■ run

ZooKeeperをとりあえずシングルノードで稼働させてみる。

$ docker run -d --name zk zookeeper
9d2f562d9475d830fb4e844dcff69e338c7fc450666919ffb6e50f4de22c561f
$

アクセスするには`zkCli`用のコンテナを起動する。

$ docker run -ti --rm --link zk:zk zookeeper zkCli.sh -server zk
Connecting to zk
2016-10-04 19:25:37,817 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT
2016-10-04 19:25:37,820 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=9ed51322280c
2016-10-04 19:25:37,820 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.8.0_92-internal
2016-10-04 19:25:37,822 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2016-10-04 19:25:37,822 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/usr/lib/jvm/java-1.8-openjdk/jre
2016-10-04 19:25:37,822 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/zookeeper-3.4.9/bin/../build/classes:/zookeeper-3.4.9/bin/../build/lib/*.jar:/zookeeper-3.4.9/bin/../lib/slf4j-log4j12-1.6.1.jar:/zookeeper-3.4.9/bin/../lib/slf4j-api-1.6.1.jar:/zookeeper-3.4.9/bin/../lib/netty-3.10.5.Final.jar:/zookeeper-3.4.9/bin/../lib/log4j-1.2.16.jar:/zookeeper-3.4.9/bin/../lib/jline-0.9.94.jar:/zookeeper-3.4.9/bin/../zookeeper-3.4.9.jar:/zookeeper-3.4.9/bin/../src/java/lib/*.jar:/conf:
2016-10-04 19:25:37,822 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64:/usr/lib/jvm/java-1.8-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2016-10-04 19:25:37,823 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2016-10-04 19:25:37,823 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=
2016-10-04 19:25:37,823 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2016-10-04 19:25:37,823 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2016-10-04 19:25:37,824 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=4.4.20-moby
2016-10-04 19:25:37,824 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=root
2016-10-04 19:25:37,824 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/root
2016-10-04 19:25:37,824 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/zookeeper-3.4.9
2016-10-04 19:25:37,825 [myid:] - INFO  [main:ZooKeeper@438] - Initiating client connection, connectString=zk sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@3eb07fd3
2016-10-04 19:25:37,845 [myid:] - INFO  [main-SendThread(zk:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server zk/172.17.0.2:2181. Will not attempt to authenticate using SASL (unknown error)
Welcome to ZooKeeper!
JLine support is enabled
2016-10-04 19:25:37,915 [myid:] - INFO  [main-SendThread(zk:2181):ClientCnxn$SendThread@876] - Socket connection established to zk/172.17.0.2:2181, initiating session
2016-10-04 19:25:37,958 [myid:] - INFO  [main-SendThread(zk:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server zk/172.17.0.2:2181, sessionid = 0x1578ab473ab0001, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null

[zk: zk(CONNECTED) 0]

なるほど。

先日”latest“のタグでDockerコンテナを`pull`しているが、現状の最新版である”3.4.9“で動いている様子。JavaはOpenJDKの1.8であるようだ。

以上。

■ 関連

コメントを残す

メールアドレスが公開されることはありません。

CAPTCHA


This site uses Akismet to reduce spam. Learn how your comment data is processed.