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

Application Server Configuration

Configuring the Application Server

Application Server domains are logical or physical units created to help the administrator manage a system configuration. A domain is broken down into smaller units including instances and node agents. A server instance is a single Java Virtual Machine (JVM) that runs the Application Server on a single physical machine. Each domain has one or more instances. A domain must also have at least one associated node agent for the instance to function properly. Domains can be grouped together to create a cluster. Clusters allow the administrator to manage groups of hardware and software.

Configuring Domains

Administrative domains provide a basic security structure whereby different administrators can administer specific groups (domains) of application server instances. By grouping the server instances into separate domains, different organizations and administrators can share a single Application Server installation. Each domain has its own configuration, log files, and application deployment areas that are independent of other domains. If the configuration is changed for one domain, the configurations of other domains are not affected.

Each Administration console session allows you to configure and manage the domain. If you have created multiple domains, you must start an additional Administration Console session to manage each domain. Each domain has its own Domain Administration Server (DAS), with a unique port number. Each administrative domain can have multiple application server instances. However, an application server instance can belong to just one domain. When the Application Server is installed, an administrative domain named domain1 is automatically created.

Creating a Domain

Domains are created using the create-domain command. The following example command creates a domain named mydomain. The administration server listens on port 1234 and the administrative user name is hanan. The command prompts for the administrative and master passwords.

$ asadmin create-domain --adminport 80 --adminuser hanan mydomain

To start the Admin Console for mydomain domain, in a browser, enter the following URL:


For the preceding create-domain example, the domain’s log files, configuration files, and deployed applications now reside in the following directory:


To create the domain’s directory in another location, specify the --domaindir option. For the full syntax of the command, type asadmin help create-domain.

Deleting a Domain

Domains are deleted using the asadmin delete-domain command. Only the operating system user (or root) who can administer the domain can execute this command successfully. To delete a domain named mydomain, for example, type the following command:

$ asadmin delete-domain mydomain

Listing Domains

The domains created on a machine can be found using the asadmin list-domains command. To list the domains in the default domain-root-dir directory, type this command:

$ asadmin list-domains

To list domains that were created in other directories, specify the --domaindir option.

Starting the Domain

When starting a domain, the administration server and application server instance are started. Once the application server instance is started it runs constantly, listening for and accepting requests. Each domain must be started separately.

To start a domain, type the asadmin start-domain command and specify the domain name. For example, to start the default domain (domain1), type the following:

$ asadmin start-domain --user admin domain1

If there is only one domain, omit the domain name. For the full command syntax, type asadmin help start-domain. If the password data is omitted, you are prompted to supply it.

The asadmin start-domain domain1 command should be run by the user who installed the server. If it is not run by that user, the .asadmintruststore should be moved or copied from the home directory of installing user to the home directory of the running user.

Note that if the file is moved (not copied) from the installing user's home directory to the running user's home directory, you might experience application upgrade problems, because the upgrade/install user will no longer have the .asadmintruststore file in the home directory.

Restoring a Deleted .asadmintruststore File

If the .asadmintruststore file for a domain has been deleted, you can easily create a new file

ProcedureTo create a new .asadmintruststore file

  1. Use the local asadmin start-domain command to start a domain you want to manage.

    Note that a local asadmin command does not require an .asadmintruststore file to start the domain.

  2. Run any remote asadmin command.

    Remote asadmin commands require the --user, --passwordfile (--password), --host, and --port options to be specified, and a target domain to be running.

  3. Accept the new Domain Certificate by pressing “y” when prompted.

On Windows, to start the default domain:

From the Windows Start Menu, select Programs -> Sun Microsystems -> Application Server -> Start Admin Server.

Restarting the Server or Domain

Restarting the server is the same as restarting the domain. To restart the domain or server, stop and start the domain.

Stopping the Domain

Stopping a domain shuts down its administration server and application server instance. When stopping a domain, the server instance stops accepting new connections and then waits for all outstanding connections to complete. This process takes a few seconds because the server instance must complete its shutdown process. While the domain is stopped, the Admin Console or most asadmin commands cannot be used.

To stop a domain, type the asadmin stop-domain command and specify the domain name. For example, to stop the default domain (domain1), type the following:

$ asadmin stop-domain domain1

If there is only one domain, then the domain name is optional. For the full syntax, type asadmin help stop-domain.

To stop the domain using the Admin Console:

On Windows, to stop the default domain:

From the Start menu select Programs -> Sun Microsystems -> Application Server-> Stop Admin Server.

Recreating the Domain Administration Server

For mirroring purposes, and to provide a working copy of the Domain Administration Server (DAS), you must have:

Note –

You must maintain a backup of the DAS from the first machine. Use asadmin backup-domain to backup the current domain.

ProcedureTo migrate the DAS

The following steps are required to migrate the Domain Administration Server from the first machine (machine1) to the third machine (machine3).

  1. Install the application server on the third machine just as it is installed on the first machine.

    This is required so that the DAS can be properly restored on the third machine and there are no path conflicts.

    1. Install the application server administration package using the command-line (interactive) mode. To activate the interactive command-line mode, invoke the installation program using the console option:

      ./bundle-filename -console

      You must have root permission to install using the command-line interface.

    2. Deselect the option to install default domain.

      Restoration of backed up domains is only supported on two machines with same architecture and exactly the same installation paths (use same install-dir and domain-root-dir on both machines).

  2. Copy the backup ZIP file from the first machine into the domain-root-dir on the third machine. You can also FTP the file.

  3. Execute asadmin restore-domain command to restore the ZIP file onto the third machine:

    asadmin restore-domain --filename domain-root-dir/ domain1

    You can backup any domain. However, while recreating the domain, the domain name should be same as the original.

  4. Change domain-root-dir/domain1/generated/tmp directory permissions on the third machine to match the permissions of the same directory on first machine.

    The default permissions of this directory are: ?drwx------? (or 700).

    For example:

    chmod 700 domain-root-dir/domain1/generated/tmp

    The example above assumes you are backing up domain1. If you are backing up a domain by another name, you should replace domain1 above with the name of the domain being backed up.

  5. Change the host values for the properties in the domain.xml file for the third machine:

  6. Update the domain-root-dir/domain1/config/domain.xml on the third machine.

    For example, search for machine1 and replace it with machine3. So, you can change:

    <jmx-connector><property name=client-hostname value=machine1/>...


    <jmx-connector><property name=client-hostname value=machine3/>...
  7. Change:

    <jms-service... host=machine1.../>


    <jms-service... host=machine3.../>
  8. Start the restored domain on machine3:

    asadmin start-domain --user admin-user --password admin-password domain1
  9. Change the DAS host values for properties under node agent on machine2.

  10. Change property value in install-dir/nodeagents/nodeagent/agent/config/ on machine2.

  11. Restart the node agent on machine2.

    Note –

    Start the cluster instances using the asadmin start-instance command to allow them to synchronize with the restored domain.