zoukankan      html  css  js  c++  java
  • dockercompose环境下zookeeper单机搭建、集群搭建

    一、单机模式

    version: '3.1'
    services:
      zoo1:
        image: zookeeper:latest
        restart: always
        ports:
          - 2181:2181

    二、集群模式

    version: '3.1'
    services:
      zoo1:
        image: zookeeper:latest
        restart: always
        hostname: zoo1
        ports:
          - 2181:2181
        environment:
          ZOO_MY_ID: 1
          ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
      zoo2:
        image: zookeeper:latest
        restart: always
        hostname: zoo2
        ports:
          - 2182:2181
        environment:
          ZOO_MY_ID: 2
          ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=0.0.0.0:2888:3888;2181 server.3=zoo3:2888:3888;2181
      zoo3:
        image: zookeeper:latest
        restart: always
        hostname: zoo3
        ports:
          - 2183:2181
        environment:
          ZOO_MY_ID: 3
          ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=0.0.0.0:2888:3888;2181

    参考链接:https://blog.csdn.net/qq_28410283/article/details/108870828

  • 相关阅读:
    B树,B+树
    中断
    死锁
    无锁队列
    Cookie和Session
    分布式系统一致性
    c++ 标准库迭代器失效
    html5 app图片预加载
    html5 手机APP计算高度问题
    html5 750 REM JS换算方法
  • 原文地址:https://www.cnblogs.com/raorao1994/p/15579652.html
Copyright © 2011-2022 走看看