Browse Source

Replace Zookpeer Docker compose example with stack (#1033)

Elisey Zanko 8 năm trước cách đây
mục cha
commit
7ae8e1da42
2 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 2 2
      zookeeper/content.md
  2. 5 1
      zookeeper/stack.yml

+ 2 - 2
zookeeper/content.md

@@ -28,9 +28,9 @@ $ docker run --name some-app --link some-zookeeper:zookeeper -d application-that
 $ docker run -it --rm --link some-zookeeper:zookeeper zookeeper zkCli.sh -server zookeeper
 ```
 
-## %%COMPOSE%%
+## %%STACK%%
 
-This will start Zookeeper in [replicated mode](http://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_RunningReplicatedZooKeeper). Run `docker-compose up` and wait for it to initialize completely. Ports `2181-2183` will be exposed.
+This will start Zookeeper in [replicated mode](http://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_RunningReplicatedZooKeeper). Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker-compose -f stack.yml up`) and wait for it to initialize completely. Ports `2181-2183` will be exposed.
 
 > Please be aware that setting up multiple servers on a single machine will not create any redundancy. If something were to happen which caused the machine to die, all of the zookeeper servers would be offline. Full redundancy requires that each server have its own machine. It must be a completely separate physical server. Multiple virtual machines on the same physical host are still vulnerable to the complete failure of that host.
 

+ 5 - 1
zookeeper/docker-compose.yml → zookeeper/stack.yml

@@ -1,8 +1,10 @@
-version: '2'
+version: '3.1'
+
 services:
     zoo1:
         image: zookeeper
         restart: always
+        hostname: zoo1
         ports:
             - 2181:2181
         environment:
@@ -12,6 +14,7 @@ services:
     zoo2:
         image: zookeeper
         restart: always
+        hostname: zoo2
         ports:
             - 2182:2181
         environment:
@@ -21,6 +24,7 @@ services:
     zoo3:
         image: zookeeper
         restart: always
+        hostname: zoo3
         ports:
             - 2183:2181
         environment: