|
@@ -358,30 +358,34 @@
|
|
|
<section id="ch_zkSessions">
|
|
|
<title>ZooKeeper Sessions</title>
|
|
|
|
|
|
- <para>When a client gets a handle to the ZooKeeper service, ZooKeeper
|
|
|
- creates a ZooKeeper session, represented as a 64-bit number, that it
|
|
|
- assigns to the client. If the client connects to a different ZooKeeper
|
|
|
- server, it will send the session id as a part of the connection handshake.
|
|
|
- As a security measure, the server creates a password for the session id
|
|
|
- that any ZooKeeper server can validate.The password is sent to the client with the session id when the
|
|
|
- client establishes the session. The client sends this password with the
|
|
|
- session id whenever it reestablishes the session with a new server.</para>
|
|
|
-
|
|
|
- <para>One of the parameters to the ZooKeeper client library call to create
|
|
|
- a ZooKeeper session is the session timeout in milliseconds. The client
|
|
|
- sends a requested timeout, the server responds with the timeout that it
|
|
|
- can give the client. The current implementation requires that the timeout
|
|
|
- be between 2 times the tickTime (as set in the server configuration) and
|
|
|
- 60 seconds.</para>
|
|
|
-
|
|
|
- <para>The session is kept alive by requests sent by the client. If the
|
|
|
- session is idle for a period of time that would timeout the session, the
|
|
|
- client will send a PING request to keep the session alive. This PING
|
|
|
- request not only allows the ZooKeeper server to know that the client is
|
|
|
- still active, but it also allows the client to verify that its connection
|
|
|
- to the ZooKeeper server is still active. The timing of the PING is
|
|
|
- conservative enough to ensure reasonable time to detect a dead connection
|
|
|
- and reconnect to a new server.</para>
|
|
|
+ <para>When a client gets a handle to the ZooKeeper service,
|
|
|
+ ZooKeeper creates a ZooKeeper session, represented as a 64-bit
|
|
|
+ number, that it assigns to the client. If the client connects to a
|
|
|
+ different ZooKeeper server, it will send the session id as a part
|
|
|
+ of the connection handshake. As a security measure, the server
|
|
|
+ creates a password for the session id that any ZooKeeper server
|
|
|
+ can validate.The password is sent to the client with the session
|
|
|
+ id when the client establishes the session. The client sends this
|
|
|
+ password with the session id whenever it reestablishes the session
|
|
|
+ with a new server.</para>
|
|
|
+
|
|
|
+ <para>One of the parameters to the ZooKeeper client library call
|
|
|
+ to create a ZooKeeper session is the session timeout in
|
|
|
+ milliseconds. The client sends a requested timeout, the server
|
|
|
+ responds with the timeout that it can give the client. The current
|
|
|
+ implementation requires that the timeout be a minimum of 2 times
|
|
|
+ the tickTime (as set in the server configuration) and a maximum of
|
|
|
+ 20 times the tickTime.</para>
|
|
|
+
|
|
|
+ <para>The session is kept alive by requests sent by the client. If
|
|
|
+ the session is idle for a period of time that would timeout the
|
|
|
+ session, the client will send a PING request to keep the session
|
|
|
+ alive. This PING request not only allows the ZooKeeper server to
|
|
|
+ know that the client is still active, but it also allows the
|
|
|
+ client to verify that its connection to the ZooKeeper server is
|
|
|
+ still active. The timing of the PING is conservative enough to
|
|
|
+ ensure reasonable time to detect a dead connection and reconnect
|
|
|
+ to a new server.</para>
|
|
|
</section>
|
|
|
|
|
|
<section id="ch_zkWatches">
|