Sun Java System Application Server Enterprise Edition 8.1 2005Q2 High Availability Administration Guide

- Previous: Managing HADB
- Next: Monitoring HADB

# Expanding HADB

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 Application Server cluster or database, in particular:

- Adding Storage Space to Existing Nodes

- Adding Machines

- Adding Nodes

- Refragmenting the Database

- Adding Nodes by Recreating the Database

Also see related information in Maintaining HADB Machines .

## Adding Storage Space to Existing Nodes

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.

The command syntax is:

    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.

##### Example 3–12 Example of setting data device size

The following command is an example of setting data device size:

    hadbm set DataDeviceSize=1024

## Adding Machines

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 Application Serveras described in Chapter 2, Installing and Setting Up High Availability Database. For an explanation of node topology alternatives, see Chapter 3, Selecting a Topology, in Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Deployment Planning Guide.

### To add new machines to an existing HADB instance

1. Start management agents on the new nodes.

2. Extend the management domain to the new hosts.

   For details, see `hadbm extenddomain` command.

3. Start the new nodes on these hosts.

   For details, see Adding Nodes

## 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. For more information, see System Sizing in Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Deployment Planning Guide.

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 Getting the Status of HADB.

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

Note –

The best time to add nodes is when the system is lightly loaded.

##### Example 3–13 Example of adding nodes

For example:

    hadbm addnodes --dbpassword secret123 -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
--- | --- | ---
--no-refragment -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
--spares= number -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
--devicepath= path -d | Path to the devices. Devices are: `DataDevice` `NiLogDevice` (node internal log device) `RelalgDevice` (relational algebra query device) This path must already exist and be writable. To set this path differently for each node or each device, see Setting Heterogeneous Device Paths | Solaris and Linux: `HADB_install_dir/device` Windows: `C:\Sun\AppServer\SUNWhadb\vers`, where vers is the HADB version number.
--hosts= hostlist -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

## Refragmenting the Database

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

Note –

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

##### Example 3–14 Example of refragmenting the database

For example:

    hadbm refragment --dbpassword secret123

## Adding Nodes by Recreating the Database

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.

### To add nodes by recreating the database

This procedure enables you to maintain HADB availability throughout the process.

1. For each Application Server instance:

   1. Disable the Application Server instance in the load balancer.

   2. Disable session persistence.

   3. Restart the Application Server instance.

   4. Re-enable the Application 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.

2. Stop the database as described in Stopping a Database .

3. Delete the database as described in Removing a Database .

4. Recreate the database with the additional nodes as described in Creating a Database

5. Reconfigure the JDBC connection pool as described in Configuring the JDBC Connection Pool

6. Reload the session persistence store.

7. For each Application Server instance:

   1. Disable the Application Server instance in the load balancer.

   2. Enable session persistence.

   3. Restart the Application Server instance.

   4. Re-enable the Application 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.

- Previous: Managing HADB
- Next: Monitoring HADB

- © 2010, Oracle Corporation and/or its affiliates