Weblogic Server Class Notes
Weblogic Server Class Notes
Weblogic Server Class Notes
=======
Application Server
====================
Websphere,JBOSS,Weblogic,Glassfish,wildfly etc.
Why Weblogic
=============
1)We can use SOA,OBIEE,OIM/OAM,EBS12,OEM13c etc. with weblogic
2)In 12c we can create multiple tenants/partitions in one domain
3)Weblogic 12c we can also run over Docer Donatiners,Private Clouds, Publiuc clouds
etc.
4)can easily create and maintain multiple domain
5)Powerfull clustering methodology to balance the load on server instance.
6)Most things are OOBX so very less configurations are required.
7)Very stable and resilient [ie.. can easily be recovered]
8)Easy to configure access level using security relams.
---->History Of Weblogic
===============================
-->In 1995 Paul Ambrose, Bob Pasker, Carl Resnikoff founded weblogic inc.
-->In 1998 BEA System acuired weblogic inc.
--->in 2008 oracle corp. acquired BEA System
------->Weblogic Versions
============================
Weblogic Tengah ---> 1997
Weblogic 3.0 ---->1998
Weblogic 4.0 -->1999
Weblogic 5.1 --->2000
Weblogic Server 6.0 -->2001
Weblogic Server 10.0 --->2007
*Weblogic VS Websphere
========================
Weblogic start up faster in prod compared to Websphere
Weblogic console is more user friendly
*Weblogic vs JBOSS
====================
-->Weblogic is by oracle but JBOSS is from Redhat
-->JBOSS is open source but weblogic is not
-->Weblogic can easily handle multiple request say > 3000 without fail but JBOSS
can't
-->Weblogic has commercial support but JBOSS yet to release 100% commercial
support.
-->In weblogic JMS CLustering Present but not in JBOSS.
-->Weblogic provides multiple way to deploy application.
Day 2
=========
Q)Which is the correct Weblogic server distribution version to download if you want
to install Weblogic server 12c to run in
64 bit mode,on a 64 bit Linux machine?
a)Linux x86 with 64 bit JVM
b)Zip distribution for Linux
c)Linux x86 with 32 bit JVM
d)Generic distribution
e)Network Installer
Installation
=============
Pre requisite
----------------
Create oracle user account , then start installation.
-->yum install oracle-rdbms-server-12cR1-preinstall -y
1)JDK 1.8.0_51
2)Weblogic 12.2.1.0
JDK
-----
installation location: /usr/java/jdk
Weblogic 12.2.1.0
-------------------
-->su -
-->mkdir -p /u01/app/oracle/product/middleware
--->unzip the weblogic installation file
--->java -jar fmw_12.2.1.0.0_wls.jar
-->Inventory location: /u01/app/oraInventory
os group : oinstall
-->Oracle Home : /u01/app/oracle/product/middleware
Day 3
======
Creating Domain
----------------
export MW_HOME=/u01/app/oracle/product/middleware
export WL_HOME=/u01/app/oracle/product/wlserver
export DOMAIN_HOME=/u01/app/oracle/product/middleware/user_projects/domains/
iam_domain1
cd $MW_HOME/oracle_common/common/bin
./config.sh
--->Note:
Q)Where we put weblogic related external libraries needed for application?
-->$DOMAIN_HOME/lib
--->good practice:
--------------
nohup <script> $
-->tail -f nohup.out
Day 4
======
Creating Managed Server
========================
--->goto example.com:7001/console
-->Servers
-->Lock and Edit
-->New
-->Server Name: ms1
Port : 8001
-->Activate Changes
-->cd $DOMAIN_HOME/bin
-->./startManagedWeblogic.sh ms1 example.com:7001
Boot.properties
================
cd $DOMAIN_HOME/servers/ms1
mkdir -p security
cd security
vi boot.properties
-->username=weblogic
-->password=Oracle123
Node Manager
=============
-->using node manager we can start/stop managed server from weblogic console.
-->Node manager is machine specific.
-->Shutdown Managed server
-----------------------
*Editing NodeManager.properties
-----------------------------------
cd $DOMAIN_HOME/nodemanager
vi nodemanager.properties
-->SecureListener=false
Day 5
======
Day 6
==========
Q)Which three scenarios are true about domain
a)Domain can be created using configuration wizard
b)Domain can be created using WLST
c)Domain configuration files are located in Weblogic Home Directory
d)Domain can be created based on a domain template
[1z0-599]
ANS:ABD
2)created oraInst.loc
[root@example /]# vi /etc/oraInst.loc
[root@example /]# chown oracle:oinstall /etc/oraInst.loc
-----------------------------------------------------------------------------------
---------------------------------------------------------------
[ENGINE]
[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/u01/app/oracle/product/middleware
#Set this variable value to the Installation Type selected. e.g. Fusion Middleware
Infrastructure, Fusion Middleware Infrastructure With Examples.
INSTALL_TYPE=WebLogic Server
#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration
Manager configuration provide empty string for user name.
MYORACLESUPPORT_USERNAME=
#Set this to true if you wish to decline the security updates. Setting this to true
and providing empty string for My Oracle Support username will ignore the Oracle
Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true
#Type String (URL format) Indicates the OCM Repeater URL which should be of the
format [scheme[Http/Https]]://[repeater host]:[repeater port]
COLLECTOR_SUPPORTHUB_URL=
-----------------------------------------------------------------------------------
------------------------------------------------------------------
--------------------------------------
cd $MW_HOME/oracle_common/common/bin
./pack.sh -managed=true
-domain=/u01/app/oracle/product/middleware/user_projects/domains/iam_domain1 -
template=/home/oracle/iam_domain1.jar -template_name="iam_domain1"
--->Clusters
==============
-->Cluster is a group of members[managed servers] that appears to be one, to the
end user.
-->Cluster started from Weblogic 6 onwards.
Why Cluster
=============
1)Load Balancing :
-----------------
Load must be balanced among the members of cluster.
We use Round Robin Algo to load balancing load, which distributes or circulates
load equally to all servers.
2)High Avavilibility:
--------------------
at any given point of time i have a member who can serve the request.
3)Failover :
-------------
If one member in the cluster is not responding, the request moves to next
available member.
4)Scalability :
----------------
adding or removing member to the cluster.
Types of Cluster
=================
1)Vertical Cluster
2)Horizontal Cluster [used in real time]
Day 7
=======
Q)Which feature is enabled when you start Weblogic Server with the DserverType=wlx
option?
a)JDBC
b)JCA [Java EE Conector Architecture]
c)JMS
d)EJB
e)Java EE
Ans:a)
Note:
When we start a weblogic server instance, all services are started including
-->EJB
-->JMS
-->Connector
-->Clustering
-->Deployment
--->Mode of Communication
1)Unicast : one to one communication
2)Multicast : one to many communication
-->Dynamic Cluster
-----------------
-->When the load increases on a node/cluster, it will automatically creates new
managed server there.
-->Max no of supported managed server in dynamic cluster=8
Weblogic Day 8
==============
Deployment
--------------
-->Deployment Descriptor
[annotation based programming]
-->Deployment Plan:
--->Deployment States
3)PREPARED -->
6)RETIRED -->
Homogeous Deployment?
-->When we deploy an app to a cluster, by default the deployment is targeted to all
cluster members, this is called homogeneous deployment.
WLSDM Console
==============
Day 10
========
Weblogic Logging
------------------
logging
--------
-->Trace your total application and generate some message.
like warning message,normal info ,error message,exception message, FATAL message.
We need those message in a single place to analyse and correct the problem of our
application.
-->To perform logging we need some some tools, they are called logging framework.
1)Core Core Java provided java.util.logginf package
2)Log4j
3)Common logging
4)LogBook
5)Logback
-->Advantage of logging
----------------------
1)Identifying problem which are hidden
2)Easy and fast debugging
3)Log Maintaince [History]
4)Cost and Time saving.
-->Features of Log4j
------------------------
1)Multiple appender or destination are possible in log4j.
say : console aapender
file appender
both
2)log4j is able to display logging message with calssification
like WARN,DEBUG,ERROR,FATAL,INFO ... as per the level object.
3)Log4j is allowing layout to format the logging messages as per requirement
4)Log4j is having Object renders inorder to get logging messages in text form, html
form, xml form etc...
-->log4j Architecture
------------------
Log level
----------
ALL>TRACE>DEBUG>INFO>WARN>ERROR>FATAL>OFF
-->Each weblogic server ie.. Admin Server, Managed Server maintain there own log.
eg: AdminServer.log,ms1.log
-->Since it's not possible to go and collect log in each server, hecne weblogic
provides a common log file,
where all servers ie.. Admin Server, ms1,ms2 etc.. logs are captured, it's
called domain log.
eg: iam_doamin1.log
loc: $DOMAIN_HOME/servers/AdminServer/logs/
-->Weblogic Server logging Architecture
---------------------------------------
--->Weblogic Classes
-----------------
1)Weblogic.i18n.logging.NonCatalogLogger
----------------------------------------------
This class add logger error to weblogic server.
methods : alert(),error(),info(),notice(),warning()
2)weblogic.i18n.logging.serverities
-------------------------------------
3)com.bea.logging.BaseLogRecord
--------------------------------
-->Provide data about the log.
method: getId(),getLogMessage(),getServerity()
loc:$MW_HOME/wlserver/modules/com.bea.core.logging
Day 11
---------
JDBC Basic Components
======================
1)Driver:
----------
To convert Java calls to DB specific call and vice versa.
2)Connection
--------------
To reach DB , some road must be required, that road is connection.
3)Statement Object
-------------------
To send our sql quries to DB
and
to bring the results from DB to Java App.
4)ResultSet
-------------
By using statement object, i had send my sql queries to DB,
DB engine will execute sql queries and result it will place inside
a box, that box is called resultset.
-->import java.sql.*
1)Class.forName("oracle.jdbc.OracleDriver");
2)Connection con=DriverManager.getConnection(url,username,pass);
3)Statement st=con.createStatement();
4)Resultset rs=st.executeQuery("select * from emp");
5)while(rs.next())
{
sout(rs.getInt(1))+rs.getString(2)+rs.getInt(3)
}
6)con.close()
--->Types of Driver
----------------------
1)Type-1 Driver / Bridge Driver / JDBC-ODBC Driver
-->sun microsystem had created type-1 driver in form of
sun.jdbc.odbc.JdbcOdbcDriver
Data source
------------
-->By default in development env : 15 connection obj
in production env : 25 connection obj.
-->Data Source Types:
1)Generic
2)Multi
3)Gridlink
4)Universal Connection Pool [added 12.2.1]
-->It gives connection object to every partition in the domain.
5)Proxy Data store
-->It's act a proxy for real data source.
Day 13
=======
Q)Ways to get Connection Object?
-->There are 2 ways to get connection object
1)DriverManager.getConnection(jdbcUrl,username,password)
2)DataSource.getConnection()
-->DataSource ds=ctx.lookup("jdbc/ds1");
-->ds.getConnection()
-->Transaction Management
----------------------
-->Process of combining all realted operations into a single unit and executing on
the rule "either all or none",
is called Transaction Managment.
eg:
Fund Transfer
-------------
1)debit money from sender's account
2)credit money to reciver's account
-->Types of Transacation
1)Local : here all operation will be performed on same database
2)Global : here all operation are performed on different databases.
-------------------JDBC API-----------------
JMS
---------------------
Q)An application is using WebLogic JMS Store and forward messages from a local JMS
queue a remote
WebLogic JMS destination. You need to determine if the messages are being sent from
the local Weblogic Server.
Where do you find information and metrics about Store and Forward components in the
WebLogic Admin Console?
A. JMS Persistent Store
B. JMS Server
C. JMS Distributed Destination
D. JMS Store and Forward
E. Automatic Service Migration
[1z0-599]
Ans : JMS Persistent Store
P2P Model
==========
-->In this model a sender posts messages to a particular queue and a reciver reads
message from queue.
-->Here the sender knows the destination of the message and post the message
directly to reciver's
queue.
--->Feature:
a)Only one consumer gets the message.
Pub-Sub Model
===============
-->It supports publishing messages to a particular message topic.
-->Subscriber may register interest in recieving messages on a particular message
topic.
-->In this model neither the publisher nor the subscribers knows about each other.
----Q&A----
Q)What is Pinned Service?
Ans: In a production environment, an application is generally deployed on a cluster
on many WebLogic Managed Server.
In this case the application is running on each Managed Server of the cluster.
When a Managed Server goes down, the others take the tasks of the one which is
no longer running.
All is ok for the users.
Sometimes we need a service to run on ONLY ONE Managed Server.
This kind of services are named "pinned services" because the services are
pinned to a particular Managed Server.
Note: JMS messaging bridge uses a Java EE Connector Architecture (JCA) resource
adapter
to communicate with source and target destinations.
Performance Tunning
====================
Xms --> is minimum amount of memory needed by an application to startup or boot
Xmx -->max amount of memory that application utilise to serve the request.
HeapDump
=========
-->It tells memory of the objects
-->It's like snapshot of heap memory
-->It's shows application memory consumption.
Realm :
-------
-->Realm divides users into various groups.
-->Realm is collection users,group,Roles&Policies,Providers etc.
-->We can create multiple realm in weblogic, but at a time only 1 will be active.
-->Realm actually used to protect weblogic resource.
Components of Realms
---------------------
1)User : It's an entity that authenticates himself in realm to access to resources.
2)Groups : It's a collection of users have something in common.
eg: Adminstrator: Full acess of the weblogic domain
Operators : start/stop the server
Deployer : deploy and update the application
Monitor : Read only access to domain
AppTester:test the application
3)Security Polcies
4)Security Provider : Security provider use to authenticate user froma particular
backend like OUD,AD etc.
In 12 C we have 19 different security Providers.
The default provider of weblogic is 'DefaultAuthenticator' to
authenticate it's users with
internal LDAP.
It's also called 'Weblogic Authentication Provider'.
Control Flags/Criteria
=======================
1)REQUIRED
------------
Means in order to make whole Authentication Chain Successful, this module is also
required.
Performance Tunning
---------------------
-->Types of Patch
-------------------
1)Interim [Customer Specific]
-------------------------------
Patches to fix a particular problem in the code.
This patch is for customer who can't wait for next patchset or product update.
2)Bundle Patch
----------------
It's for security and vurnability fixes.
--->Patch Artifacts
-------------------
a)Application: JARs,WARs,EARs
b)Utilities : files that have no run time dependency like config.sh, clone.
Here you no need to start the server
c)Composites:
d)Components:
e)Datbase Schema Updates
------------------Patch Tools---------------------
Opatch : 12c onward -->To apply , rollback, and maintain patch in ORACLE_HOME
BSU/BEA Smart Update : 11g
PSA(Patch Set Assistent) : To patch database schema
Manual : copy of files, deployment etc.
Upgradation to 14c
-------------------
-->Note:shutdown all the servers.
Upcoming requirements
-----------------------
OBI
Webcenter
FMW
SOA
OID