Sun Java System Application Server Enterprise Edition 8 2004Q4 Beta Administration Guide |
Chapter 1
Getting StartedThis chapter describes the Sun JavaTM System Application Server and introduces basic administration tasks. This chapter contains following sections:
About the Sun Java System Application ServerWhat is the Application Server?
The Application Server provides a robust J2EE platform for the development, deployment, and management of enterprise applications. Key features include transaction management, performance, scalability, security, and integration. The Application Server supports services from Web publishing to enterprise-scale transaction processing, while enabling developers to build applications based on JavaServer Pages (JSP), Java servlets, and Enterprise JavaBeans (EJB) technology.
The Application Server Enterprise Edition provides advanced clustering and failover technologies. These features enable you to run scalable and highly available J2EE applications.
- Clustering - A cluster is a group of application server instances that work together as one logical entity. Each Application Server instance in the cluster has the same configuration and the same applications deployed to it. The Application Server instances within a cluster can be grouped across different machines into one logical cluster.
Scaling is acheived by adding Application Server instances to a cluster and thereby increasing the capacity of the system. It is possible to add Application Server instances to a cluster without disrupting service. The HTTP and RMI/IIOP load balancing system distributes requests to healthy Application Server instances in the cluster.
- Load Balancing - Balancing is achieved by evenly distributing the workload among multiple physical machines and thereby increasing the throughput of the overall system. The Application Server load balancer plugin distributes and forwards HTTP and HTTPS to the application server instances in the cluster.
- High Availability - Availability allows for failover protection of Application Server instances in a cluster. If one application server instance goes down, another Application Server instance takes over the sessions that were assigned to the unavailable server. Session information is stored in the high-availability database (HADB). HADB supports the persistence of HTTP sessions, EJB stateful session beans, and remote references of EJB lookups on the RMI/IIOP path.
- Session Persistence - Session persistence ensures that if an Application Server instance fails, the HTTP/S or EJB session is picked up by another server instance. The Application Server supports persistence of the following:
The high-availability database functions as the persistence store and consists of two Data Redundancy Units (DRUs) which are logical groupings of nodes. A DRU contains active and spare nodes. An active node stores data. If an active node becomes unavailable, a spare node takes its place. So, each active node must have a mirror active node on the other DRU.
Application Server Architecture
This section describes Figure 1-1, which shows the high-level architecture of the Application Server.
Containers
A container is a runtime environment that provides services such as security and transaction management to J2EE components. Figure 1-1 shows the two types of J2EE containers: Web and EJB. Web components, such as JSP pages and servlets, run within the Web container. Enterprise beans, the components of EJB technology, run within the EJB container.
Client Access
At runtime, browser clients access Web applications by communicating with the Web server via HTTP, the protocol used throughout the internet. The HTTPS protocol is for applications that require secure communication. Enterprise bean clients communicate with the Object Request Broker (ORB) through the the IIOP or IIOP/SSL (secure) protocols. The Application Server has separate listeners for the HTTP, HTTPS, IIOP, and IIOP/SSL protocols. Each listener has exclusive use of a specific port number.
Web Services
On the J2EE platform, it is possible to deploy a Web application that provides a Web service implemented by Java API for XML-Based RPC (JAX-RPC). A J2EE application or component can also be a client to other Web services. Applications access XML registries through the Java API for XML Registries (JAXR).
Services for Applications
The J2EE platform was designed so that the containers provide services for applications. Figure 1-1 shows the following services:
- Naming - A naming and directory service binds objects to names. A J2EE application locates an object by looking up its JNDI name. JNDI stands for the Java Naming and Directory Interface API.
- Security - The Java Authorization Contract for Containers (JACC) is a set of security contracts defined for the J2EE containers. Based on the client's identity, the containers restrict access to the container's resources and services.
- Transaction management - A transaction is an indivisible unit of work. For example, transfering funds between bank accounts is a transaction. A transaction management service ensures that a transaction either completes fully or is rolled back.
Access to External Systems
The J2EE platform enables applications to access systems that are outside of the application server. Applications connect to these systems through objects called resources. One of the responsibilities of an administrator is resource configuration. The J2EE platform enables access to external systems through the following APIs and components:
- JDBC - A database management system (DBMS) provides facilities for storing, organizing, and retrieving data. Most business applications store data in relational databases, which applications access via the JDBC API. The information in databases is often described as persistent because it is saved on disk and exists after the application ends. The Application Server bundle includes the PointBase DBMS.
- Messaging - Messaging is a method of communication between software components or applications. A messaging client sends messages to, and receive messages from, any other client. Applications access the messaging provider through the Java Messaging Service (JMS) API. The Application Server includes a JMS provider.
- Connector - The J2EE Connector architecture enables integration between J2EE applications and existing Enterprise Information Systems (EIS). An application accesses an EIS through a portable J2EE component called a connector or resource adapter.
- JavaMail - Through the JavaMail API, applications connect to an SMTP server in order to send and receive email.
Server Administration
The lower right-hand corner of Figure 1-1 shows some of the tasks performed by the administrator of the Application Server. For example, an administrator deploys (installs) applications and monitor the server's performance. Theses tasks are performed with the administration tools provided by the Application Server. See the section Tools for Administration.
Figure 1-1 Application Server Architecture
Administrative 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.
In an Admin Console session, it is possible to configure and manage a multiple domains. Each domain has its own Domain Administration Server (DAS), which has a unique port number. Specify the port number in the URL of your browser to run the Admin Console. 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.Application Server Instances
Application server instances form the basis of an application server deployment. A server instance is a single Java Virtual Machine (JVM) that runs the Application Server on a single physical machine. Each instance belongs to a single domain and has its own directory structure, configuration, and deployed applications. Each server instance also includes the J2EE platform web and EJB containers. Figure 1-2 shows an application server instance in detail. The application server instance is a building block in the clustering, load balancing, and session persistence features of the Application Server Enterprise Edition.
Figure 1-2 Sun Java System Application Server Instance
Tools for Administration
The Application Server includes two administrative tools:
Admin Console
The Admin Console is a browser-based tool that features an easy-to-navigate interface and online help. This manual provides step-by-step instructions for using the Admin Console. The administration server must be running to use the Admin Console.
When the Application Server was installed, you chose a port number for the server, or used the default port of 4848. You also specified a user name and master password.
To start the Admin Console, in a web browser type:
https://hostname:port
For example:
https://kindness.sun.com:4949
If the Admin Console is running on the machine on which the Application Server was installed, specify
localhost
for the host name.On Windows, start the Admin Console from the Start menu by choosing Programs -> Sun Microsystems -> J2EE 1.4 SDK -> Admin Console.
The installation program creates the default administrative domain (named
domain1
) with the default port number 4848. After installation, additional administrative domains can be created. Each domain has its own domain administration server, which has a unique port number. When specifying the URL for the Admin Console, be sure to use the port number for the domain to be administered.The asadmin Utility
The
asadmin
utility is a command-line tool. Use theasadmin
utility and the commands associated with it to perform the same set of tasks that can be performed in the Admin Console. For example, start and stop domains, configure the server, and deploy applications.Use these commands either from a command prompt in the shell, or call them from other scripts and programs. Use these commands to automate repetitive administration tasks.
To start the
asadmin
utility:
$ asadmin
To list the commands available within
asadmin
:
asadmin> help
It is also possible to issue an
asadmin
command at the shell's command prompt:
$ asadmin help
To view a command's syntax and examples, type
help
followed by the command name. For example:
asadmin> help create-jdbc-resource
The
asadmin help
information for a given command displays the Unix man page of the command. These man pages are also available in HTML format.Configuration Changes and Restarting the Server
To make the following configuration changes, restart the server for the changes to take effect:
For instructions, see Restarting the Server.
With dynanamic configuration, most changes take effect while the server is running. To make the following configuration changes, do NOT restart the server:
Note that the
asadmin reconfig
command has been deprecated and is no longer necessary. Configuration changes are applied to the server dynamically.Changing Port Numbers
This section describes the ports used by the Application Server and explains how to change port numbers with the Admin Console. This section contains the following topics:
Ports in the Application Server
Table Table 1-1 describes the the port listeners of the Application Server.
Viewing Port Numbers
Changing the Administrative Server Port
Changing an HTTP Port
- In the tree component, expand the HTTP Service node.
- Select the HTTP Listeners node.
- On the HTTP Listeners page, in the Name column select the the listener whose port number you want to change.
- On the Edit HTTP Listener page, change the value of the Listener Port field.
- Click Save.
- Restart the server.
Changing an IIOP Port
Changing the J2SE Software Used By the Application Server
The Application Server relies on the Java 2 Standard Edition (J2SE) software. When the Application Server was installed, the directory for the J2SE software was specified. For instructions on changing the J2SE software, see Configuring the JVM General Settings.
Configuring DomainsCreating a Domain
Domains are created using the
create-domain
command. The following example command creates a domain namedmydomain
. The administration server listens on port 123 and the admininstrative user name isbuzz
. The command prompts for the administrative masterpassword.
$ asadmin create-domain --adminport 123 --adminuser buzz mydomain
To start the Admin Console for this domain, in a browser, enter the following URL:
http://
hostname:123
For the preceding
create-domain
example, the domain's log files, configuration files, and deployed applications now reside in the following directory:install_dir
/domains/mydomain
To create the domain's directory in another location, specify the
--domaindir
option. For the full synax of the command, typeasadmin 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 namedmydomain
, 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 install_dir/domains
directory, type this command:
$ asadmin list-domains
To list domains that were created in other directories, specify the
--domaindir
option.
Starting and Stopping a DomainStarting a Domain
To start a domain, start its administration server and application server instance. 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, use one of the following methods.
Starting the Domain Using the asadmin start-domain Command
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 domain1
If there is only one domain, omit the domain name. For the full command syntax, type
asadmin help start-domain
.Starting the Domain Using the Windows Start Menu
On Windows, you can start the default domain from the Windows Start menu by choosing Programs Sun Microsystems J2EE 1.4 SDK Start Default Server.
Restarting the Server
Restarting the server is the same as restarting the domain. To restart the domain, stop and start the domain.
Stopping a 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 shut-down process. While the domain is stopped, the Admin Console or most
asadmin
commands cannot be used.Stopping the Domain Using the asadmin stop-domain Command
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
.Stopping the Domain Using the Admin Console
Stopping With the Windows Start Menu
On Windows, you can stop the default domain from the Start menu by choosing Programs -> Sun Microsystems -> J2EE 1.4 SDK -> Stop Default Server.
Further Information
- Sun Microsystems Woridwide Training - Over 250,000 students each year are trained by Sun and its authorized centers through Web-based courses and at over 250 training sites located in more than 60 countries. For more information, see:
http://training.sun.com/
- The J2EE 1.4 Tutorial - Written for developers, the tutorial has administrative instructions for configuring JMS, setting up JavaMail resources, and managing security. To access the tutorial, go to this URL:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
- Application Server Developer's Guide - This guide contains development information that is specific to the Application Server. The Developer's Guide is available at:
http://docs.sun.com/
- The
asadmin
man pages - Available in HTML format, these pages include syntax and examples for all the application server utilities including theasadmin
utility commands. These HTML pages are posted at the following URL:http://docs.sun.com/
- Application Server Release Notes - Available online at:
http://docs.sun.com/
- Getting Started With J2EE Connectors - This document has instructions for configuring connectors (resource adapters), connection pools, and connector resources:
http://java.sun.com/j2ee/connector/
- docs.sun.com: Sun Product Documentation - From this site search for and access all of our product documentation:
http://docs.sun.com/
- J2EE 1.4 Documentation page - Located on our public Web site, this page has links to the technical documentation for the J2EE 1.4 platform:
http://java.sun.com/j2ee/1.4/docs/
The Quick Start Guide - This document explains how to deploy and run a simple Web application. The guide is in the install_dir/docs/QuickStart.html file.