Apache ZooKeeper
- Last Updated: March 1, 2021
- 2 minute read
- DataDirect Connectors
- JDBC
- Apache Hive 6.0
- Documentation
Apache ZooKeeper is a centralized service that facilitates the coordination of distributed applications using a simple hierarchal architecture. In addition to supporting centralized administration of configuration information, ZooKeeper offers a number of features out of the box, including naming, synchronization, and group services. ZooKeeper services can be replicated onto server clusters, called ensembles, which allow for a scalable environment with a high-level of availability. The driver supports retrieving connection information from Apache ZooKeeper services using the methods described in this section.
- Set the ZooKeeperDiscovery property to true (Enabled).
- Set the ZooKeeperNamespace property to specify the name of the ZooKeeper name space to which you want to retrieve configuration information.
- Set the ServerName connection property to specify a list of the member
servers for the ZooKeeper ensemble to which you want to connect. The value for this
property takes the following form:
server_name:port_number | IP_address:port_number [, ...]
Note: The driver will return an error if unable to connect to any of the ZooKeeper servers specified with the ServerName property.
The following example demonstrates a basic connection to Apache ZooKeeper:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:hive://ZKServer1:10000,255.125.1.11:2818,ZKServer3:2828;
ZooKeeperNamespace=mynamespace1;ZooKeeperDiscovery=true");
| Retrieved Configuration Information | Overridden Connection Properties |
|---|---|
| Server name | ServerName |
| Port number | PortNumber |
| Kerberos-related settings | |
| Encryption-related settings | EncryptionMethod |
| Transport mode related settings |