Friday, April 18

Load Balancer

what is the difference between hardware load balancer and software loadbalancer and which loadbalancer we are using in weblogic?

Mukesh Negi 
HLB's are like Bigip F5, Cisco Ace, Oracle Traffic Director,
Software LB's are like apache, iis, iplanet. 
Depend on architecture combination of both or any one can be used.

Dilruwan Madubashitha 
The difference is the layer that it each works in OSI Reference Model, 
Hardware Load Balancer would either work in Network layer or transport layer.
Software LB will work in application layer.


Why we need to use software load balancer?
Although it is possible to use only the external load balancer's in the architecture, it's highly recommended to include the Web Server and the plug-in. The plug-in contains all the logic for the load balancing, session stickiness, and in particular the clustering fail-over with the transparent connection fail-over. More importantly, the plug-in is needed when setting up the workload management through work managers.
The biggest problem with load balancing is failure mode detection. detecting the failure correctly is the biggest issue, and the plugin gives you flexibility with that as well as session persistence etc. The plugin also gives you the ability to recover sessions in progress when there is a front end Apache to back end Weblogic .
Common design for us is a front end load balancer for the Apache (OHS) servers with the plugin supporting the clustering further on.


How the load balancer(Big IP) gets the requests from users?
How it redirects to Webserver(Apache)? What are the configurations required?

Maheshkumar Subbaiyan 
Its requires many configuration on the bigip like VIP,pool and cookie needs to be created.
1. When the user access the url through a client like browser, it connects to DNS to get the ip of the domain name which should be pointing to a VIP in the bigi
p, then the request comes to bigip based on the ip resolved by the DNS.
2. The VIP forwards that request to one of the available apache server in the pool based on the load balancing algorithm's ( round robin,least connection method ..etc).
3. Then Apache forward that request on the available nodes in the weblogic cluster, then the response will be send back to the apache.
4. Apache will send the response back to BIGIP, then BIGIP will send the response to the client.



Patch

How can we apply patches in weblogic?

  • Shabbeer Shabbu by using smart update tool we can apply the patches
    Shabbeer Shabbu by using server start script we will apply the patches. Download the patch(jar file) follow the below steps.
  • 1)stop your server
  •  2)then take the path of the folder(jar file) and copy it in the classpath of setdomainenv.cmd which is in bea/domain/domain name/setdomainenv.cmd
  • patches are bug fixes for weblogic. If there is a functionality that is not working as it should in the weblogic server.oracle gives u a solution for it.these patched need to applies on the server one by one above mentioned ways.
  •  Sudhesh Pnair ./bsu.sh -prod_dir=/u01/oracle/product/fmw/wlserver_10.3 -patchlist=1V2C -install
  • Sudhesh Pnair you need to unzip the patch to /u01/app/oracle/product/fmw/utils/bsu/cache_dir

  • Shiva Goud we can set call path ./serDomainEnv.sh in doamin/bin or  ./setDomainenv.sh any where in weblogic
    Shiva Goud for patch we have to WL/home/utils/bsu/bsu.sh

  • Parupalli Rajesh we are get the support from the oracle team then we get the one random number form the orcale team by useing the that random number we download from the oracle site particular pateches down load and run the bsu.sh file it located in WL_HOME/utils/Directory

Thursday, April 17

Sun JDK vs JRockit


Sun JDK uses interpreter (Interpreter and JIT in previous releases) – In this mechanism, the byte code is read and the translated into machine language, but these results are not saved in the memory. So every time even if the same method is run again and again, the JVM has to translate the code into machine language. This means machine code will not be reusable as it is not saved anywhere in the memory.
Oracle JRockit uses only JIT compiler (Just In Time) – JIT mechanism means, once a method is run, the byte code is translated to machine language and this is saved in the memory. This means if the method is run again, there is no need for translation and the machine code is reused.
Because of the interpreter mechanism used by sun jdk, the start up time for the server is faster because it does not have to save the machine code in memory. Once the translation is done for a method, it moves to the other one. Where as oracle JRockit saves the code, which is why start up takes longer. For the same reason, oracle JRockit uses more memory than sun jdk.
In the long run, JRockit gives a slightly better performance as compared to sun jdk.
Oracle JRockit optimizes the code. It identifies the HOT SPOTS which means the methods that are being run more often. These methods are then queued up for optimization. This code is then optimized which improves performance.

How Weblogic Starts??


There is a startup script startWeblogic.sh under ${DOMAINHOME}. This script calls another startWebLogic.sh under ${DOMAINHOME}/bin. Under ${DOMAINHOME}/bin, there are also other configuration scripts setDomainEnv.sh, startManagedWebLogic.sh, etc. Commonly we will call startWebLogic.sh in DOMAINHOME to start the WLS admin server.
Startup then proceeds with these steps:
The DOMAINHOME environment variable is set.
The script calls ${DOMAINHOME}/bin/startWebLogic.sh.
${DOMAINHOME}/bin/startWebLogic.sh calls ${DOMAINHOME}/bin/setDomainEnv.sh.
setDomainEnv.sh calls ${WL_HOME}/common/bin/commEnv.sh. commEnv.sh sets a series of common environment variables, none of which are directly related to the particular domain: for example, WL_HOME, JVM memory options, other JVM parameters, and system properties. These variables are set for use by any WebLogic Server domains, as well as system utilities like Node Manager, etc. A particular domain can (and usually does) override these settings, so setting them here may not actually change the settings for your particular domain. It probably will impact the settings for Node Manager, however.
After commEnv.sh is executed, setDomainEnv.sh will set other memory parameters and variables. In fact, the settings from commEnv.sh are overridden here.
After setDomainEnv.sh completes, the system returns to ${DOMAINHOME}/bin/startWebLogic.sh, organizes the parameters, and calls java to start up the JVM and start WebLogic Server.
If we want to change the default memory parameters, the best location is in startWebLogic.sh or setDomainEnv. For example, in setDomainEnv.sh, modify the WLS_MEM_ARGS_32BIT from “-Xms512m -Xmx512m” to “-Xms1024m -Xmx1024m”

What is the difference between Process and Thread?


A process can contain multiple threads. In most multithreading operating systems, a process gets its own memory address space; a thread doesn't. Threads typically share the heap belonging to their parent process. For instance, a JVM runs in a single process in the host O/S. Threads in the JVM share the heap belonging to that process; that's why several threads may access the same object. Typically, even though they share a common heap, threads have their own stack space. This is how one thread's invocation of a method is kept separate from another's

Setting up Watches and Notifications in Weblogic Server


As any IT system administrator knows, it’s crucial to get informed in time of events and certain metrics levels occurring in the systems that you are responsible for. It’s the same with any Fusion Middleware platform, and this kind of functionality is covered by both the Enterprise Manager Grid Control, but also by the Weblogic Server itself. So if you are only using the Weblogic Administration console for monitoring your Weblogic platform, you can still set up alerts to inform you on the state of your system. This post will cover such a setup that will send email notifications to the administrators, although SNMP traps, JMX, and JMS are also supported.

To set up your email alerts you will need to cover these main steps:

    In our specific case of email notifications, you need to set up a JavaMailSession object, which will actually be used by the Notifications to send the alerts through the specified email server;
    Set up a diagnostic module and define any metrics that you would like to collect;
    Define the Watches you are interested in – this is the situation that you want to trigger your alert. It can be a certain message in the log files, or a certain value of a collected metric, or a certain event occurring in the system.
    Define the Notifications you would like to receive and associate the Watch to a Notification;

In the below example, we will set up alerts on the state of the Weblogic Managed Server, so the admin will get a notification when a server is not in the RUNNING state.

1. Set up the Mail Session object.

Note that the JavaMailSession itself does not offer email server capabilities, but it only provides the JavaMail API so that applications can send and receive email from an already existing server.

a) Click “Lock & Edit” to acquire a configuration lock

b) Expand Services -> Mail Sessions and click “New” to create a new Java Mail Session object

c) Provide Name, JNDI Name and JavaMail Properties as follow:

Name – WLSAlertsMailSession

JNDI Name – WLSAlertsMailSession

(You may enter whatever value here, but it’s best to keep the same value for the two names)

JavaMail Properties:

mail.debug=”true” – not mandatory, but recommended should you want to troubleshoot why your alerts are not getting through

mail.smtp.port=25

mail.smtp.from=”soa_admin@example.com”

mail.smtp.host=email.server.example.com

d) Click Next to target the mail session to a server (either Managed or AdminServer) and click finish. You need to do this so that the MailSession is exposed on the servers JNDI tree.

e) Activate the changes by clicking “Activate Changes”.

You can actually test that your JavaMail properties are correct and that you can send email messages via the email server specified by following the steps described in this post: Email Test

2. Set up a Diagnostic Module and define a metric of interest as a Collected Metric.

a) Expand Diagnostics -> Diagnostics Modules and click “New” to create a new diagnostics module. Provide a name and description.

Name – DiagModuleWLDF

Description – This is a WLDF module for testing email notifications

b) Select the newly created module and select “Targets” tab. Select the appropriate server for target as before

c) Click “Save” and “Activate

d) Click “Lock & Edit” to acquire a new configuration lock

e) Click on the “Collected Metrics” tab and click “New

f) Select “ServerRuntime” and click “Next

g) Select “ServerRuntimeMBean” from the dropdown

h) From the list of collected attributes select “State” and move it in the “Chosen” category;  
    Click “Next

i) From the instances list select the servers you would like to be informed about by selecting an
   instances and moving it to the “Chosen” category

j) Click “Finish

k) Click “Save” and “Activate

Notice that this metric is collected at a configurable interval, by default 300000ms

3. Set up a new Watch rule

a) Click “Lock & Edit” to acquire a configuration lock

b) Navigate to the diagnostic module created above (DiagModuleWLDF) and select the “Watches and Notifications” tab and “Watches” sub-tab (if not already selected)

c) Click “New” to create a new Watch. Provide the name and select the type as “Collected Metrics”. Also make sure the Watch is enabled.

Name – ServerStateWatch

d) Click “Next

e) Click “Add Expressions

f) Ensure that “ServerRuntime” is selected and click “Next

g) From the dropdown, select “ServerRuntimeMBean” again. The click “Next

h) Select the instance for the appropriate server from the list for “Instance” and click “Next

i) For “Message Attribute” select “State”, “!=” for “Operator” and type “RUNNING” (all capital letters) for “Value”. Click “Finish” the Watch

j) Activate the changes

This Watch will now be triggered every time the server state is other than RUNNING. Please note that this is dependent on the Collected Metric’s sampling period as well.

4. Setting up the Notification and associating it with a certain Watch

a) Click “Lock & Edit” to acquire a configuration lock

b) Navigate to the diagnostic module created above and select the “Watches and Notifications” tab and “Notification” sub-tab

c) Click “New” to create a new Notification

d) Select “SMTP (E-Mail) for Type and click “Next

e) Provide a name – ServerStateNotification. The notification must be enabled, of course. Click “Next”.

f) Configure the following properties for the “Config Notification – SMTP Properties” page

g) Mail Session Name – WLSAlertsMailSession

h) E-Mail Recipients – admin@example.com

i) Click “Finish”.

j) Activate the changes

To associate the watch and the notification:

a) Click “Lock & Edit” to acquire a configuration lock

b) Navigate to the diagnostic module created above (DiagModuleWLDF) and select the “Watches and Notifications” tab and “Watches” sub-tab (if not already selected)

c) Select the watch you created earlier – ServerStateWatch

d) Select the “Notifications” tab and move the “ServerStateNotification” from Available to Chosen

e) Click “Save

f) Select the “Alarms” tab and select “Use an automatic reset alarm”. Set the “Automatic reset period” so that you don’t get spammed with alerts email and click “Save”.

g) Click “Activate Changes

And that’s it. Next time one of your servers is in a state other than RUNNING (and is picked up by the collected metric based on the sampled period), you will receive an email in the form of:



Of course, both the Subject and the Body of the mail can be customized in the Administration console, in the notification section.

Thanks to Lam Diengdoh

HTTP tunneling

Lam Diengdoh If you want to use HTTP tunneling (wrap every message in HTTP to get through a firewall), you need to add TunnelingEnabled="true" into your &lr;ver> definition in the config.xml file or check the appropriate box on the console. Then use a URL like http://localhost:7001 instead of t3://localhost:7001 for Context.PROVIDER_URL when getting your InitialContext. If you want HTTP tunneling with SSL, use https://localhost:7002 (where https uses HTTP tunneling with SSL and 7002 is the secure port that you configured). You will pay a performance penalty for doing this, so only use tunneling it if you really need to (i.e., need to go through a firewall)

Session Replication

1. Session Replication is nothing but having the user sessions on two location for high availability

So when the session gets created on one server which is called primary then it will get copied to other server which is called secondary,the cookie will have the details about both the primary and secondary session server details,if something happens to primary server then the user requests will be forwarded to secondary server which will become primary and it will copy the session some new secondary server in the cluster.

Sessions replication can be done using memory,file system and database, most of the app uses memory which can be access very fastl.

If you want to see whether session replication enabled and which replication is being used by the app,u need to check the weblogic.xml file of the application.

for example if you see the below line

'<'replicate-if-clustered'>'true'<'replicate-if-clustered'>'
 - this means in-memory replication is enabled if the application is deployed on a cluster.



  • Vinod Kumar In-Memory Replication:
    Here more than one Managed server in a cluster of Domain keep the http session details of a particular browser connection.


    Primary server process the request and choose other server (randomly or based upon settings) to keep the backup of http session details
    ( Replication).

    So, the secondary server will only keep the backup, not process the request. The info of (Replication) will be sent back to browser (cookies). In case, the primary server goes down, the LB ( Load balancer) will direct the secondary server ,based upon cookies to process the request from the point where primary server stopped. It is called In-Memory Replication.


  • Vinod Kumar DB-based Replication:
    Instead of storing http session backup in other managed server , it can be stored in DB. Now, Load Balancer can direct any available server to continue the request, if primary server goes down.
    It is called DB based Replica
    tion.
    It is gives better availability as it will work even if secondary server goes down , as any server can process the request. But it is much slower than In-Memory replication.

Wednesday, April 16

thread dump

Sravana Kumar Pasupula TD will write in stdout.logs, if you want to write perticilar path five your path it willl write those TD's in to that path.. 
EX: kill -3 pid >> /tmp/td.logs

what is T3 protocol in weblogic?

T3 is a proprietary communication protocol being used by WLS to handle data traffic between java to java applications or JVM to JVM
WLS has a mechanism to keep track of JVMs with which it is connected and always creates just one connection to the connected JVM.
These connected JVMs could be server JVM to server JVM or client JVM to server JVM.

For example, if a Java client accesses JSP page  and a JDBC connection pool on WebLogic Server, a single network connection is established between the WebLogic Server JVM and the client JVM. This eliminates the need of creating multiple connections and managing them.T3 protocol also does multiplexing data packets invisibly on the single connection

  • Rajasekhar Reddy Naredla Weblogic's implementationof the RMI specification uses a
    proprietary wire-protocol known as T3. javasoft's reference
    implementation of RMI uses a proprietary protocol callrd

    JRMP. weblogic developed T3 because they needed a
    scalable,efficient protocol for building enterprise-class
    destributed object systems with java.
  • Ravikumar Reddy we can say internal communication between both admin server ,managed servers the T3 protocol will take care.

  • Lam Diengdoh T3 is the protocol used to transport information between WebLogic servers and other types of Java programs. WebLogic keeps track of every Java virtual machine connected to the application. To carry traffic to the Java virtual machine, WebLogic creates a single T3 connection. This type of connection maximizes efficiency by eliminating multiple protocols used to communicate between networks, thereby using fewer operating system resources. The protocol used for the T3 connection also enhances efficiency and minimizes packet sizes, increasing the speed of the delivery method.

  • Arawind Pavirala In WebLogic T3 is one solution that offers fast and reliable management of different online applications.

  • Rajesh KM in which scenarios we will prefer to use t3 protocol?

  • Lam Diengdoh when u'd use WLST, t3 or t3s is used to connect to your Weblogic instances.

  • Naga Venkata Prasad All the communication between WebLogic Admin Server And Managed server happens using t3 protocol only. T3Protocol is a BEA proprietorial ProtocolT3 is an efficient protocol for Java-to-Java applications because it avoids unnecessary network connection events and uses fewer OS resources. The protocol also has internal enhancements that minimize packet sizes.