There are two reasons to expand your original HADB configuration:
Volume of session data being saved increases beyond existing storage space in data devices. Transactions may start aborting due to full data devices.
User load increases, exhausting system resources. You need to add more hosts.
This section describes how you can expand HADB without shutting down your Enterprise Server cluster or database, in particular:
Also see related information in Maintaining HADB Machines .
Add HADB storage space:
If user transactions repeatedly abort with one of the following error messages:
4592: No free blocks on data devices
4593: No unreserved blocks on data devices
If the hadbm deviceinfo command consistently reports insufficient free size. See Getting Device Information.
You may also want to add storage space to existing nodes if there is unused disk space on the nodes or when you add disk capacity. For information on the recommended data device size, see Specifying Device Size
To add storage space to nodes, use the hadbm set command to increase data device size.
hadbm set DataDeviceSize=size
where size is the data device size in MBytes.
See General Options for a description of command options.
Changing the data device size for a database in a FaultTolerant or higher state upgrades the system without loss of data or availability. The database remains in operational during the reconfiguration. Changing device size on a system that is not FaultTolerant or better causes loss of data. For more information about database states, see Database States.
The following command is an example of setting data device size:
hadbm set DataDeviceSize=1024
You may want to add machines if HADB requires more processing or storage capacity. To add a new machine on which to run HADB, install HADB packages with or without the Enterprise Serveras described in Chapter 2, Installing and Setting Up High Availability Database. For an explanation of node topology alternatives, see the Selecting a Topology chapter in Sun GlassFish Enterprise Server 2.1 Deployment Planning guide on docs.sun.com.
Start management agents on the new nodes.
Extend the management domain to the new hosts.
For details, see hadbm extenddomain command.
Start the new nodes on these hosts.
For details, see Adding Nodes
To increase processing and storage capacity of an HADB system, create new nodes and add them to the database.
After you add nodes, update the following properties of the HADB JDBC connection pool:
The serverlist property.
Steady pool size. Generally, you add 8 more connections for each new node. .
To add nodes, use the hadbm addnodes command. The command syntax is:
hadbm addnodes [--no-refragment] [--spares=sparecount] [--historypath=path] [--devicepath=path] [--set=attr-name-value-list] [--dbpassword=password | --dbpasswordfile=file ] [--adminpassword=password | --adminpasswordfile=file] --hosts=hostlist [dbname]
The dbname operand specifies the database name. The default is hadb. The database must be in HAFaultTolerant or FaultTolerant state. For more information about database states, see Database States.
If you do not specify the --devicepath and --historypath options, the new nodes will have the same device path and use the same history files as the existing database.
Adding nodes performs a refragmentation and redistribution of the existing data to include the new nodes in the system. Online refragmenting requires that the disks for the HADB nodes have enough space to contain the old data and the new data simultaneously until refragmenting is finished, that is, the user data size must not exceed 50% of the space available for user data. For details, see Getting Device Information
The best time to add nodes is when the system is lightly loaded.
For example:
hadbm addnodes -adminpassword=password --hosts n6,n7,n8,n9
The following table describes the special hadbm addnodes command options. See General Options for a description of other options.
Table 3–13 hadbm addnodes Options
Option |
Description |
Default |
---|---|---|
-r |
Do not refragment the database during node creation; In this case, refragment the database later using the hadbm refragment command to use the new nodes. For details about refragmentation, see Refragmenting the Database If you do not have sufficient device space for refragmentation, recreate the database with more nodes. See Adding Nodes by Recreating the Database |
Not applicable |
-s |
Number of new spare nodes in addition to those that already exist. Must be even and not greater than the number of nodes added. |
0 |
-d |
Path to the devices. Devices are:
|
Solaris and Linux: HADB_install_dir/device Windows: C:\Sun\AppServer\SUNWhadb\vers, where vers is the HADB version number. |
-H |
Comma-separated list of new host names for the new nodes in the database. One node is created for each comma-separated item in the list. The number of nodes must be even. IP addresses of HADB hosts must be IPv4 addresses. Using duplicate host names creates multiple nodes on the same machine with different port numbers. Make sure that nodes on the same machine are not mirror nodes. Odd numbered nodes are in one DRU, even numbered nodes in the other. If --spares is used, new spare nodes are those with the highest numbers. If the database was created with double network interfaces, the new nodes must be configured in the same way. See Configuring Network Redundancy . |
None |
Refragment the database to store data in newly-created nodes. Refragmentation distributes data evenly across all active nodes.
To refragment the database, use the hadbm refragment command. The command syntax is:
hadbm refragment [--dbpassword=password | --dbpasswordfile=file] [--adminpassword=password | --adminpasswordfile=file] [--agent=maurl] [dbname]
The dbname operand specifies the database name. The default is hadb. The database must be in HAFaultTolerant or FaultTolerant state. For more information about database states, see Getting the Status of HADB.
See General Options for a description of command options. For more information, see hadbm-refragment(1).
Online refragmentation requires that the disks for the HADB nodes have enough space to contain the old data and the new data simultaneously until refragmenting is finished, that is, the user data size must not exceed 50% of the space available for user data. For details, see Getting Device Information
The best time to refragment the database is when the system is lightly loaded.
If this command fails after multiple attempts, see Adding Nodes by Recreating the Database
For example:
hadbm refragment
If online refragmentation fails persistently when you add new nodes (either due to lack of data device space or other reasons), recreate the database with new nodes. This will lead to the loss of existing user data and schema data.
This procedure enables you to maintain HADB availability throughout the process.
For each Enterprise Server instance:
Disable the Enterprise Server instance in the load balancer.
Disable session persistence.
Restart the Enterprise Server instance.
Re-enable the Enterprise Server instance in the load balancer.
If you do not need to maintain availability, you can disable and re-enable all the server instances at once in the load balancer. This saves time and prevents failover of outdated session data.
Stop the database as described in Stopping a Database .
Delete the database as described in Removing a Database .
Recreate the database with the additional nodes as described in Creating a Database.
Reconfigure the JDBC connection pool as described in Configuring the JDBC Connection Pool.
Reload the session persistence store.
For each Enterprise Server instance:
Disable the Enterprise Server instance in the load balancer.
Enable session persistence.
Restart the Enterprise Server instance.
Re-enable the Enterprise Server instance in the load balancer.
If you do not need to maintain availability, you can disable and re-enable all the server instances at once in the load balancer. This saves time and prevents failover of outdated session data.