Sun GlassFish Enterprise Server 2.1 Administration Guide

Server Lifecycle Commands

The server lifecycle commands are commands that create, delete, or start, stop a domain, or an instance.

Table C–2 Server Lifecycle Commands

Command 

Definition 

create-domain

Creates the configuration of a domain. A domain is an administrative namespace. Every domain has a configuration, which is stored in a set of files. Any number of domains each of which has a distinct administrative identity can be created in a given installation of application server. A domain can exist independent of other domains. Any user who has access to the asadmin script on a given system can create a domain and store its configuration in a folder of choice. By default, the domain configuration is created in the install_dir/domains directory. You can override this location to store the configuration elsewhere.

delete-domain

Deletes the named domain. The domain must already exist and must be stopped. 

start-domain

Starts a domain. If the domain directory is not specified, the domain in the default install_dir/domains directory is started. If there are two or more domains, the domain_name operand must be specified.

stop-domain

Stops the Domain Administration Server of the specified domain. 

restore-domain

Restores files under the domain from a backup directory. 

list-domains

Lists the domain. If the domain directory is not specified, the domain in the default install_dir/domains directory is listed. If there is more than one domain, the domain_name operand must be specified.

backup-domain

Backs up files under the named domain. 

login

Lets you log in to a domain. If various application server domains are created on various machines (locally), asadmin invocation from any of these machines can manage the domains located elsewhere (remotely). This comes in handy especially when a particular machine is chosen as an administration client and it manages multiple domains and servers. asadmin commands that are used to manage domains located elsewhere are called remote commands. The asadmin login command eases the administration of such remote domains. The login command runs only in the interactive mode. It prompts you for the admin user name and password. On successful login, the file .asadminpass will be created in the user's home directory. This is the same file that is modified during the create-domain command while using the -‐savelogin option. The domain must be running for this command to run.

create-instance

Creates a new server instance residing on a local or remote machine. 

delete-instance

Deletes the server instance. This command can be run remotely or locally. The user authenticates using the password identified for the administration server. Additionally, the instance must already exist within the domain served by the administration server. Use this command with discretion since it is destructive and cannot be undone.