Start SQLFire Peers and Servers Using Locators

SQLFire peers or servers must specify a list of locator addresses to connect to when they join the distributed system.

Use the -locators option when starting a SQLFire server or peer to identify the peer connection the member should use to join the distributed system. In the previous section, Start and Stop Locators, two locators were started using the -peer-discovery-address and -peer-discovery-port combinations of "locator1host:10101" and "locator2host:20202." In order to join the distributed system created by these locators, new SQLFire servers must specify those peer connections at startup.

For example, to start a new SQLFire server in the same cluster defined in Start and Stop Locators, use the command:
sqlf server start -locators=locator1host[10101],locator2host[20202] \
     -client-bind-address=server1host -client-port=1529 -dir=server1
Any additional servers joining the same cluster would likewise specify the same list of locators:
sqlf server start -locators=locator1host[10101],locator2host[20202] \
     -client-bind-address=server2host -client-port=1530 -dir=server2
Embedded SQLFire peers can supply the locators attribute in the JDBC peer client connection string. For example:

As each server or peer joins the distributed system, both locators update their information with the new server's client connection information. Note that although each server defines a client bind address and port, individual clients should connect directly to one of the available locators rather than to an individual server. In this way, the locator can load balance client connections to available servers, and can manage the list of available servers as they leave and join the distributed system.