Skip Navigation Links | |
Exit Print View | |
Oracle GlassFish Server 3.1-3.1.1 High Availability Administration Guide |
1. High Availability in GlassFish Server
2. Setting Up SSH for Centralized Administration
3. Administering GlassFish Server Nodes
4. Administering GlassFish Server Clusters
5. Administering GlassFish Server Instances
Types of GlassFish Server Instances
Administering GlassFish Server Instances Centrally
To Create an Instance Centrally
To List All Instances in a Domain
To Delete an Instance Centrally
To Start an Individual Instance Centrally
Administering GlassFish Server Instances Locally
To Start an Individual Instance Locally
To Stop an Individual Instance Locally
To Restart an Individual Instance Locally
Resynchronizing GlassFish Server Instances and the DAS
Default Synchronization for Files and Directories
To Resynchronize an Instance and the DAS Online
To Resynchronize Library Files
To Resynchronize Custom Configuration Files for an Instance
To Resynchronize Users' Changes to Files
To Resynchronize Additional Configuration Files
To Prevent Deletion of Application-Generated Files
To Resynchronize an Instance and the DAS Offline
To Enable Automatic EJB Timer Migration for Failed Clustered Instances
To Migrate EJB Timers Manually
6. Administering Named Configurations
7. Configuring Web Servers for HTTP Load Balancing
8. Configuring HTTP Load Balancing
9. Upgrading Applications Without Loss of Availability
10. Configuring High Availability Session Persistence and Failover
11. Configuring Java Message Service High Availability
Centralized administration requires secure shell (SSH) to be set up. If SSH is set up, you can administer clustered instances without the need to log in to hosts where remote instances reside.
Administering GlassFish Server instances centrally involves the following tasks:
Use the create-instance subcommand in remote mode to create a GlassFish Server instance centrally. Creating an instance adds the instance to the DAS configuration and creates the instance's files on the host where the instance resides.
If the instance is a clustered instance that is managed by GMS, system properties for the instance that relate to GMS must be configured correctly. To avoid the need to restart the DAS and the instance, configure an instance's system properties that relate to GMS when you create the instance. If you change GMS-related system properties for an existing instance, the DAS and the instance must be restarted to apply the changes. For information about GMS, see Group Management Service.
Before You Begin
Ensure that following prerequisites are met:
The node where the instance is to reside exists.
The node where the instance is to reside is either enabled for remote communication or represents the host on which the DAS is running. For information about how to create a node that is enabled for remote communication, see To Create an SSH Node.
The user of the DAS can use SSH to log in to the host for the node where the instance is to reside.
If any of these prerequisites is not met, create the instance locally as explained in To Create an Instance Locally.
If you are adding the instance to a cluster, ensure that the cluster to which you are adding the instance exists. For information about how to create a cluster, see To Create a Cluster.
If the instance is to reference an existing named configuration, ensure that the configuration exists. For more information, see To Create a Named Configuration.
The instance might be a clustered instance that is managed by GMS and resides on a node that represents a multihome host. In this situation, ensure that you have the Internet Protocol (IP) address of the network interface to which GMS binds.
Remote subcommands require a running server.
Note - Only the options that are required to complete this task are provided in this step. For information about all the options for configuring the instance, see the create-instance(1) help page.
If the instance is to reference an existing configuration, specify a configuration that no other cluster or instance references.
asadmin> create-instance --node node-name [--config configuration-name] instance-name
The node on which the instance is to reside.
The name of the existing named configuration that the instance will reference.
If you do not require the instance to reference an existing configuration, omit this option. A copy of the default-config configuration is created for the instance. The name of this configuration is instance-name-config, where instance-name is the name of the server instance.
Your choice of name for the instance that you are creating.
Do not specify a cluster.
asadmin> create-instance --node node-name --config configuration-name instance-name
The node on which the instance is to reside.
The name of the existing named configuration that the instance will reference.
Your choice of name for the instance that you are creating.
If the instance is managed by GMS and resides on a node that represents a multihome host, specify the GMS-BIND-INTERFACE-ADDRESS-cluster-name system property.
asadmin> create-instance --cluster cluster-name --node node-name [--systemproperties GMS-BIND-INTERFACE-ADDRESS-cluster-name=bind-address] instance-name
The name of the cluster to which you are adding the instance.
The node on which the instance is to reside.
The IP address of the network interface to which GMS binds. Specify this option only if the instance is managed by GMS and resides on a node that represents a multihome host.
Your choice of name for the instance that you are creating.
Example 5-1 Creating a Clustered Instance Centrally
This example adds the instance pmd-i1 to the cluster pmdclust in the domain domain1. The instance resides on the node sj01, which represents the host sj01.example.com.
asadmin> create-instance --cluster pmdclust --node sj01 pmd-i1 Port Assignments for server instance pmd-i1: JMX_SYSTEM_CONNECTOR_PORT=28686 JMS_PROVIDER_PORT=27676 HTTP_LISTENER_PORT=28080 ASADMIN_LISTENER_PORT=24848 IIOP_SSL_LISTENER_PORT=23820 IIOP_LISTENER_PORT=23700 HTTP_SSL_LISTENER_PORT=28181 IIOP_SSL_MUTUALAUTH_PORT=23920 The instance, pmd-i1, was created on host sj01.example.com Command create-instance executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help create-instance at the command line.
Next Steps
After creating an instance, you can start the instance as explained in the following sections:
Use the list-instances subcommand in remote mode to obtain information about existing instances in a domain.
Remote subcommands require a running server.
asadmin> list-instances
Example 5-2 Listing Basic Information About All GlassFish Server Instances in a Domain
This example lists the name and status of all GlassFish Server instances in the current domain.
asadmin> list-instances pmd-i2 running yml-i2 running pmd-i1 running yml-i1 running pmdsa1 not running Command list-instances executed successfully.
Example 5-3 Listing Detailed Information About All GlassFish Server Instances in a Domain
This example lists detailed information about all GlassFish Server instances in the current domain.
asadmin> list-instances --long=true NAME HOST PORT PID CLUSTER STATE pmd-i1 sj01.example.com 24848 31310 pmdcluster running yml-i1 sj01.example.com 24849 25355 ymlcluster running pmdsa1 localhost 24848 -1 --- not running pmd-i2 sj02.example.com 24848 22498 pmdcluster running yml-i2 sj02.example.com 24849 20476 ymlcluster running ymlsa1 localhost 24849 -1 --- not running Command list-instances executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help list-instances at the command line.
Use the delete-instance subcommand in remote mode to delete a GlassFish Server instance centrally.
Caution - If you are using a Java Message Service (JMS) cluster with a master broker, do not delete the instance that is associated with the master broker. If this instance must be deleted, use the change-master-broker(1) subcommand to assign the master broker to a different instance. |
Deleting an instance involves the following:
Removing the instance from the configuration of the DAS
Deleting the instance's files from file system
Before You Begin
Ensure that the instance that you are deleting is not running. For information about how to stop an instance, see the following sections:
Remote subcommands require a running server.
asadmin> list-instances instance-name
The name of the instance that you are deleting.
asadmin> delete-instance instance-name
The name of the instance that you are deleting.
Example 5-4 Deleting an Instance Centrally
This example confirms that the instance pmd-i1 is not running and deletes the instance.
asadmin> list-instances pmd-i1 pmd-i1 not running Command list-instances executed successfully. asadmin> delete-instance pmd-i1 Command _delete-instance-filesystem executed successfully. The instance, pmd-i1, was deleted from host sj01.example.com Command delete-instance executed successfully.
See Also
You can also view the full syntax and options of the subcommands by typing the following commands at the command line:
asadmin help delete-instance
asadmin help list-instances
Use the start-cluster subcommand in remote mode to start a cluster.
Starting a cluster starts all instances in the cluster that are not already running.
Before You Begin
Ensure that following prerequisites are met:
Each node where an instance in the cluster resides is either enabled for remote communication or represents the host on which the DAS is running.
The user of the DAS can use secure shell (SSH) to log in to the host for any node where instances in the cluster reside.
If any of these prerequisites is not met, start the cluster by starting each instance locally as explained in To Start an Individual Instance Locally.
Remote subcommands require a running server.
asadmin> start-cluster cluster-name
The name of the cluster that you are starting.
Example 5-5 Starting a Cluster
This example starts the cluster pmdcluster.
asadmin> start-cluster pmdcluster Command start-cluster executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help start-cluster at the command line.
Next Steps
After starting a cluster, you can deploy applications to the cluster. For more information, see Oracle GlassFish Server 3.1 Application Deployment Guide.
Use the stop-cluster subcommand in remote mode to stop a cluster.
Stopping a cluster stops all running instances in the cluster.
Remote subcommands require a running server.
asadmin> stop-cluster cluster-name
The name of the cluster that you are stopping.
Example 5-6 Stopping a Cluster
This example stops the cluster pmdcluster.
asadmin> stop-cluster pmdcluster Command stop-cluster executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help stop-cluster at the command line.
Troubleshooting
If instances in the cluster have become unresponsive and fail to stop, run the subcommand again with the --kill option set to true. When this option is true, the subcommand uses functionality of the operating system to kill the process for each running instance in the cluster.
Use the start-instance subcommand in remote mode to start an individual instance centrally.
Before You Begin
Ensure that following prerequisites are met:
The node where the instance resides is either enabled for remote communication or represents the host on which the DAS is running.
The user of the DAS can use SSH to log in to the host for the node where the instance resides.
If any of these prerequisites is not met, start the instance locally as explained in To Start an Individual Instance Locally.
Remote subcommands require a running server.
asadmin> start-instance instance-name
Note - Only the options that are required to complete this task are provided in this step. For information about all the options for controlling the behavior of the instance, see the start-instance(1) help page.
The name of the instance that you are starting.
Example 5-7 Starting an Individual Instance Centrally
This example starts the instance pmd-i2, which resides on the node sj02. This node represents the host sj02.example.com. The configuration of the instance on this node already matched the configuration of the instance in the DAS when the instance was started.
asadmin> start-instance pmd-i2 CLI801 Instance is already synchronized Waiting for pmd-i2 to start ............ Successfully started the instance: pmd-i2 instance Location: /export/glassfish3/glassfish/nodes/sj02/pmd-i2 Log File: /export/glassfish3/glassfish/nodes/sj02/pmd-i2/logs/server.log Admin Port: 24851 Command start-local-instance executed successfully. The instance, pmd-i2, was started on host sj02.example.com Command start-instance executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help start-instance at the command line.
Next Steps
After starting an instance, you can deploy applications to the instance. For more information, see Oracle GlassFish Server 3.1 Application Deployment Guide.
Use the stop-instance subcommand in remote mode to stop an individual instance centrally.
When an instance is stopped, the instance stops accepting new requests and waits for all outstanding requests to be completed.
Remote subcommands require a running server.
Example 5-8 Stopping an Individual Instance Centrally
This example stops the instance pmd-i2.
asadmin> stop-instance pmd-i2 The instance, pmd-i2, is stopped. Command stop-instance executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help stop-instance at the command line.
Troubleshooting
If the instance has become unresponsive and fails to stop, run the subcommand again with the --kill option set to true. When this option is true, the subcommand uses functionality of the operating system to kill the instance process.
Use the restart-instance subcommand in remote mode to start an individual instance centrally.
When this subcommand restarts an instance, the DAS synchronizes the instance with changes since the last synchronization as described in Default Synchronization for Files and Directories.
If you require different synchronization behavior, stop and start the instance as explained in To Resynchronize an Instance and the DAS Online.
Remote subcommands require a running server.
asadmin> restart-instance instance-name
The name of the instance that you are restarting.
Example 5-9 Restarting an Individual Instance Centrally
This example restarts the instance pmd-i2.
asadmin> restart-instance pmd-i2 pmd-i2 was restarted. Command restart-instance executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help restart-instance at the command line.
Troubleshooting
If the instance has become unresponsive and fails to stop, run the subcommand again with the --kill option set to true. When this option is true, the subcommand uses functionality of the operating system to kill the instance process before restarting the instance.