Skip to content

Commit 356882d

Browse files
symatMate Szalay-Beko
authored andcommitted
ZOOKEEPER-3188: document new configuration format for using multiple addresses
1 parent 45b6c0f commit 356882d

3 files changed

Lines changed: 49 additions & 2 deletions

File tree

zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,13 @@ ensemble:
202202
though about a few here:
203203
Every machine that is part of the ZooKeeper ensemble should know
204204
about every other machine in the ensemble. You accomplish this with
205-
the series of lines of the form **server.id=host:port:port**. The parameters **host** and **port** are straightforward. You attribute the
205+
the series of lines of the form **server.id=host:port:port**.
206+
(The parameters **host** and **port** are straightforward, for each server
207+
you need to specify first a Quorum port then a dedicated port for ZooKeeper leader
208+
election). Since ZooKeeper 3.6.0 you can also [specify multiple addresses](#id_multi_address)
209+
for each ZooKeeper server instance (this can increase availability when multiple physical
210+
network interfaces can be used parallel in the cluster).
211+
You attribute the
206212
server id to each machine by creating a file named
207213
*myid*, one for each server, which resides in
208214
that server's data directory, as specified by the configuration file
@@ -1042,7 +1048,7 @@ of servers -- that is, when deploying clusters of servers.
10421048
>Turning on leader selection is highly recommended when
10431049
you have more than three ZooKeeper servers in an ensemble.
10441050

1045-
* *server.x=[hostname]:nnnnn[:nnnnn], etc* :
1051+
* *server.x=[hostname]:nnnnn[:nnnnn] etc* :
10461052
(No Java system property)
10471053
servers making up the ZooKeeper ensemble. When the server
10481054
starts up, it determines which server it is by looking for the
@@ -1057,6 +1063,21 @@ of servers -- that is, when deploying clusters of servers.
10571063
The first followers use to connect to the leader, and the second is for
10581064
leader election. If you want to test multiple servers on a single machine, then
10591065
different ports can be used for each server.
1066+
1067+
1068+
<a name="id_multi_address"></a>
1069+
Since ZooKeeper 3.6.0 it is possible to specify **multiple addresses** for each
1070+
ZooKeeper server (see [ZOOKEEPER-3188](https://issues.apache.org/jira/projects/ZOOKEEPER/issues/ZOOKEEPER-3188)).
1071+
This helps to increase availability and adds network level
1072+
resiliency to ZooKeeper. When multiple physical network interfaces are used
1073+
for the servers, ZooKeeper is able to bind on all interfaces and runtime switching
1074+
to a working interface in case a network error. The different addresses can be specified
1075+
in the config using a pipe ('|') character. A valid configuration using multiple addresses looks like:
1076+
1077+
server.1=zoo1-net1:2888:3888|zoo1-net2:2889:3889
1078+
server.2=zoo2-net1:2888:3888|zoo2-net2:2889:3889
1079+
server.3=zoo3-net1:2888:3888|zoo3-net2:2889:3889
1080+
10601081

10611082
* *syncLimit* :
10621083
(No Java system property)

zookeeper-docs/src/main/resources/markdown/zookeeperReconfig.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ limitations under the License.
1919
* [Overview](#ch_reconfig_intro)
2020
* [Changes to Configuration Format](#ch_reconfig_format)
2121
* [Specifying the client port](#sc_reconfig_clientport)
22+
* [Specifying multiple server addresses](#sc_multiaddress)
2223
* [The standaloneEnabled flag](#sc_reconfig_standaloneEnabled)
2324
* [The reconfigEnabled flag](#sc_reconfig_reconfigEnabled)
2425
* [Dynamic configuration file](#sc_reconfig_file)
@@ -109,6 +110,26 @@ Examples of legal server statements:
109110
server.5 = 125.23.63.23:1234:1235;125.23.63.24:1236
110111
server.5 = 125.23.63.23:1234:1235:participant;125.23.63.23:1236
111112

113+
114+
<a name="sc_multiaddress"></a>
115+
116+
### Specifying multiple server addresses
117+
118+
Since ZooKeeper 3.6.0 it is possible to specify multiple addresses for each
119+
ZooKeeper server (see [ZOOKEEPER-3188](https://issues.apache.org/jira/projects/ZOOKEEPER/issues/ZOOKEEPER-3188)).
120+
This helps to increase availability and adds network level
121+
resiliency to ZooKeeper. When multiple physical network interfaces are used
122+
for the servers, ZooKeeper is able to bind on all interfaces and runtime switching
123+
to a working interface in case a network error. The different addresses can be
124+
specified in the config using a pipe ('|') character.
125+
126+
Examples for a valid configurations using multiple addresses:
127+
128+
server.2=zoo2-net1:2888:3888|zoo2-net2:2889:3889;2188
129+
server.2=zoo2-net1:2888:3888|zoo2-net2:2889:3889|zoo2-net3:2890:3890;2188
130+
server.2=zoo2-net1:2888:3888|zoo2-net2:2889:3889;zoo2-net1:2188
131+
server.2=zoo2-net1:2888:3888:observer|zoo2-net2:2889:3889:observer;2188
132+
112133
<a name="sc_reconfig_standaloneEnabled"></a>
113134

114135
### The _standaloneEnabled_ flag

zookeeper-docs/src/main/resources/markdown/zookeeperStarted.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ server have its own machine. It must be a completely separate
355355
physical server. Multiple virtual machines on the same physical
356356
host are still vulnerable to the complete failure of that host.
357357

358+
>If you have multiple network interfaces in your ZooKeeper machines,
359+
you can also instruct ZooKeeper to bind on all of your interfaces and
360+
automatically switch to a healthy interface in case of a network failure.
361+
For details, see the [Configuration Parameters](zookeeperAdmin.html#id_multi_address).
362+
358363
<a name="other-optimizations"></a>
359364

360365
### Other Optimizations

0 commit comments

Comments
 (0)