Two load balancers are configured for the Directory Server installations. Load Balancer 1 fronts the configuration data instances and Load Balancer 2 fronts the user data instances. In the following procedure, you configure a load balancer in front of the configuration data instances. The following figure illustrates this architecture.
This procedure assumes that you have already installed a load balancer.
The load balancer hardware and software used in this deployment is BIG-IP® manufactured by F5 Networks. If you are using different load balancer software, see the documentation that comes with that product for detailed settings information.
Contact your network administrator to obtain an available virtual IP address for the load balancer you want to configure.
Know the IP address of the load balancer hardware, the URL for the load balancer login page, and a username and password for logging in to the load balancer application.
Get the IP addresses for Directory Server 1 and Directory Server 2 by running the following command on each host machine:
# ifconfig -a |
Access https://is-f5.example.com, the BIG-IP load balancer login page, in a web browser.
Log in using the following information:
username
password
Click Configure your BIG-IP (R) using the Configuration Utility.
Create a Pool.
A pool contains all the backend server instances.
In the left pane, click Pools.
On the Pools tab, click Add.
In the Add Pool dialog, provide the following information:
DirectoryServer-ConfigData-Pool
Round Robin
Add the IP address and port number of both Directory Server hosts: DirectoryServer-1:1389 and DirectoryServer-2:1389.
Click Done.
Add a Virtual Server.
This step defines instances of the load balancer.
If you encounter JavaScriptTM errors or otherwise cannot proceed to create a virtual server, try using Internet Explorer.
In the left frame, Click Virtual Servers.
On the Virtual Servers tab, click Add.
In the Add a Virtual Server dialog box, provide the following information:
Enter the IP address for the LoadBalancer-1.example.com
389
DirectoryServer-ConfigData-Pool
Continue to click Next until you reach the Pool Selection dialog box.
In the Pool Selection dialog box, assign DirectoryServer-ConfigData-Pool to the virtual server.
Click Done.
Add Monitors
Monitors are required by the load balancer to detect backend server failures.
In the left frame, click Monitors.
Click the Basic Associations tab.
Add an LDAP monitor for the Directory Server 1 node.
In the Node column, locate the IP address and port number, DirectoryServer–1:1389, and select the Add checkbox.
Add an LDAP monitor for the Directory Server 2 node.
In the Node column, locate the IP address and port number, DirectoryServer–2:1389, and select the Add checkbox.
At the top of the Node column, in the drop-down list, choose ldap-tcp.
Click Apply.
Configure the load balancer for simple persistence.
The configuration data load balancer is configured for simple persistence. With simple persistence, all requests sent within a specified interval are processed by the same Directory Server instance, ensuring complete replication of entries. For example, when a request requires information to be written to Directory Server 1, that information must also be replicated to Directory Server 2. As the replication takes time to complete, if a related request is directed by the load balancer to Directory Server 2 during the replication process itself, the request may fail as the entry might only be partially created. When properly configured, simple persistence ensures that both requests are routed to Directory Server 1 and processed in consecutive order; the first request is finished before the second request begins processing. Simple persistence ensures that within the specified interval, no errors or delays occur due to replication time or redirects when retrieving data. Simple persistence tracks connections based only on the client IP address.
Verify the Directory Server load balancer configuration.
Log in as a root user to the host machine of each Directory Server instance.
On each Directory Server host machine, use the tail command to monitor the Directory Server access log.
# cd /var/opt/mps/am-config/logs # tail -f access |
You should see connections to the load balancer IP address opening and closing. For example:
[12/Oct/2006:13:10:20-0700] conn=54 op=-1 msgId=-1 — fd=22 slot=22 LDAP connection from IP_address to IP_address [12/Oct/2006:13:10:20-0700] conn=54 op=-1 msgId=-1 — closing — B1 [12/Oct/2006:13:10:20-0700] conn=54 op=-1 msgId=-1 — closed.
Execute the following LDAP search against the Directory Server load balancer.
# ldapsearch -h LoadBalancer-1.example.com -p 389 -b "dc=example,dc=com" -D "cn=directory manager" -w d1rm4n4ger "(objectclass=*)" |
The ldapsearch operation should return entries. Make sure they display in the access log on only one Directory Server.
Run dsadm stop to stop Directory Server 1.
# cd /var/opt/mps/serverroot/ds6/bin # ./dsadm stop /var/opt/mps/am-config |
Again perform the LDAP search against the Directory Server load balancer to confirm that the request is forwarded to the running Directory Server 2.
# ldapsearch -h LoadBalancer-1.example.com -p 389 -b "dc=example,dc=com" -D "cn=directory manager" -w d1rm4n4ger "(objectclass=*)" |
The ldapsearch operation should return entries. Verify that the entries display in the access log only on Directory Server 2.
You may encounter the following error message:
ldap_simple_bind: Cant' connect to the LDAP server — Connection refused
This means that the load balancer may not fully detect that Directory Server 1 is stopped. In this case, you may have started the search too soon based on the polling interval setting. For example, if the polling interval is set to 10 seconds, you should wait ten seconds to start the search. You can reset the timeout properties to a lower value using the following procedure.
Click the Monitors tab.
Click the ldap-tcp monitor name.
In the Interval field, set the value to 5.
This tells the load balancer to poll the server every 5 seconds.
In the Timeout field, set the value to 16.
Click Apply and repeat the LDAP search.
See your load balancer documentation for more information on the timeout property.
Start Directory Server 1.
# ./dsadm start /var/opt/mps/am-config |
Stop Directory Server 2.
# cd /var/opt/mps/serverroot/ds6/bin # ./dsadm stop /var/opt/mps/am-config |
Perform the following LDAP search against the Directory Server load balancer to confirm that the request is forwarded to the running Directory Server 1.
# ldapsearch -h LoadBalancer-1.example.com -p 389 -b "dc=example,dc=com" -D "cn=Directory Manager" -w d1rm4n4ger "(objectclass=*)" |
The ldapsearch operation should return entries. Verify that the entries display in the access log only on Directory Server 1.
Start Directory Server 2.
# ./dsadm start /var/opt/mps/am-config |
Log out of both Directory Server host machines and the load balancer console.