Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
91 views

Oracle WebLogic 12C Installation Guide Version 0

Uploaded by

beze2009
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Oracle WebLogic 12C Installation Guide Version 0

Uploaded by

beze2009
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Oracle WebLogic 12.2.1.

4 Installation and
Configuration Guide
Introduction
This document provides a step-by-step guide for installing the Oracle WebLogic 12.2.1.4
application server on a Windows operating system. It is organized into nine main steps that
should be followed sequentially. Each step outlines the configuration or setup required to
successfully complete the installation. While the installation process may vary based on
specific technical requirements, this guide covers the method that has been tested and verified
on MoR development and Testing environment.

Step 1: Prerequisites
Before you begin the installation, ensure the following:

 Java Development Kit (JDK) 8 or higher: Oracle WebLogic 12.2.1.4 supports JDK 8
(update 161+) or higher.
 Sufficient System Resources:
o Minimum 2GB RAM.
o 3GB free disk space.
o Administrative privileges.
 Oracle Database 11g R2 or above

Download JDK

1. Download JDK:

Visit the [Oracle Java SE download


page](https://www.oracle.com/java/technologies/javase- downloads.html) and
download the JDK 8 installer for Windows.

2. Install JDK:

Run the downloaded installer and follow the steps to install JDK. Take note of the
installation directory (e.g., `C:\Program Files\Java\jdk1.8.0_311`).

3. Set JAVA_HOME Environment Variable:

Open the Control Panel > System > Advanced System Settings.

Click on Environment Variables and create a new system variable:

Variable Name: `JAVA_HOME`

1
Variable Value: The JDK installation directory.

Also, append `%JAVA_HOME%\bin` to the Path environment variable.

4. Verify JDK Installation:

Open Command Prompt and run `java -version` to confirm JDK installation.

Download Oracle WebLogic Server 12.2.1.4 (Infrastructure)

1. Download the WebLogic Installer:

Visit the [Oracle WebLogic Server


Downloads](https://www.oracle.com/middleware/technologies/weblogic-server-
installers.html) page and download the WebLogic 12.2.1.4 Infrastructure installer:
`fmw_12.2.1.4.0_wls_infrastructure.jar`.

Step 2: Install Oracle WebLogic Server 12.2.1.4


This step is used to install the basic weblogic server and other basic Oracle middle ware
infrastructure. The configuration of the weblogic server will follow after installation of
repository unit.

1. Open Command Prompt:

- Run Command Prompt as Administrator.

- Navigate to the directory where the WebLogic installer `.jar` file is located.

2. Run the WebLogic Installer:

- Execute the following command to launch the WebLogic installation wizard:

java -jar fmw_12.2.1.4.0_infrastructure_disk1_1of1.jar

2
3. Installer Wizard:

- The graphical installer will launch.

1. Welcome Screen:

- Click Next.

2. Auto Updates:

- Choose Skip Auto Updates. Click Next.

3
3. Installation Location:

- Choose or create an Oracle Home directory (e.g., `C:\Oracle\Middleware\Oracle_Home`).

4. Installation Type:

4
- Select Fusion Middle ware infrastructure and click Next.

5. Prerequisite Checks:

- The installer will verify system prerequisites. Once all checks pass, click Next.

6. Installation Summary:

- Review the summary and click Install.

7. Installation Progress:

- Wait while the installer copies files and installs WebLogic Server. Once complete, click
Next.

8. Finish Installation:

- Click Finish to exit the installer.

5
Step 3: Installing Repository Configuration Unit
The Repository Configuration Utility (RCU) is a tool to create and manage database schemas
required by the weblogic server and dependent infrastructure. Its primary purpose is to set up
the database repositories (schemas and tables) that weblogic rely on for storing metadata,
configuration, and operational data.

1. Run RCU.bat

Go to Oracle home/Oracle_common and run RCU.bat file example


(C:\oracleWeblogic\oracle_common\bin)

2.RCU Welcome Screen:

The RCU GUI will launch. Click Next on the welcome screen.

3. Create Repository:

On the Create Repository screen, select Create to create new schemas. Click Next.

6
4. Database Connection Details

7
Provide Database Connection Information:

o Enter your database connection details:


o Database Type: Oracle Database.
o Host Name: The database server hostname.
o Port: Database listener port (default: 1521).
o Service Name: Your Oracle Database service name (e.g., orcl or XE for
Express Edition).
o Username: Enter sys as the username (or other DB admin).
o Password: Enter the password for the sys user.
o Select SYSDBA as the role.
2. Check Prerequisites:
o Click Next, and the RCU will check the database connection and
prerequisites.

8
5. Select Components to Install

Select Schemas:

Choose the components for which you want to create schemas

Schema Ownership:

Review the schema owner information. Each component will have a unique prefix (e.g.,
DEV_) that will be added to the schema names.

6. Specify Schema Passwords

Schema Passwords:

Set a password for each schema, or use the same password for all the schemas by selecting
Use Same Password for All Schemas.

9
7. Map Tablespaces

Tablespace Mapping:

RCU will generate the required tablespaces for the schemas. You can accept the defaults or
modify them as needed.

Create Tablespaces:

Click Next to allow RCU to create the necessary tablespaces in the database.

8. Finalize and Create

1. Review Summary:
o Review the summary of components and schemas that will be created.
2. Create Schemas:
o Click Create to begin the schema creation process.
3. Schema Creation Success:
o Once the process completes, a success message will be displayed. Click Close.

9. Verify Schema Installation

Check the Database:

After RCU completes, log in to the database using an SQL tool (like SQLPlus or SQL
Developer) and verify that the schemas were created by running a query:

10
Step 4: Configure Web Logic Domain
This step is a critical step after installation to ensure that weblogic is properly set up to host
and manage Java EE applications and services. It covers domain creation including managed
server, cluster, node manager and other important components. It also deals with the steps to
configure JDBC resource and security realm.

1. Run the Configuration Wizard:

Navigate to the WebLogic installation directory, usually located in


C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin`.

Run the `config.cmd` script:

2. Create a New Domain and domain Location:

Select Create Domain and click Next.

Specify the path for the new domain, for example:


`C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain`. Click Next.

11
3. Template Selection:

- Select similar Template as per the above picture Click Next.

12
3. Administrator Account Setup:

Set up the WebLogic administrator username (`weblogic`) and password. Click Next.

13
4. Domain Mode and JDK:

Select Development Mode or Production Mode, depending on your environment.

Ensure that the JDK points to the one installed earlier. Click Next.

14
4. Database Configuration Type:

1. In this step, you'll need to configure the connection to the RCU-created schemas.
o Select Configure JDBC Data Sources, and click Next.
2. Select Components:
o The wizard will list various components such as SOA Infrastructure, User
Messaging Service, or other middleware components based on the templates
you selected earlier.

Click Next.

3. Configure Data Source Details:


o For each component, you need to configure the JDBC connection to the RCU
schemas:
 Database Type: Oracle
 Host Name: The hostname or IP address of the Oracle Database server.
 Port: Default Oracle port is 1521.
 Service Name or SID: The service name or SID of your Oracle
Database.
 Schema Owner: The owner of the schema (e.g., DEV_SOAINFRA for
SOA, DEV_IAU for audit services).
 Schema Password: The password you set during the RCU execution
for each schema.

After configuring all required data sources, click Next.

15
5. JDBC Test:

1. In this step, the wizard will test all the JDBC connections you configured in the
previous step.
2. Verify that all connections succeed. If any test fails, verify the connection details
(hostname, port, database credentials).

Click Next when all tests pass.

6. Configure Advanced Settings

The Advanced Configuration step in the WebLogic Configuration Wizard allows you to
perform additional configuration tasks, such as setting up Managed Servers, Clusters,
Machines, and Node Manager. This step is useful when you are setting up a production
environment or planning to have a more scalable architecture.

16
6.1 Configure Managed Servers

In the Advanced Configuration screen, select Managed Servers and click `Next`.

6.2. Add Managed Servers:

To add a new Managed Server, click on the Add button and provide the following details:

-Name: The name of your Managed Server (e.g., `ManagedServer1`).

- Listen Address: The IP address or hostname of the server. Typically, it‟s set to `localhost`

if it‟s on the same machine as the Admin Server, or the actual server IP if it's a remote

server.

- Listen Port: The port number on which the Managed Server listens (default: `7003`).

- SSL Enabled: Check this if you want the server to use SSL for communication, and
configure the SSL port.

Repeat this step if you want to create multiple Managed Servers.

Click `Next` when done.

17
6.3 Configure Clusters

1. In the Advanced Configuration screen, select Clusters and click `Next`.

2. Add a New Cluster:

- Click the Add button and provide:

- Name: The name of your cluster (e.g., `MyCluster`).

- Cluster Address: The DNS name or IP addresses of all Managed Servers in the cluster
(optional).

3. Unicast/Multicast:

- Choose Unicast (recommended) for communication between cluster members.

- Multicast is an older option but is generally not recommended.

Click `Next`.

18
6.4 Assign Managed Servers to the Cluster

1. After configuring clusters, the wizard will ask you to assign the Managed Servers to the
cluster.

2. Select the Managed Server(s) you created earlier, and move them to the cluster using the
right arrow.

Click `Next`.

19
6.5 Configure Machines (Node Manager Setup)

A Machine represents the physical or virtual machine on which the WebLogic Server
instance runs. It is required if you plan to use Node Manager for starting and stopping servers
remotely.

1. In the Advanced Configuration screen, select Machines and click `Next`.

20
2. Add a New Machine:

- Click the Add button and configure the following details:

- Name: Name of the machine (e.g., `MyMachine`).

- Machine OS: Select the operating system of the machine (`Unix` or `Windows`).

- Node Manager Listen Address: The IP address or hostname of the machine where the
Node Manager is running.

- Node Manager Listen Port: The port where Node Manager listens (default: `5556`).

3. After adding the machine, click `Next`.

6.6 Assign Servers to Machines

1. In this step, you'll assign your Admin Server and any Managed Servers to the machine
configured above.

2. Select the servers (Admin and Managed) and assign them to the machine using the right
arrow.

Click `Next`.

6.7 Configure Node Manager

Node Manager is a utility that enables you to start, stop, and restart WebLogic Server
instances remotely.

1. In the Node Manager section:

21
- Node Manager Type: Choose the appropriate type of Node Manager, typically Per
Domain Node Manager (default).

- Username/Password: Set up the username and password for the Node Manager, which
will be used to authenticate when starting and stopping servers.

2. Click `Next`.

6.8 Target Deployments and Services

This step will be done when installing enterprise archive (ear) files after installation

6.9 JMS Server Setup

Not Required

6.10 Finalizing Advanced Configuration

Once you have completed all necessary advanced configurations (Managed Servers, Clusters,
Machines, etc.), review the summary of your setup and click Create to finalize the domain
creation.

22
Step 5: Post-Configuration Activity
Optional Post-Configuration Steps

After creating the domain with the advanced configuration:

1. Start Node Manager:

- If you configured Node Manager, start it by navigating to:

C:\Oracle\Middleware\Oracle_Home\user_projects\domains\MyDomain\bin\nodemanager

Run:

startNodeManager.cmd

2. Start Admin and Managed Servers:

- Once Node Manager is running, you can start your Admin and Managed Servers either
from the WebLogic Admin Console or by running `startManagedWebLogic.cmd` for each
Managed Server from the `MyDomain\bin` directory:

C:\Oracle\Middleware\user_projects\domains\MyDomain\bin\startManagedWebLogic.cmd
ManagedServer1 http://localhost:7001

3. Verify Deployment:

- Log into the WebLogic Admin Console and verify that your Admin Server, Managed
Servers, clusters, and resources are all running properly.

23
Step 6: Configuring the Data Source
1. If the Admin Server is not running, then start it up via the batch file responsible for
this task. You have to look in the new domain‟s home folder under the “bin”
directory. For the AdminServer, you want the batch file called “startWebLogic.cmd”.
 It is recommended that you copy a shortcuts to this batch file to the desktop or
to some Start menu folder of your choice, to have easier access to it. You
won‟t need it, usually, if you‟re using NodeManager, but when NodeManager
hasn‟t been told to keep this instance running (as now), you‟ll have to run it to
make the Console available. It is also recommended that you rename it so that
it is clear to what domain and WLS process it refers.
 Because we did a production installation, it will ask for the username and
password to start the server.
2. Once you see in the window created for this batch file‟s execution a line that reads
“Server started in RUNNING mode”, the Console is ready for action. If you accepted
the default port, the URL for accessing the Console will be
http://servername:7001/console. If you were working via RDP and you have direct
access to the server because it is in your network, you can now switch to working
from a browser on your local machine.
3. Once the welcome screen comes up enter the username (the default is “weblogic”)
and password which you created while configuring the new WLS domain in the
previous section.
4. Once the console is up, click on the “Data Sources” link.
5. Click on “Lock & Edit” to allow modification of server configuration.
a. This “Lock & Edit” step is only necessary if you chose to create a
“Production” domain earlier.
6. Just above the empty table of data sources, click on the button labelled “New” and
select “Generic Data Source”.
7. You must enter “EtaxConnDS” for the Name, and “jdbc/EtaxConnDS” for the JNDI
Name. The default Database Type is “Oracle” and should be left that way. Click
“Next”.
8. For the Data Source Properties, you must change the Driver to be “Oracle‟s Driver
(Thin) for Instance connections”. Do not use the XA driver. Now click “Next”.
9. In the Transaction Options, uncheck the checkbox for “Supports Global
Transactions”. Click “Next”.
10. In the Connection Properties screen, you must enter the information appropriate for
the installation. Remember that these connections do not use TNS Names so you
actually use the Database/Service Name and the real Schema name. Once the
information has been entered, click “Next”.
11. The next screen will re-present the information you‟ve just entered, as well as some
new fields, which can all be safely left as they are. The useful new button is “Test
Configuration” which you should click and see if the connection is functional. If it did
not test successfully, click on “Back, and repeat the previous step. Once the Test
Configuration button results in a successful test, you can click on “Next” to proceed.

24
12. In the final step, you must check the box next to “EtaxServer” to make the new data
source available where the application will be deployed. Then click on “Finish”.
13. We need to change some connection options in an effort to make a production
installation “lightning fast”. So click on the link of your new connection name in the
list of data sources and then select the “Connection Pool” tab. Change:
a. Initial Capacity to 20
b. Capacity Increment to 20
c. Maximum Capacity to 512
i. This setting is still somewhat arbitrary. We will have to run some
statistical analysis scripts on the production database after its in full
swing in order to assess what its capacities are: the amount of memory
used by each connection can vary depending on how it is used under
real circumstances.
14. Click on “Save”
15. Click on the “Advanced” link to expose the rest of the connection options and change:
a. Test Connection on Reserve: checked
i. This is a best practice
b. Test Table Name set to: SQL SELECT 1 FROM DUAL@TAXAPP
i. Normally it‟s just from DUAL, but by using the database link we are
testing both the Etax DB connection as well as the database link to
SIGTAS
c. Seconds to Trust an Idle Pool Connection: 60
i. 10 just seems a little short
d. Connection Creation Retry Frequency: 180
i. I actually feel it could be longer (e.g. 900 or 1800 seconds), since if
there‟s a failure it could be hours before it will work again, but if the
System Administrator or DBA forgets or doesn‟t know about this, they
may not realize that a delayed response is due to this frequency setting.
e. Inactive Connection Timeout: 0
i. The default is 0, but make sure this is 0! I used to set it to just over the
session timeout length, but this is a fundamental misunderstanding and
leads to hard-to-trace errors. We have yet to have any reason to believe
there are leaked connections that need this timeout.
16. Click on “Save” again and, on the left in the “Change Centre” click on “Activate
Changes”.

25
Step 7: Configuring the Security Realm
1. From the WLS Console (see beginning steps of previous section), click on the
“Security Realms” link.
2. In the table of realms, there should be one realm called “myrealm”. Click on this link.
3. Many tabs will become visible. Click on the one labelled “Providers”.
4. Click on “Lock & Edit” in the Change Centre.
5. First, click on the “DefaultAuthenticator” link, and switch the “Control Flag” drop-
down to “SUFFICIENT”. Click on “Save”. It will report that you need to restart, but
we will do this later.
6. We need to return to the Providers page. You should be able to do this from the
breadcrumbs path at the top of the screen, but otherwise click on the “Security
Realms” link on the left, then “myrealm” again, then on the “Providers” tab again.
7. Click on the “New” button. Enter “EtaxDBAuthenticator” as the name, and switch the
Type drop-down to “SQLAuthenticator”. Click on “OK”.
8. “Activate Changes” in the “Change Centre” at the left.
9. Now we could configure the new provider, but it is very cumbersome to enter all the
SQL statements. So we‟re going to take a shortcut by modifying the server
configuration file directly, and we‟re encouraged to do this especially because we
have to restart the WLS anyway. Therefore, stop the Admin Server, which if you‟ve
been following these instructions is now running in its own window (rather than being
managed by Node Manager), by pressing Ctrl-C in that window. (See section below
on Stopping a Server Process.)
10. Once that‟s done stopping, navigate to the domain home directory you specified when
you first created the domain, and then into “config”. Make a copy of the “config.xml”
file, for safekeeping.
Now open the “config.xml”. Find the xml block that starts with the tag <realm>
Replace everything inside realm with the below xml

<realm>
<sec:authentication-provider
xmlns:prov="http://xmlns.oracle.com/oracleas/schema/11/jps/weblogic/providers"
xsi:type="prov:trust-service-identity-asserterType">
<sec:name>Trust Service Identity Asserter</sec:name>
</sec:authentication-provider>
<sec:authentication-provider xsi:type="wls:default-authenticatorType">
<sec:name>DefaultAuthenticator</sec:name>
<sec:control-flag>SUFFICIENT</sec:control-flag>
<wls:use-retrieved-user-name-as-principal>true</wls:use-retrieved-user-name-
as-principal>
</sec:authentication-provider>
<sec:authentication-provider xsi:type="wls:sql-authenticatorType">
<sec:name>EtaxDBAuthenticator</sec:name>

26
<sec:control-flag>REQUIRED</sec:control-flag>
<wls:enable-group-membership-lookup-hierarchy-caching>false</wls:enable-
group-membership-lookup-hierarchy-caching>
<wls:data-source-name>EtaxConnDS</wls:data-source-name>
<wls:plaintext-passwords-enabled>true</wls:plaintext-passwords-enabled>
<wls:sql-get-users-password>SELECT password FROM etax_user WHERE
login_id = ?</wls:sql-get-users-password>
<wls:sql-user-exists>SELECT login_id FROM etax_user WHERE login_id =
?</wls:sql-user-exists>
<wls:sql-list-member-groups>SELECT r.etax_role_name FROM etax_user_role
g, etax_role r, etax_user u WHERE g.etax_user_id = u.etax_user_id AND
r.etax_role_id = g.etax_role_id AND u.login_id = ?</wls:sql-list-member-groups>
<wls:sql-list-users>SELECT login_id FROM etax_user WHERE login_id LIKE
?</wls:sql-list-users>
<wls:sql-get-user-description>SELECT un.user_name1 || ' ' || un.user_name2 || ' '
|| un.user_name3 FROM etax_user u, etax_user_name un WHERE u.etax_user_id =
un.etax_user_id AND un.locale_code = 'en' AND u.login_id = ?</wls:sql-get-user-
description>
<wls:sql-list-groups>SELECT etax_role_name FROM etax_role WHERE
etax_role_name LIKE ?</wls:sql-list-groups>
<wls:sql-group-exists>SELECT etax_role_name FROM etax_role WHERE
etax_role_name = ?</wls:sql-group-exists>
<wls:sql-is-member>SELECT u.login_id FROM etax_user_role g, etax_user u,
etax_role r WHERE u.etax_user_id = g.etax_user_id AND r.etax_role_id =
g.etax_role_id AND r.etax_role_name = ? AND u.login_id = ?</wls:sql-is-member>
<wls:sql-get-group-description>SELECT etax_role_desc FROM etax_role
WHERE etax_role_name = ?</wls:sql-get-group-description>
<wls:password-style>PLAINTEXT</wls:password-style>
<wls:password-style-retained>false</wls:password-style-retained>
<wls:sql-create-user></wls:sql-create-user>
<wls:sql-remove-user></wls:sql-remove-user>
<wls:sql-remove-group-memberships>DELETE FROM etax_user_role WHERE
etax_user_id = ( SELECT etax_user_id FROM etax_user WHERE login_id = ? ) OR
etax_role_id = ( SELECT etax_role_id FROM etax_role WHERE etax_role_name = ?
)</wls:sql-remove-group-memberships>
<wls:sql-set-user-description></wls:sql-set-user-description>
<wls:sql-set-user-password>UPDATE etax_user SET password = ? WHERE
login_id = ?</wls:sql-set-user-password>
<wls:sql-create-group>INSERT INTO user_role (etax_role_id, etax_role_name,
etax_role_desc, user_type_id) VALUES ( ? , ?, ? , ? )</wls:sql-create-group>
<wls:sql-set-group-description>UPDATE etax_role SET etax_role_desc = ?
WHERE etax_role_name = ?</wls:sql-set-group-description>
<wls:sql-add-member-to-group>INSERT INTO etax_user_role (etax_user_id,
etax_role_id, enter_user_id, enter_tmstmp) VALUES ( (SELECT etax_user_id
FROM etax_user WHERE login_id = ?), (SELECT etax_role_id FROM etax_role
WHERE etax_role_name = ?), (SELECT user FROM dual), (select sysdate from
dual) )</wls:sql-add-member-to-group>
<wls:sql-remove-member-from-group>DELETE FROM etax_user_role
WHERE etax_role_id = (SELECT etax_role_id FROM etax_role WHERE

27
etax_role_name = ? ) AND etax_user_id = ( SELECT etax_user_id FROM etax_user
WHERE login_id = ? )</wls:sql-remove-member-from-group>
<wls:sql-remove-group>DELETE FROM etax_role WHERE etax_role_name =
?</wls:sql-remove-group>
<wls:sql-remove-group-member>DELETE FROM etax_user_role WHERE
etax_role_id = ( SELECT etax_role_id FROM etax_role WHERE etax_role_name = ?
)</wls:sql-remove-group-member>
<wls:sql-list-group-members>SELECT u.login_id FROM etax_user_role g,
etax_role r, etax_user u WHERE g.etax_user_id = u.etax_user_id AND
g.etax_role_id = r.etax_role_id AND r.etax_role_name = ? AND u.login_id like
?</wls:sql-list-group-members>
</sec:authentication-provider>
<sec:authentication-provider xsi:type="wls:default-identity-asserterType">
<sec:name>DefaultIdentityAsserter</sec:name>
<sec:active-type>AuthenticatedUser</sec:active-type>
<sec:active-type>weblogic-jwt-token</sec:active-type>
</sec:authentication-provider>
<sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml"
xsi:type="xac:xacml-role-mapperType">
<sec:name>XACMLRoleMapper</sec:name>
</sec:role-mapper>
<sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml"
xsi:type="xac:xacml-authorizerType">
<sec:name>XACMLAuthorizer</sec:name>
</sec:authorizer>
<sec:adjudicator xsi:type="wls:default-adjudicatorType">
<sec:name>DefaultAdjudicator</sec:name>
</sec:adjudicator>
<sec:credential-mapper xsi:type="wls:default-credential-mapperType">
<sec:name>DefaultCredentialMapper</sec:name>
</sec:credential-mapper>
<sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType">
<sec:name>WebLogicCertPathProvider</sec:name>
</sec:cert-path-provider>
<sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
<sec:user-lockout-manager>
<sec:lockout-enabled>false</sec:lockout-enabled>
</sec:user-lockout-manager>
<sec:name>myrealm</sec:name>
<sec:password-validator
xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator"
xsi:type="pas:system-password-validatorType">
<sec:name>SystemPasswordValidator</sec:name>
<pas:min-password-length>8</pas:min-password-length>
<pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-
characters>
</sec:password-validator>
</realm>

28
Step 8: Advanced Configurations on Node Manager
and Servers
Now, moving from the “config” folder to the “bin” folder of the domain, edit
“setDomainEnv.cmd” and add the following commands to the beginning of the script (note
that the JAVA_OPTIONS setting should all be on one line!):
set WLS_USER=weblogic
set WLS_PW=password
set JAVA_OPTIONS=-Djbo.passivationstore=database -
Djbo.ampool.maxinactiveage=60000 -Djbo.ampool.monitorsleepinterval=30000 -
Djbo.ampool.timetolive=120000 %JAVA_OPTIONS%
Now find the existing MEM_PERM_SIZE entries and change the PermSize to a memeory
size that is aligned with the virtual machine memory size. Also find the MaxPermSize entries
and do the same. Let us say the machine where weblogic is installed has 16gb memory size.In
this case you can allocate around 25-50% of the total memory to WebLogic Server,
depending on the server's workload. For example, you could allocate 8 GB (which is 8192
MB). Here is a sample configuration
set WLS_MEM_ARGS_64BIT=-Xms4096m –Xmx8192m

set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx512m

if NOT "%JAVA_VENDOR%"=="HP" (
if "%VM_TYPE%"=="HotSpot" (
set WLS_MEM_ARGS_64BIT=-Xms4096m -Xmx8192m
set WLS_MEM_ARGS_32BIT=-Xms256m -Xmx512m
)
)

Save the edited file.


Note that the way we will configure Node Manager means that it will run setDomainEnv.cmd
before starting any instance, so the changes we made to it are more or less universal.
Next, create a batch file with a text editor, placing it in the same “bin” folder as
“startManagedWebLogic.cmd”, calling it “startEtaxServer.cmd”. In it put the following lines
(replacing “EtaxServer” with the name of your server if necessary):
:START
call startManagedWeblogic.cmd EtaxServer
echo Return code was %ERRORLEVEL%
goto START

29
Create a shortcut (on the desktop, or wherever you like) pointing to the new
“startEtaxServer.cmd” script, calling it something like “Start eTax Server”. You can use this
file to start the server when you do not wish it to be managed by Node Manager. Note,
though, that for a production instance this is not at all recommended as a normal practice.

Stopping a Server Process


If you started it via a batch file, then simply press CTRL-C within the command window of
the server process. When eventually it asks “Terminate Batch Job (Y/N)?”, it means that it
has already stopped the server process, and what you answer to the question is immaterial.

Configuring the Server to Withstand Load


Now start up the WLS (Admin and eTax) server processes. This time they should not need a
password.
Navigate to our domain‟s Environment -> Work Managers, Lock & Edit, and create a new
work manager:
 Type: Maximum Threads Constraint
 Name: MaxThreadsConstraint
 Data Source: EtaxConnDS
Assign it to the “EtaxServer” in the second step.
Activate Changes.

Configuring the Server to Restart When Things Go Wrong


Go to the Environment -> Servers -> EtaxServer -> Overload tab. Change:
 “Failure Action” to “Force immediate shutdown of this server”.
 “Panic Action” to “Exit the Server Process”.
 “Max Stuck Thread Time” to “300”
 “Stuck Thread Count” to “5”
Click “Save”
Go to the “Server Start” tab and enter the following (note that here, like everywhere in this
document, the upper case italicized strings are to be replaced with full directory paths):
o Java Home: the Sun Java home directory on the server (e.g.
“MIDDLEWARE_HOME/ jdk1.8.0_221”)
o Java Vendor: Oracle
o Bea Home: the Middleware home directory (just MIDDLEWARE_HOME)
o Root directory: the domain directory (e.g.
“MIDDLEWARE_HOME/user_projects/domains/DOMAIN_NAME”)
o Class path: leave empty
o Arguments: -Xrs

30
o Security policy file:
“MIDDLEWARE_HOME\wlserver_10.3\server\lib\weblogic.policy” -> this
location will be different as we are installing 12.2.1.4
o Username: weblogic
o Passwords: the password
Save.
Looking in the “Domain Structure” navigation panel on the left side of the page, click on the
domain name, and then, in the main panel, on the “Security” tab, and then finally on
“Advanced” half-way down the page.
Change the NodeManager Username to “weblogic” and the NodeManager Password to the
same as we use for the Admin Server (this is out of convenience: there may be a reason in the
future to use a different login here).
Save and Activate Changes. The server will have to be stopped and restarted before all the
changes take effect, but actually we don‟t want to restart it quite yet, just stop it.

Making the Node Manager Work


If it‟s running, stop the Admin Server. Note that none of the double quotation marks in these
instructions need to actually be typed, but all of the single quotation marks do.
 From a command line, change the current directory to
“MIDDLEWARE_HOME\wlserver_10.3\server\bin” -> location will be different
 Run “setWLSEnv.cmd”
 Run “installNodeMgrSvc.cmd”.
 Run “services.msc”
 Find the new service, called “Oracle Fusion Middleware 12.2.1.4.0
NodeManager…”, and start it.
o You‟ll note that it‟s set to “Automatic”: next time Windows starts this service
will run itself.
 Navigate to “MIDDLEWARE_HOME\wlserver_10.3\common\nodemanager” and
open up “nodemanager.properties” with Notepad or your favourite text editor ->
location will be different

 Change both “CrashRecoveryEnabled” and “StartScriptEnabled” to “true”


 From the Services window, restart or stop/start the NodeManager service to make the
changes to nodemanager.properties register
 Start a fresh command line
 Change the current directory to DOMAIN_HOME
 Run “bin\setDomainEnv.cmd”
 Run “java weblogic.WLST”

31
 Connect to NodeManager using
“nmConnect(domainName='domain_name',username='weblogic',password='passwor
d')”
 Start the AdminServer using “nmStart('AdminServer')”
 Using a browser, log in to the Admin Server console, navigate to Servers -> Control,
“Lock & Edit”, then start the EtaxServer
o Apparently the very first time a managed server must be started this way, or
else the WLST will complain with the following error in the log:
 Booting as admin server, but servername, EtaxServer, does not match
the server name, AdminServer
 In the future, EtaxServer can be started either via the Admin Server console, or else
using “nmStart(„EtaxServer‟)” from the WLST
 The beauty is that once the Servers have been started with NodeManager, they will
always be returned to the running state, even if the task kills itself, or the computer
restarts

Some Simple Scripts for Handling Node-Managed Server Processes


Here is a WLST script (which are written in Python) for starting a node-managed server. Call
it “start_wls.py”.
# first agument: the domain name
# second argument: the weblogic user password for that domain
# third argument: the weblogic server name
# e.g. java weblogic.WLST start_wls.py etaxTrain mypassword AdminServer
import sys

pDomainName = sys.argv[1]
pPassword = sys.argv[2]
pServerName = sys.argv[3]

# First try to restart the server with node manager


try:

nmConnect(domainName=pDomainName,username='weblogic',password=pPassword
)
nmStart(pServerName)
print "Successfully started the server using NM"
sys.exit(0)
except Exception, err:
sys.stderr.write('Caught exception trying to start with NM: %s\n' % str(err))
sys.exit(1)
Here is a script for restarting a node-managed server. Call it “restart_wls.py”.
# first agument: the domain name
# second argument: the weblogic user password for that domain
# third argument: the weblogic server name
# e.g. java weblogic.WLST restart_wls.py etaxTrain mypassword EtaxTrainServer
import sys
32
pDomainName = sys.argv[1]
pPassword = sys.argv[2]
pServerName = sys.argv[3]

# First try to restart the server with node manager


try:

nmConnect(domainName=pDomainName,username='weblogic',password=pPassword
)
nmKill(pServerName)
nmStart(pServerName)
except Exception, err:
sys.stderr.write('Caught exception trying to restart with NM: %s\n' % str(err))
sys.exit(1)

print "Successfully restarted the server using NM"


And finally a Windows batch script for convenient wrapping around the above scripts:
rem 1st argument: weblogic home directory (quoted if contains spaces!)
rem 2nd argument: WLST script to run
rem remaining arguments: passed to WLST script
call %~1\bin\setDomainEnv.cmd
popd

shift
set params=%1
:loop
shift
if [%1]==[] goto afterloop
set params=%params% %1
goto loop
:afterloop

java weblogic.WLST %params%

Monitoring a Node-Managed Weblogic Server Process with Jconsole


When the Weblogic Server is set up to be managed by Node Manager installed as a service it
is not considered a “local process” by Jconsole, so it needs to be used a bit differently. With
this method the process should be monitorable from any machine.
Start jconsole from the command line from the JAVA_HOME/bin folder with the following
command (all one line!):
jconsole -J-
Djava.class.path=JAVA_HOME\lib\jconsole.jar;JAVA_HOME\lib\tools.jar;MIDDLE
WARE_HOME\wlserver_10.3\server\lib\wljmxclient.jar -J-
Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
Then choose “remote process” and use the following URI:

33
service:jmx:iiop://HOSTNAME:PORT/jndi/weblogic.management.mbeanservers.runti
me
For the username and password, use “weblogic” and the password you chose on installation.

34
Step 9: Deploying eTax from an EAR File
There are three deployment file types, but that they are identical in every single way except in
the URL context root that they generate.
 EtaxProd-Deployment.ear will lead to a URL that looks like: http://host:port/etax
 EtaxQa-Deployment.ear will lead to a URL that looks like: http://host:port/etaxQa
 EtaxTrain-Deployment.ear will lead to a URL that looks like:
http://host:port/etaxTrain
Therefore you only need to decide what you want the URL to look like in order to decide
which EAR file to use.
Note that you‟ll need access not only to the Console but probably to the host machine‟s file
system to perform the deployment: the EAR file must be located in a directory that can be
“seen” from the machine on which the Weblogic Server is running.
1. Log into the Console with the “weblogic” user.
2. Click on the link for “Deployments”.
3. If it‟s a production installation of Weblogic, click on the “Lock & Edit” button
to be able to make changes.
4. Check the “Etax-Deployment” entry in the list and then click on the “Stop”
button, confirming if asked.
5. Check the “Etax-Deployment” entry and then click on the “Delete” button.
Confirm if asked.
6. If it‟s a production installation, you‟ll want to “Activate the Changes” now
(top-left corner, “Change Center”).
7. If necessary, click on “Lock & Edit” again and then on the “Install” button.
8. In the next step, called “Locate deployment…”, if the currently displayed path
is the correct one, you can select the radio button next to your EAR file and
click Next. Otherwise, type or past in the path for the directory in which you
put the EAR file and click on “Next”: this will give an error (because you did
not select a deployment), but the list of EAR files in that directory will now be
listed, with radio buttons next to each one, and you can select the correct one
and click on “Next” again.
9. In the next step, choose “Install this deployment as an application” and click
on “Next”.
10. In the “Optional settings” step, change the “Source accessibility” option to
“Copy this application onto every target for me”
11. In the final page, choose “No, I will review the configuration later”, because
actually the configuration will be fine. Click on “Finish”.
12. “Activate Changes” if necessary.
To be sure everything is operational, click again on the link for “Deployments” to get the
deployments list. Make sure that the “Etax-Deployment” entry has “Active” as its state. If it

35
says only “Prepared” or “Installed”, then you have to check the checkbox next to and then on
the “Start” button (with the “…servicing all requests” sub option). Confirm if necessary.

36

You might also like