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.
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.
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.
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
$ asadmin list-domains
To list domains that were created in other directories, specify the --domaindir option.
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.
$ 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.
If the .asadmintruststore file for a domain has been deleted, you can easily create a new file
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.
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.
Accept the new Domain Certificate by pressing “y” when prompted.
From the Windows Start Menu, select Programs -> Sun Microsystems -> Application Server -> Start Admin Server.
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.
$ 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.
In the tree component, select server (Admin Server) under the Standalone Instances node.
On the General Information page, click Stop Server.
From the Start menu select Programs -> Sun Microsystems -> Application Server-> Stop Admin Server.
For mirroring purposes, and to provide a working copy of the Domain Administration Server (DAS), you must have:
One machine (machine1) that contains the original DAS.
A second machine (machine2) that contains a cluster with server instances running applications and catering to clients. The cluster is configured using the DAS on the first machine.
A third backup machine (machine3) where the DAS needs to be recreated in case the first machine crashes.
You must maintain a backup of the DAS from the first machine. Use asadmin backup-domain to backup the current domain.
The following steps are required to migrate the Domain Administration Server from the first machine (machine1) to the third machine (machine3).
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.
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:
You must have root permission to install using the command-line interface.
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).
Copy the backup ZIP file from the first machine into the domain-root-dir on the third machine. You can also FTP the file.
Execute asadmin restore-domain command to restore the ZIP file onto the third machine:
asadmin restore-domain --filename domain-root-dir/sjsas_backup_v00001.zip domain1
You can backup any domain. However, while recreating the domain, the domain name should be same as the original.
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).
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.
Change the host values for the properties in the domain.xml file for the third machine:
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/>...
Start the restored domain on machine3:
asadmin start-domain --user admin-user --password admin-password domain1
Change the DAS host values for properties under node agent on machine2.
Change agent.das.host property value in install-dir/nodeagents/nodeagent/agent/config/das.properties on machine2.
Restart the node agent on machine2.
Start the cluster instances using the asadmin start-instance command to allow them to synchronize with the restored domain.