This section provides the steps for creating a highly available cluster, and testing HTTP session persistence.
This section discusses the following topics:
Before configuring HADB, do the following:
Install Application Server instances and the Load Balancer Plug-in.
For more information, see the Java Enterprise System Installation Guide (if you are using Java ES) or Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Installation Guide (if you are using the standalone Application Server installer).
Create Application Server domains and clusters.
For more information, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide.
Install and configure your web server software.
For more information, see Configuring Web Servers for Load Balancing
Setup and configure load balancing.
For more information, see Setting Up HTTP Load Balancing.
The management agent, ma, executes management commands on HADB hosts and ensures availability of the HADB node supervisor processes by restarting them if they fail.
For a production deployment, start the management agent as a service to ensure its availability. This section provides abbreviated instructions for starting the management agent as a service with its default configuration.
For more details, including instructions on starting the management agent in console mode for testing or evaluation and information on customizing its configuration, see Using the HADB Management Agent.
This section describes how to start the management agent as a service with default configuration when using Java Enterprise System.
Create the following softlinks to the file /etc/init.d/ma-initd:
/etc/rc0.d/K20ma-initd /etc/rc1.d/K20ma-initd /etc/rc2.d/K20ma-initd /etc/rc3.d/S99ma-initd /etc/rc5.d/S99ma-initd /etc/rcS.d/K20ma-initd |
Reboot the machine.
To deactivate automatic start and stop of the agent, remove the links or change the letters K and S in the link names to lowercase.
Open a command window.
Enter the command: HADB_install_dir\bin\ma -i.
This installs and starts the management agent with its default configuration.
To stop the management agent and remove (deregister) it as a service, use the command: HADB_install_dir\bin\ma -r
In a shell, change your current directory to HADB_install_dir /bin.
Edit the shell script ma-initd .
Replace the default values of HADB_ROOT and HADB_MA_CFG in the script to reflect your installation:
HADB_ROOT is the HADB installation directory, HADB_install_dir.
HADB_MA_CFG is the location of the management agent configuration file. For more information, see Customizing Management Agent Configuration
Copy ma-initd to the directory /etc/init.d
Create the following soft links to the file /etc/init.d/ma-initd:
/etc/rc0.d/K20ma-initd /etc/rc1.d/K20ma-initd /etc/rc2.d/K20ma-initd /etc/rc3.d/S99ma-initd /etc/rc5.d/S99ma-initd /etc/rcS.d/K20ma-initd |
Open a command window.
Enter the command: HADB_install_dir\bin\ma -i ma.cfg
Now if the process fails or the machine reboots, the management agent will automatically restart.
To stop the management agent and remove (deregister) it as a service, use the command: HADB_install_dir\bin\ma -r ma.cfg
Before starting this section, you must have created one or more Application Server clusters. For information on how to create a cluster, see To Create a Cluster.
From the machine on which the Domain Administration Server is running, configure the cluster to use HADB using this command:
asadmin configure-ha-cluster --user admin --hosts hadb_hostname,hadb_hostname --devicesize 256 clusterName
Replace hadb_hostname with the host name of the machine where HADB is running, and clusterName with the name of the cluster. If you are using just one machine, you must provide the host name twice.
This simplified example runs two nodes of HADB on the same machine. In production settings, using more than one machine is recommended.
In Admin Console, select the application under Applications > Enterprise Applications. Set Availability Enabled and then click Save.
To restart a cluster in Admin Console, choose Clusters > cluster-name. Click Stop Instances. Once the instances have stopped, click “Start Instances.”
Alternatively, use these asadmin commands:
asadmin stop-cluster --user admin cluster-name asadmin start-cluster --user admin cluster-name
For more information on these commands, see stop-cluster(1) and start-cluster(1).
To restart the Web Server, type this Web Server command:
web_server_root/https-hostname/reconfig
Replace web_server_root with your Web Server root directory and hostname with the name of your host machine.