博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Docker系列·11] 搭建ZooKeeper服务器
阅读量:6209 次
发布时间:2019-06-21

本文共 5025 字,大约阅读时间需要 16 分钟。

搭建ZooKeeper服务器

1 Docker-Ubuntu-Zookeeper

工作目录:/home/erichan/docker-room/ubuntu-zookeeper

1.1 制作镜像

erichan@ubuntu14_04_1-pd:~/docker-room/ubuntu-zookeeper$ nano Dockerfile
# Version: 0.0.1FROM feuyeux/ubuntu-java7MAINTAINER Eric Han "feuyeux@gmail.com"RUN apt-get update && apt-get install -y wgetRUN wget http://apache.fayea.com/apache-mirror/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gzRUN tar -xzf zookeeper-3.4.6.tar.gz -C /optRUN cp /opt/zookeeper-3.4.6/conf/zoo_sample.cfg /opt/zookeeper-3.4.6/conf/zoo.cfgRUN mkdir -p /tmp/zookeeperENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64EXPOSE 2181 2888 3888WORKDIR /opt/zookeeper-3.4.6VOLUME ["/opt/zookeeper-3.4.6/conf", "/tmp/zookeeper"]ENTRYPOINT ["/opt/zookeeper-3.4.6/bin/zkServer.sh"]CMD ["start-foreground"]

1.2 创建镜像

erichan@ubuntu14_04_1-pd:~/docker-room/ubuntu-zookeeper$ d build -t feuyeux/zookeeper:3.4.6 .

1.3 测试镜像

erichan@ubuntu14_04_1-pd:~/docker-room$ d run --name zk346 -d feuyeux/zookeeper:3.4.6eab5250575338e52ef6232020deec5b8ef175caf63f1547fdc02413c4a29a5f8
erichan@ubuntu14_04_1-pd:~/docker-room$ d psCONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS                                  NAMESeab525057533        feuyeux/zookeeper:3.4.6   "/opt/zookeeper-3.4.   5 seconds ago       Up 4 seconds        3888/tcp, 2181/tcp, 22/tcp, 2888/tcp   zk346
erichan@ubuntu14_04_1-pd:~/docker-room$ d logs zk346JMX enabled by defaultUsing config: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg2014-08-24 11:52:30,063 [myid:] - INFO  [main:QuorumPeerConfig@103] - Reading configuration from: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg2014-08-24 11:52:30,067 [myid:] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 32014-08-24 11:52:30,067 [myid:] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 02014-08-24 11:52:30,067 [myid:] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.2014-08-24 11:52:30,067 [myid:] - WARN  [main:QuorumPeerMain@113] - Either no config or no quorum defined in config, running  in standalone mode2014-08-24 11:52:30,082 [myid:] - INFO  [main:QuorumPeerConfig@103] - Reading configuration from: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg2014-08-24 11:52:30,083 [myid:] - INFO  [main:ZooKeeperServerMain@95] - Starting server2014-08-24 11:52:30,088 [myid:] - INFO  [main:Environment@100] - Server environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT2014-08-24 11:52:30,088 [myid:] - INFO  [main:Environment@100] - Server environment:host.name=eab5250575332014-08-24 11:52:30,089 [myid:] - INFO  [main:Environment@100] - Server environment:java.version=1.7.0_552014-08-24 11:52:30,089 [myid:] - INFO  [main:Environment@100] - Server environment:java.vendor=Oracle Corporation2014-08-24 11:52:30,089 [myid:] - INFO  [main:Environment@100] - Server environment:java.home=/usr/lib/jvm/java-7-openjdk-amd64/jre2014-08-24 11:52:30,089 [myid:] - INFO  [main:Environment@100] - Server environment:java.class.path=/opt/zookeeper-3.4.6/bin/../build/classes:/opt/zookeeper-3.4.6/bin/../build/lib/*.jar:/opt/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/opt/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/opt/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/opt/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/opt/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/opt/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/opt/zookeeper-3.4.6/bin/../conf:2014-08-24 11:52:30,089 [myid:] - INFO  [main:Environment@100] - Server environment:java.library.path=/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/lib2014-08-24 11:52:30,089 [myid:] - INFO  [main:Environment@100] - Server environment:java.io.tmpdir=/tmp2014-08-24 11:52:30,089 [myid:] - INFO  [main:Environment@100] - Server environment:java.compiler=
2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:os.name=Linux2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:os.arch=amd642014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:os.version=3.13.0-34-generic2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:user.name=root2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:user.home=/root2014-08-24 11:52:30,092 [myid:] - INFO [main:Environment@100] - Server environment:user.dir=/opt/zookeeper-3.4.62014-08-24 11:52:30,096 [myid:] - INFO [main:ZooKeeperServer@755] - tickTime set to 20002014-08-24 11:52:30,096 [myid:] - INFO [main:ZooKeeperServer@764] - minSessionTimeout set to -12014-08-24 11:52:30,096 [myid:] - INFO [main:ZooKeeperServer@773] - maxSessionTimeout set to -12014-08-24 11:52:30,114 [myid:] - INFO [main:NIOServerCnxnFactory@94] - binding to port 0.0.0.0/0.0.0.0:2181erichan@ubuntu14_04_1-pd:~/docker-room$

参考:

2 ZK Cluster

作者:

转载地址:http://gtkja.baihongyu.com/

你可能感兴趣的文章
[iOS Animation]-CALayer 性能优化实例
查看>>
CentOS多网卡重命名配置
查看>>
变态青蛙跳
查看>>
Git常用命令总结
查看>>
定时任务
查看>>
MyBatis之输入与输出(resultType、resultMap)映射
查看>>
剥开比原看代码09:通过dashboard创建密钥时,前端的数据是如何传到后端的?
查看>>
Yeslab现任明教教主ISE课程前七部分免费发布
查看>>
linux下恢复误删文件
查看>>
Universal-Image-Loader,android-Volley,Picasso、Fresco和Glide开源组件加载网络图片的优缺点比较...
查看>>
RAID的肤浅认识
查看>>
poxtfix+dovecot+saslauthd+courier-authlib +mysql + extmail 完整虚拟邮箱系统部署
查看>>
Erlang并发机制 –进程调度
查看>>
DHCP服务开启了,为什么老是网络冲突
查看>>
MySql 自动更新时间为当前时间
查看>>
Configuring Aggregated Ethernet Interfaces
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
Asp.net页面和Html页面之间的关系
查看>>
[故障解决]Mysql爆出ERROR 1044 (42000)的错误怎么办?
查看>>