Creating the WebLogic domain
With WebLogic Server 12c installed, you can now create a new WebLogic domain.
The WebLogic domain is the central configuration entity of WebLogic Server. The domain should have at least one WebLogic Server instance with the role of the Administration Server. The Administration Server is the access point used for configuration, deployment, and monitoring.
More WebLogic Server instances can be created to be part of the domain. All other WebLogic Server instances of the domain that are not the Administration Server are called the Managed Servers. They should host the deployed applications and resources.
A WebLogic cluster can also be added to the domain. The cluster consists of one or more Managed Servers acting as one single entity. A single WebLogic Server installation is not restricted to one WebLogic domain, and more domains can be created using the same installation.
Getting ready
Before creating a new WebLogic domain, you have to plan and define its architecture. For production environments, it is mandatory to use WebLogic clusters with a minimum architecture of at least two WebLogic Server instances (the Managed Servers) in two different machines. The objective is to avoid having a single point of failure.
We will create a new WebLogic domain called PROD_DOMAIN
with an administration instance (AdminServer
) named PROD_AdminServer
and a WebLogic cluster PROD_Cluster
with the two Managed Servers PROD_Server01
and PROD_Server02
. The two machines hosts are called prod01
and prod02
. Since you have already installed WebLogic Server 12c in prod01
, install it in prod02
as well. We will assume these names throughout the entire book.
The machines prod01
and prod02
should also have IP addresses assigned and be visible through the network. It's recommended to use the fully qualified domain name (FQDN) of the servers. In this recipe, and the rest of the book, prod01
is prod01.domain.local
and the hostname of the prod02
machine is prod02.domain.local
.
Note
To simplify the reading, we'll use the following term when referring to the directories:
$DOMAIN_HOME
to the created WebLogic Domain directory—/oracle/Middleware/user_projects/domains/PROD_DOMAIN
.
How to do it...
To create a new WebLogic domain, follow the ensuing steps:
Log in as a
wls
user on the first machineprod01
and navigate to the following folder:[wls@prod01]$ cd $WL_HOME/common/bin
Start WebLogic Configuration Wizard in console mode:
[wls@prod01]$ ./config.sh -mode=console
Follow the onscreen instructions and type 1, and press Enter to select the Create a new WebLogic domain option on the Welcome screen.
Type 1 and press Enter to select the Choose WebLogic Platform components option on the Select Domain Source screen.
Press Enter again to continue with the Basic WebLogic Server Domain - 12.1.1.0 [wlserver_12.1] template.
On the Edit Domain Information screen, type the domain name
PROD_DOMAIN
and press Enter twice.Leave
/oracle/Middleware/user_projects/domains
unchanged on the Select the target domain directory for this domain screen and press Enter.On the Configure Administrator User Name and Password screen, set the WebLogic administrator username and password. Type the username as
wlsadmin
and type 2 to set the password and 3 to type the password again and confirm it. Press Enter to move forward.The Domain Mode Configuration screen is where you set the production mode. Type 2 and press Enter.
The installed JRockit should already be selected as
/oracle/jvm
on the Java SDK Selection screen. Press Enter to continue.On the Select Optional Configuration screen, type 1 for the Administration Server and 2 for the Managed Servers, clusters, and machines.
On the Configure the Administration Server screen, type 1 to set the Administration Server name as
PROD_AdminServer
. Leave the other options in their default values and press Enter to move to the next screen.Then add the two Managed Server instances on the Configure Managed Servers screen.
Type
PROD_Server01
to add the first server, then type 2 to modify the listen address toprod01.domain.local
. Type 3 to modify the port to8001
, press Enter, and then type 5 to finish this server.Do the same for the second server and type 1 to add, type
PROD_Server02
as the name, and type 2 to modify the listen address toprod02.domain.local
. Type 3 to modify the port to8002
. Press Enter to continue.Add the cluster on the Configure Clusters screen. Type
PROD_Cluster
and press Enter to create it. Type 3 and modify the Cluster Address field toprod01.domain.local:8001
,prod02.domain.local:8002
.The next screen is the Assign Servers to Clusters screen. Type 1 to select
PROD_Cluster
. Then type 2 to Select All and press Enter. Confirm it by pressing Enter again.Configure the two machines on the Configure Machine screen. Type
prod01
and press Enter. Type 2 to change the listen address toprod01.domain.local
as well. Type 4 when done.Add the second machine typing 1 and name it as
prod02
. Press Enter and press Enter again to skip the Unix Machine screen.You will now assign the Managed Servers to their respective machines on the Assign Servers to Machines screen.
Type
1.1
to chooseprod01
and type 1 and press Enter. Now type1-2
and press Enter assigning thePROD_AdminServer
andPROD_Server01
servers. Press Enter again to return.Type
1.2
to chooseprod02
, then type 1 and 1 again, and press Enter to finish.
How it works...
A new domain was created in the console mode using the Configuration Wizard. Console mode was used instead of graphical interface mode due to the usual restrictions of a production environment.
The PROD_DOMAIN
domain was created with one the Administration Server named PROD_AdminServer
and one cluster PROD_Cluster
containing the two Managed Servers PROD_Server01
and PROD_Server02
.
The WebLogic domains can work in two different modes: production and development. The development mode is only recommended to be used in single WebLogic instance domains, normally at the developer desktop. The PROD_DOMAIN
domain was created in Production mode, which deactivates some features such as auto-deployment.
Tip
It's good practice to use a prefix such as PROD
when naming the domain, the cluster, and the servers. It can be hard to find WebLogic Server when working with a production farm that contains hundreds of WebLogic instances.
The domain contains what is considered to be a minimum architecture for a production environment. With the two Managed Servers of the cluster hosted by different machines, the platform avoids a single point of failure in the case of a machine crash.
There's more...
You can create the domain using the Configuration Wizard in graphical mode with all the same options if you have a functional X11 Server.
See also
Distributing the domain files to remote machines