Sunday, November 3, 2013

Weblogic Domain configuration


Domain: Overview

A domain is the basic administration unit for Oracle WebLogic Server. It consists of one or more Oracle WebLogic Server instances and logically related resources and services that are managed collectively as one unit. As shown in the graphic, the basic domain infrastructure consists of one administration server and optional managed servers and clusters.

A domain always includes one Oracle WebLogic Server instance that is configured as an administration server. The administration server provides a central point for managing the domain and providing access to the Oracle WebLogic Server administration tools. These tools include, but are not limited to, the following:

Oracle WebLogic Server Administration Console: Graphical user interface (GUI) to the administration server
Oracle WebLogic Server Node Manager (NM): A Java program that enables you to remotely start and stop the administration and managed server instances. It also monitors and automatically restarts servers after an unexpected failure. The Node Manager is covered in more detail in the lesson titled, “Configuring Node Managers.”


All other Oracle WebLogic Server instances in a domain are called managed servers. Managed servers host application components and resources, which are also deployed and managed as part of the domain. In a domain with only a single Oracle WebLogic Server instance, that server functions as both the administration server and the managed server.
A domain may also include Oracle WebLogic Server clusters, which are groups of server instances that work together to provide scalability and high availability for applications. Clusters can improve performance and provide failover if a server instance becomes unavailable. The servers within a cluster can run on the same machine, or they can reside on different machines. To the client, a cluster appears as a single Oracle WebLogic Server instance.

 

Domain Diagram
The diagram in the slide shows the critical components of a domain. A domain is an arbitrary logical administration unit that is managed by one administration server. A domain can encompass clusters in different geographies.
The administration server is responsible for providing configurations for all servers of a specific domain and for logging critical (configurable) notifications of the domain’s servers. It is also responsible for monitoring managed servers. A managed server is responsible for performing the business logic.
A managed server gets its configuration from the administration server at boot time. The managed server is then able to execute independently of the administration server. The administration server registers itself with each managed server so that it can receive critical notifications and run-time server state changes. Note that the only configuration folders and files that play a role are those of the administration server. The configuration folders and files of the managed servers are normally ignored because they download all configuration information from the administration server.
Configuration management is implemented through Java Management Extension (JMX). The communication between the managed servers and the administration server is via Remote Method Invocation (RMI), which also uses JMX.
Note: The diagram in the slide is a simplification; all the servers would be monitored by and updated from the administration server. Also, all the managed servers retrieve their configuration information at startup time from the administration server and log critical data to the administration server.


Configuring a Domain
All managed servers in a domain must run the same version of Oracle WebLogic Server. The administration server can run either the same version as the managed servers in the domain or a later service pack.
In addition to infrastructure components, a domain defines the basic network configuration for the server instances that it contains. Specifically, a domain defines application deployments, supported application services (such as database and messaging services), security options, and physical host machines. Configuration information for a domain is maintained in an XML file named config.xml that is located in the domain’s root directory.
In production environments that require increased performance, throughput, or availability for an application, several managed servers might be grouped in a cluster. In such a case, the domain consists of one or more clusters with the applications they host and an administration server to perform management operations.
Note: In production environments, it is recommended that you deploy applications only on managed servers; the administration server should be reserved for management tasks.


In development or test environments, a single application and server might be deployed independently without managed servers. In such a case, you can have a domain consisting of a single administration server that also hosts the applications you want to test or develop.
Configuration Checklist
To prepare for the configuration, you may want to collect a list of names and numbers so that you do not get a resource conflict. You need to know (if applicable):
Resource names
IP addresses
DNS names
Non-SSL ports
SSL ports
User IDs
Passwords
Destinations on disk for storage
You possibly also need to know other information. Names need to be unique within their scope (either application scope or domain scope) and the combination of IP address and port needs to be unique. Although you are allowed to have two very different kinds of entities with the same namefor example, an application and a cluster both named Benefitsthis is not considered the best practice. You are not allowed to have two similar entities with the same namefor example, a server and a cluster both named HR is an error. This checklist then serves as your documentation record as well.


Starting the Domain Configuration Wizard
Before you can develop and run a WebLogic application, you must first create a domain. The Configuration Wizard simplifies the process of creating and extending a domain. To create or extend a domain by using the Configuration Wizard, you select the product components to be included in the domain (or choose a template that best meets your requirements), and provide basic configuration information. The Configuration Wizard then creates or extends the domain by using the settings from the templates.
Note: The Domain Template Builder simplifies the process of creating templates by guiding you through the process of creating custom domain and extension templates. You can use these templates for creating and extending domains with the Configuration Wizard or the WebLogic Scripting Tool (WLST) or the unpack command.


Creating a Domain Using the Domain Configuration Wizard
The Configuration Wizard guides you through the process of creating a domain for your target environment by selecting the product components that you want to include in your domain, or by using domain templates. If required, you can also customize the domain to suit your environment by adding and configuring managed servers, clusters, and machine definitions, or customizing predefined JDBC data sources and JMS file store directories.
You might want to customize your domain in the following circumstances:
To create a multiserver or clustered domain when using the default settings. All the predefined templates delivered with the product create single-server domains.
To use a database that is different from the default database in the domain or extension template. Here, you need to customize the JDBC settings to point to the appropriate database.
To customize the listen port and the SSL port
To create a test environment using a domain template that you received, and to modify the domain configuration to work in the test environment based on your requirement.


Creating a New WebLogic Domain and Selecting the Domain Source
 start of the Configuration Wizard.
1.  If you want to create a new domain, select the “Create a new WebLogic domain” option. If you want to extend or customize a preexisting domain for the JDBC data source, run SQL scripts, or change the JMS store settings, and select the “Extend an existing WebLogic domain” option. 
2.  If you choose to have the domain configured automatically to support the Oracle WebLogic Server, the domain is based on the default template wls.jar that is found in the <WL_HOME>/common/templates/domains directory.
If you have an existing domain that you want to use as a source to create the new domain, select the “Base this domain on an existing template” option (which by default is pointed to the same preceding
wls.jar location).

3.   Using the administrator username and password, you can log in to the Administration Console to manage the Oracle WebLogic Server domain.
4.   Select the Java Development Kit (JDK) from the options available. (If you do not see the JDK that you would like to use, make sure that the PATH and <JAVA_HOME> environment variables are pointing to the correct JDK and JDK/bin directory. As mentioned in the lesson titled “Installing Oracle WebLogic Server 11g,” Oracle WebLogic Server 10.3 is certified with JDK 6.0.)
  The Domain Startup Mode is used to make a domain more or less suitable for development or production. Developers would choose Development, and administrators would choose Production. A Development Mode domain can be easily turned into Production Mode by a selecting a check box in the Administration Console that you will see later, but to turn the domain back into Development requires editing the config.xml file and changing <production-mode-enabled> to false for the domain. In Development mode, you can use auto-deployment and Fast-Swap, both covered in the lesson titled,  “Deployment Concepts” in this course.
Customizing Advanced Configuration
 if you want to optionally go down this configuration path. Select the check boxes to customize the environment or services settings, such as modifying (configuring) the administration server, managed servers, clusters, machines, JDBC data sources, RDBMS Security Stores, or JMS store settings. By default, none of the check boxes are selected. If you left the check boxes unselected, it would skip the next few screens.
Configuring the Administration and Managed Servers
 In every domain, one server must be designated as the administration server: the central point from which the entire domain is managed.
You can access the administrator server by using the URL protocol://listen-address:listen-port. The protocol can be any of the following: t3, t3s, http, or https. (t3 and t3s are proprietary protocols that are analogous to the industry-standard HTTP or HTTPS protocols.)
You can define the listen-address and listen-port on the “Configure the Administration Server” page of the Configuration Wizard. The valid port range for non-SSL ports is 1 through 65534. The default non-SSL port is 7001. The valid port range for SSL ports is 1 through 65535. The default SSL port is 7002.
On multihomed Windows machines, a server instance can bind to all available IP addresses. On a multihomed computer, you can use the same listen port, but you must configure each server to use a unique IP address as the listen address. If your computer does not support multiple IP addresses, you must use a different listen port for each active instance.
In production environments, enterprise applications are hosted typically on one or more managed servers; typically, there are no applications deployed to the administration server.
You can add and delete managed servers on the Configure Managed Servers page, which is displayed when you click Next on the “Configure the Administration Server” page of the Configuration Wizard.