1. Overview of GlassFish Server Administration
Default Settings and Locations
Instructions for Administering GlassFish Server
Domains for Administering GlassFish Server
Domain Administration Server (DAS)
Creating, Logging In To, and Deleting a Domain
To Create a Domain From a Custom Template
Starting and Stopping a Domain
Configuring a DAS or a GlassFish Server Instance for Automatic Restart
To Configure a DAS or an Instance for Automatic Restart on Windows
To Configure a DAS or an Instance for Automatic Restart on Linux
To Configure a DAS or an Instance for Automatic Restart on Oracle Solaris
To Prevent Service Shutdown When a User Logs Out on Windows
Suspending and Resuming a Domain
Setting Up Automatic Backups of a Domain
To Create a Backup Configuration
To Enable a Backup Configuration
To Disable a Backup Configuration
Backing Up and Restoring a Domain
Re-Creating the Domain Administration Server (DAS)
To Switch a Domain to Another Supported Java Version
To Change the Administration Port of a Domain
4. Administering the Virtual Machine for the Java Platform
6. Administering Web Applications
7. Administering the Logging Service
8. Administering the Monitoring Service
9. Writing and Running JavaScript Clients to Monitor GlassFish Server
10. Administering Life Cycle Modules
11. Extending and Updating GlassFish Server
Part II Resources and Services Administration
12. Administering Database Connectivity
13. Administering EIS Connectivity
14. Administering Internet Connectivity
15. Administering the Object Request Broker (ORB)
16. Administering the JavaMail Service
17. Administering the Java Message Service (JMS)
18. Administering the Java Naming and Directory Interface (JNDI) Service
19. Administering Transactions
Creating backups is part of regular administrative duties, and GlassFish Server supports two ways to perform this duty:
Automatically on a scheduled basis, as described in this section
Manually, as described in To Back Up a Domain
To set up automatic backups, you provide the following information:
When to perform the backups
Where to store the backups
What to back up: the entire content of the domain's directory or just the content of its config subdirectory
Whether to suspend the domain or to leave it running during the backup operation
How many previous backups to keep before deleting the oldest one to create a new one
To provide this information, you create and administer backup configurations. You can create multiple backup configurations, and so set up automatic backups that serve different purposes. For example, you could create one backup configuration that backs up the entire content of the domain's directory once every month, and another backup configuration that backs up just the domain's config subdirectory once every week.
When you create a backup configuration, you provide information about when to perform automatic backups by specifying the name of a schedule that defines a single event at a specified date and time or a series of events occurring with a specified frequency. Therefore, you must create a backup configuration's schedule before you create the backup configuration itself. Alternatively, you can use an existing schedule that meets your needs, such as one of the schedules predefined in GlassFish Server: daily, weekly and monthly.
The domain must be running when a backup configuration's schedule triggers an automatic backup; otherwise, the backup operation will not occur. Additionally, if a scheduled automatic backup is missed because the domain was stopped, the backup is not performed when the domain is started.
By default, when GlassFish Server performs an automatic backup, it suspends the domain before performing the backup operation and resumes the domain after completing the backup operation. You can override this suspension of the domain by using the --activebackupenabled option of the create-backup-config(1) subcommand.
To create and manage backup configurations and schedules in the Administration Console, click the Domain node in the navigation tree and then click the Backup tab on the Domain Attributes page.
The following topics are addressed here:
Use the create-backup-config subcommand in remote mode to create a backup configuration.
By default, a backup configuration is enabled when it is created.
Before You Begin
When creating a backup configuration, you specify the name of the schedule that determines when automatic backups are to be performed. Use the list-schedules --full subcommand to find out whether an existing schedule meets your needs. If necessary, use the create-schedule subcommand to create a schedule.
Remote subcommands require a running server.
asadmin> create-backup-config --schedule schedule-name --backupdir backup-directory --configonly=true-or-false --activebackupenabled=true-or-false --autobackupenabled=true-or-false --recyclelimit recycle-limit backup-config-name
Specifies the name of the schedule that determines when automatic backups are to be performed.
Optionally specifies a directory other than the default as-install/domains/domain-name/backups where automatic backups are to be stored.
Optionally specifies whether automatic backups are to contain only the config subdirectory of the domain or all subdirectories of the domain. The default value is false.
Optionally specifies whether the automatic backups are to be performed without suspending the domain during the backup operation. The default value is false.
Optionally specifies whether automatic backups are enabled. The default value is true.
Optionally specifies how many backup files to keep. After this limit is reached, the oldest existing backup is deleted when a new backup needs to be created. The default value is 25.
Example 3-16 Creating a Backup Configuration
This example creates the backup configuration monthly-full.
asadmin> create-backup-config --schedule monthly --backupdir /net/backups.example.com/glassfish monthly-full Command create-backup-config executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help create-backup-config at the command line.
Use the list-backup-configs subcommand in remote mode to list backup configurations defined in the domain.
Remote subcommands require a running server.
Example 3-17 Listing All Backup Configurations
This example lists all backup configurations.
asadmin> list-backup-configs weekly-config quarterly-full Command list-backup-configs executed successfully.
Example 3-18 Listing Details for a Backup Configuration
This example lists details for the quarterly-full backup configuration.
asadmin> list-backup-configs --long quarterly-full Name of Backup Config :quarterly-full Auto Backup Enabled :true Schedule :quarterly Recycle Limit :25 Config Only backup :false Active Backup Enabled :false Backup Directory :/net/backups.example.com/glassfish Last Backup Attempt :Sat Jan 01 00:00:01 PST 2011 Last Successful Backup :Sat Jan 01 00:00:01 PST 2011 Schedule Details: NAME SECOND MINUTE HOUR DAY OF WEEK DAY OF MONTH MONTH YEAR quarterly 0 0 0 * 1 1,4,7,10 * Command list-backup-configs executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help list-backup-configs at the command line.
Use the enable-backup-config subcommand in remote mode to enable automatic backups triggered by a specified backup configuration.
Using the enable-backup-config subcommand is equivalent to using the set subcommand to set the auto-backup-enabled attribute of a backup configuration to true.
Remote subcommands require a running server.
asadmin> enable-backup-config backup-config-name
Example 3-19 Enabling a Backup Configuration
This example enables the backup configuration quarterly-full.
asadmin> enable-backup-config quarterly-full Command enable-backup-config executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help enable-backup-config at the command line.
Use the disable-backup-config subcommand in remote mode to disable automatic backups triggered by a specified backup configuration.
Using the disable-backup-config subcommand is equivalent to using the set subcommand to set the auto-backup-enabled attribute of a backup configuration to false.
Remote subcommands require a running server.
asadmin> disable-backup-config backup-config-name
Example 3-20 Disabling a Backup Configuration
This example disables the backup configuration quarterly-full.
asadmin> disable-backup-config quarterly-full Command disable-backup-config executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help disable-backup-config at the command line.
Use the delete-backup-config subcommand in remote mode to delete a specified backup configuration.
Remote subcommands require a running server.
asadmin> delete-backup-config backup-config-name
Example 3-21 Deleting a Backup Configuration
This example deletes the backup configuration quarterly-full.
asadmin> delete-backup-config quarterly-full Command delete-backup-config executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help delete-backup-config at the command line.
Use the create-schedule subcommand in remote mode to create a schedule.
A schedule defines a single event at a specified date and time, such as “on January 1, 2012 at 8:00:00”, or a series of events occurring with a specified frequency, such as “on the first and sixteenth of every month as midnight”.
The create-schedule subcommand uses an event-specification model similar to EJB timers to define a single event or a recurring event. It provides event control for year, month, hour, minute and second units directly, and for day units in terms of both days of the week and days of the month. See create-schedule(1) for complete information about recurrence options for each unit.
GlassFish Server provides three predefined schedules:
daily, which specifies every day at midnight
weekly, which specifies every week on Sunday at midnight
monthly, which specifies every month on the first at midnight
You can use these schedules just as they are defined, or you can edit them to suit your needs.
Remote subcommands require a running server.
Example 3-22 Creating a Schedule
This example creates the schedule quarterly, which specifies a recurring frequency of “on the first day of every quarter at midnight”.
asadmin> create-schedule --dayofmonth 1 --month 1,4,7,10 quarterly Command create-schedule executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help create-schedule at the command line.
Use the list-schedules subcommand in remote mode to list schedules defined in the domain.
Remote subcommands require a running server.
Example 3-23 Listing Schedules
This example lists all schedules using the --long option to display details for each schedules.
asadmin> list-schedules --long NAME SECOND MINUTE HOUR DAY OF WEEK DAY OF MONTH MONTH YEAR daily 0 0 0 * * * * weekly 0 0 0 Sun * * * monthly 0 0 0 * 1 * * quarterly 0 0 0 * 1 1,4,7,10 * Command list-schedules executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help list-schedules at the command line.
Use the delete-schedule subcommand in remote mode to delete a specified schedule.
Note - If you attempt to delete a schedule that is in use by a backup configuration, the delete-schedule subcommand fails.
Remote subcommands require a running server.
asadmin> delete-schedule schedule-name
Example 3-24 Deleting a Schedule
This example deletes the schedule quarterly.
asadmin> delete-schedule quarterly Command delete-schedule executed successfully.
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help delete-schedule at the command line.