Showing posts with label Weblogic 12c. Show all posts
Showing posts with label Weblogic 12c. Show all posts

Tuesday, 17 April 2018

Oracle WebLogic Server 12c: Creating a Basic Cluster

Oracle WebLogic Server 12c: Creating a Basic Cluster

Creating a Cluster of Existing Servers

To create a cluster of existing managed servers, perform the following steps:

1. If the administration server of the domain is not already running, it needs to be started. To start it, in a Terminal window, navigate to the domain directory, and enter the command:

$ ./startWebLogic.sh



When prompted for a username and password, enter the credentials of the domain administrator.

2. If any of the managed servers of the domain are running, shut them down. One way to do that is by using the administration console. Open a web browser and enter its URL:
http://hostname:port/console

In this tutorial, that is: http://host01.example.com:8001/console

Note: Use the host name and port of the administration server of your domain.

On the Welcome screen, log in using the Username and Password entered to start the administration server.



3. In the administration console, under Domain Structure, expand Environment (by clicking the + sign next to it). Then click Servers.

Under Summary of Servers, click the Control tab.




4. In the Servers table, select the check box for each managed server that is RUNNING. Click Shutdown, and in the drop-down list select Force Shutdown Now.



5. Click Yes to continue.



A message is displayed indicating that the server or servers are being shut down. In a few moments, refresh the browser and ensure the State of all managed servers is SHUTDOWN.

6. Creating a cluster is a change to the domain's configuration, so the configuration must first be locked. In the Change Center, click the Lock & Edit button.



7. In the Domain Structure area, under Environment, click Clusters. Above the Clusters table, click the New button.



8. In the Create a New Cluster screen, for Name enter dizzycluster.

For Messaging Mode select Unicast.

Leave Unicast Broadcast Channel blank.

Then click OK.

Note: Because Unicast is selected, the two Multicast fields are disabled.




A message is displayed indicating the cluster was created successfully.

9. In the Clusters table, click the name of the new cluster, dizzycluster.

In the Settings for dizzycluster, click the Configuration tab, and the Servers subtab.

Then click the Add button.



10. On the Add a Server to Cluster page, ensure that Select an existing server, and add it as a member of this cluster is selected.

Use the drop-down list to select one of the managed servers.

Then click the Finish button.



11. Repeat that process (click the Add button and use the drop-down list) to add the two remaining managed servers to the cluster.



12. In the Change Center click the Activate Changes button.



The message "All changes have been activated. No restarts are necessary." is displayed.

Starting the Clustered Servers

To start the managed servers that are now part of a cluster, perform the following steps:

1. In a new Terminal window, navigate to the domain directory, then cd into the bin subdirectory. Enter the command:

$ ./startManagedWebLogic.sh dizzy1 http://host01.example.com:8001

This runs the script to start the managed server named dizzy1. Also notice the argument that gives the URL of the domain's administration server:
http://host01.example.com:8001.

Note: Use the host name and port of the administration server of your domain.



When prompted for a username and password, enter the credentials of the domain administrator.

2. Watch the messages print out to the Terminal window. At some point, there will be a message indicating the server is listening for communication from the cluster. There will also be a message that the server is waiting to synchronize with the other servers in the cluster. Because the other servers have not started, it cannot synchronize with them yet.



Note: If the managed server's Standard Out Severity Level is not set to Notice or lower, these cluster log messages will not be shown in the Terminal window. Alternatively, use the administration console to view the contents of the server log file.

3. In two other Terminal windows, repeat this process, using the startManagedWebLogic.sh script to start the other two managed servers: dizzy2 and dizzy3.

Once again, watch the messages print out to the Terminal windows or look in the server logs to confirm that the servers joined the cluster successfully.



Note: If the managed server's Standard Out Severity Level is not set to Info or lower, some of these cluster log messages will not be shown in the Terminal window. To change the Standard Out Severity level, in the administration console select the server in the Servers table. In its settings, click the Logging tab, the Generalsubtab. Scroll down and click Advanced. In the Change Center, click Lock & Edit. Use the Severity level drop-down list under Standard out to select Info. Click Save. In the Change Center, click Activate Changes.

Alternatively, use the administration console to view the contents of the server log files.

Monitoring the Cluster

To monitor the cluster by using the WebLogic Server administration console, perform the following steps:

1. Return to the administration console. In Domain Structure, select Environment, then Clusters. In the Clusters table, click the name of the cluster, dizzycluster.

Under the Settings for dizzycluster, click the Monitoring tab.



2. The table under the Summary subtab should indicate that all the three managed servers are currently participating in the cluster. Other cluster information is also displayed. To see even more information in the table, click the link Customize this table and add whatever columns to the table that you find interesting. Then click the Apply button.




Summary

In this tutorial, you learned how to:
Define a new cluster by using the administration console
Add servers to a cluster
Use server log messages to analyze a server's participation in a cluster
Use the administration console to monitor a cluster

Monday, 16 April 2018

Configure WebLogic Server Transactions (JTA) : WebLogic 12c

Configure WebLogic Server Transactions (JTA) : WebLogic 12c

1. To configure Transactions in WebLogic Server : Go to WebLogic Console -> Click Domain -> Configuration and sub tab JTA

2. Various properties defined for JTA in WebLogic Domain are

a) Timeout Seconds : The time Transaction Manager (TM) waits for new transaction to go into prepared state.
b) Abandoned Timeout Seconds : The time Transaction Manager (TM) waits for a transaction to go from prepared to committed state.
c) Max Transactions : The maximum number of simultaneous in-progress transaction allowed on Server.
d) Max Unique Name Statistics : The maximum number of unique transaction names for which statistics will be maintained.
e) Checkpoint Interval Seconds : Frequency at which Transaction Manager (TM) creates a Transaction Log (TLog) and checks to see if old logs can be deleted.








3. During transaction, server writes to binary transaction log called TLog. Each WebLogic Server has transaction log that records information about propagation of transaction though system.

4. If WebLogic Server fails, when Server is re-started, it reads it TLogs and recovers transaction.

5. For transaction recovery service for Servers in cluster, you must store transaction log in shared location or in database so that transaction logs (TLogs) are available to backup server.

6. Monitoring of JTA and JTA logging are defined at Server Level






Friday, 6 April 2018

Script to get the CPU utilization status of any process running on a linux system

Steps to get the CPU utilization status of any process running on a linux system

1.Copy and paste the below code onto the linux server using vi editor


$ cd /tmp/scripts/


$ vi cpuUtilization.sh
#!/bin/sh

var1=`ps -ef | grep Dweblogic.Name | grep Server_1| awk '{print $2}'`

var2=` ps -ef | grep Dweblogic.Name |grep Server_2|awk '{print $2}'`

time=`date +%d-%m-%y-%H:%M:%S`


ps -eLo pid,ppid,tid,pcpu,comm | grep "$var1" > /u01/apps/oracle/Server_CPU_Utilization/Server_1_"$time"

ps -eLo pid,ppid,tid,pcpu,comm | grep "$var2" > /u01/apps/oracle_oc/Server_CPU_Utilization/Server_2_"$time"
2. Now set a cronjob to get the script executed automatically after a specified interval say 5 mins

$ */5,* * * *  /tmp/scripts/cpuUtilization.sh

3. The output of the script would be append to the files at the location

/u01/apps/oracle/Server_CPU_Utilization

Note: Steps to set cronjob “At every 5th minute.”



Script to get alert when response time exceeds the threshold limit using weblogic server access.log

Steps to get mail alert using the weblogic server access.log when response time exceeds the threshold limit

1.Copy and paste the below code onto the weblogic server using vi editor

vi /u01/apps/oracle_oc/user_projects/domains/Domain_Production/responseTimeAlert.sh
----------------------------------------------------------------------
#/bin/sh
dat=`date +"%y-%m-%d"`
dat1=`date +"%H:%M:"`
var=`grep $dat1 /u01/apps/oracle_oc/user_projects/domains/Domain_Production/servers/Managed_Server/logs/access.log | grep "/gb/en.html" | awk '$3>50' > /export/home/weblogic/Scripts/Alert_ResponseTime/Alert_ResponseTime_$dat`

echo $var
if [ -s /export/home/weblogic/Scripts/Alert_ResponseTime/Alert_ResponseTime_$dat ]
then
echo $dat
mailx -s 'The Response time of below given urls is greater than 50 sec' Website.Support@gmail.com <  /export/home/weblogic/Scripts/Alert_ResponseTime/Alert_ResponseTime_$dat
 <fi
------------------------------------------------------------------------

2. Configure the cronjob for the script created

* * * * * /u01/apps/oracle_oc/user_projects/domains/Domain_Production/responseTimeAlert.sh

3. Whenever the response time for any request exceeds 50 sec, a mail would be triggered.

Monday, 2 April 2018

How to Decrypt password of Weblogic 8.1 Admin Console?

Steps to create a script and decrypt the password encrypted(3DES)



1. Copy the password from the config.xml file $BEA_MIDDLEWARE_DOMAIN/user_projects/domains//config/

2. Change the directory in the terminal to the weblogic domain directory/security

"cd $BEA_MIDDLEWARE_DOMAIN/user_projects/domains/
/security/" so as to provide the path of the SerializedSystemIni.dat file

3. Create a java script file using the vi editor command "$vi SsmDecrypt.java" 

Copy and paste the below code 

***************************************************************
import weblogic.security.internal.SerializedSystemIni;
import weblogic.security.internal.*;
import weblogic.security.internal.encryption.*;

public class SsmDecrypt
{
public static EncryptionService es = null;
public static ClearOrEncryptedService ces = null;

public static void main(String args[])
{
String s = null;
if(args.length == 0)
System.out.println("Enter Password");
else
if(args.length == 1)
s = args[0];
else
System.err.println("Usage: java Decrypt [ password ]");
es = SerializedSystemIni.getExistingEncryptionService();
if(es == null)
{
System.err.println("Unable to initialize encryption service");
return;
}
ces = new ClearOrEncryptedService(es);
if(s != null)
System.out.println("\nDecrypted Password is:"+ces.decrypt(s));
}
}
*************************************************************

4. Execute the below command along with the encrypted password

$
java SsmDecrypt <{3DEX}password>
Example

$java SsmDecrypt {3DES}ChApor4ZjYQ=

Output
Decrypted Password is:xxxxxxxx

Sunday, 1 April 2018

How to Decrypt password of Weblogic 11g Admin Console from any path in the terminal?

Steps to create a script and decrypt the password encrypted(AES)


1. Copy the password from the boot.properties file in the path $WLS_MIDDLEWARE_DOMAIN/user_projects/domains/Domain_Name/servers/AdminServer/security/boot.properties

2. Change the directory in the terminal to the weblogic domain directory of which password is to be decrypted

"cd $WLS_MIDDLEWARE_DOMAIN/user_projects/domains/Domain_Name/

3. Create a python script file using the vi editor command "$vi DecryptTest.py" 

Copy and paste the below code 

*********************************************
import os
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService

def decrypt(domainHomeName, encryptedPwd):
    domainHomeAbsolutePath = os.path.abspath(domainHomeName)
    encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHomeAbsolutePath)
    ces = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService)
    clear = ces.decrypt(encryptedPwd)
    print "Decrypted Password:" + clear


try:
    if len(sys.argv) == 3:
        decrypt(sys.argv[1], sys.argv[2])
    else:
        print "INVALID ARGUMENTS"
        print " Usage: java weblogic.WLST DecryptTest.py <{AES}lS2Fkjs0z5pXl9FgAj/hQvmhP59Pdyj27QdWWFWIsPM\=>"
        print " Example:"
        print "java weblogic.WLST DecryptTest.py
<{AES}lS2Fkjs0z5pXl9FgAj/hQvmhP59Pdyj27QdWWFWIsPM\=>"

except:
    print "Unexpected error: ", sys.exc_info()[0]
    dumpStack()
    raise
**************************************************

4. Execute the below command and then enter the encrypted password copied from boot.properties file 

$java weblogic.WLST decrypttest.py <absolute path of Weblogic domain>


Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Output:-
Decrypted Password:xxxxxxxx


How to Decrypt password of Weblogic 11g Admin Console?



Steps to create a script and decrypt the password encrypted(AES)



1. Copy the password from the boot.properties file in the path $WLS_MIDDLEWARE_DOMAIN/user_projects/domains/Domain_Name/servers/AdminServer/security/boot.properties

2. Change the directory in the terminal to the weblogic domain directory/security

"cd $WLS_MIDDLEWARE_DOMAIN/user_projects/domains/Domain_Name
/security/

3. Create a python script file using the vi editor command "$vi DecryptScript.py"

Copy and paste the below code

******************************************

from weblogic.security.internal import *
from weblogic.security.internal.encryption import *

encryptionService = SerializedSystemIni.getEncryptionService(".")
clearOrEncryptService = ClearOrEncryptedService(encryptionService)

passwd = raw_input("Enter encrypted password of one which you wanted to decrypt : ")
plainpwd = passwd.replace("\\", "")

print "Plain Text password is: " + clearOrEncryptService.decrypt(plainpwd)

******************************************
*

4. Execute the below command and then enter the encrypted password copied from boot.properties file

$java weblogic.WLST DecryptScript.py


Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands

Enter encrypted password of one which you wanted to decrypt : {AES}25YwE3caKyHO23Ym6LNNiLTPxKm7V3YhR4uZdzyjboo=

Output:-
Plain Text password is: XXXXXXXXX



All about WebLogic t3 and t3s Protocol

WebLogic's  implementation of the RMI specification uses a proprietary protocol known as T3. You can think of T3 (and secure T3S) as a l...