Using Apache ZooKeeper as the Membership Service

Apache ZooKeeper is a third-party, open-source centralized service that maintains information for distributed systems and coordinates services for multiple hosts. TimesTen Scaleout uses Apache ZooKeeper to provide its membership service, which tracks the status of all instances and provides a consistent view of the instances that are active within a grid.

TimesTen Scaleout requires that you install and configure Apache ZooKeeper to work as the membership service for a grid. Each membership server in a grid is an Apache ZooKeeper server.

Note:

Since membership servers are ZooKeeper servers, see the Apache ZooKeer website on how to use and manage ZooKeeper servers.

If you create a second grid, you can use the same ZooKeeper servers to act as the membership service for the second grid. However, all ZooKeeper servers should act only as a membership service for TimesTen Scaleout.

For ZooKeeper servers in a production environment, it is advisable to:

  • Configure an odd number of replicated ZooKeeper servers on separate hosts. Use a minimum of three ZooKeeper servers for your membership service. If you have n ZooKeeper servers, you should have (n/2+1) ZooKeeper servers active as a majority. A larger number of ZooKeeper servers increases reliability.

  • It is recommended (but not required) that you use hosts for your membership servers that are separate from any hosts used for instances. If you do locate your ZooKeeper servers and instances on separate hosts, then this guarantees that if the host fails, you do not lose both the instance and one of the membership servers.

  • Avoid having ZooKeeper servers be subject to any single point of failure. For example, use independent physical racks, power sources, and network locations.

  • Your ZooKeeper servers could share the same physical infrastructure as your data instances. For example, if your data instances are spread across two physical racks, you could host your ZooKeeper servers in these same two racks.

    For example, you configure your grid with an active and standby management instance, three data space groups (each with two data instances), and three ZooKeeper servers configured in your grid. If you have three data racks, the best way to organize your hosts is to:

    • Locate one of the management instances on rack 1 and the other management instance on rack 2.

    • Locate each of the ZooKeeper servers on a different rack.

    • Locate the hosts for data instances for data space group 1 on rack 1, the hosts for the data instances for data space group 2 on rack 2, and the hosts for the data instances for data space group 3on rack 3.

    Thus, if any of the racks loses power or its Ethernet connection, this grid continues to work since the ZooKeeper servers can still reach majority. A grid does not work without at least a majority of the configured ZooKeeper servers active.

  • Configure a user name and password for instances to use for authenticated access to the ZooKeeper servers. See Membership Services Access Control in Oracle TimesTen In-Memory Database Security Guide.

Note:

For more directions for best practices for your ZooKeeper servers, go to the Apache ZooKeer website.