Saturday, September 14, 2013

Weblogic training

BEA WebLogic Server 8.1 System Administration

Instructor: brad.little@bea.com

Day 1

Handout materials:
3 CDs (windows product, class notes, reference guide)
2 textbooks
1 lab book
Define J2EE, Model-view-controller, contrast with .net, web and ejb container
A JSP is mingled html and java. It is a special instance of a servlet. Generally used for the view.
Scripting language WLST is Jython (pure java Python) that talks to the management beans that control the weblogic server. Not part of the distribution, it must be downloaded from dev2dev. Everything done through the admin console can be done through the command line or through WLST.
  • Lab to install weblogic
Two kinds of logs: server and domain. Domain log is a subset of what is in each server log. For us, it should be the place to see what is happening on both servers in the cluster instead of having to look in both reedi and rufus.
Each message in the log has a number that can be looked up in edocs.bea.com.
  • Lab to set up domain
  • Lab to start up weblogic and view the admin console
The admin console needs to be up in order to boot a managed server, but the admin server can be down and the managed servers will continue to work.
Each weblogic server should have between 1.5 to 2gb of RAM in production.
  • Lab to set up machines and servers

Day 2

Lecture on JNDI. JNDI is ephemeral. It only exists when the machine is running.
How do you query JNDI?
through the admin console > View JNDI tree
through the command line with the LIST command
JDBC lecture. Driver types. Connection pools. There is a separate JDBC log, if JDBC logging has been turned on. The logging should be done only when debugging because the overhead is high.
  • Lab creating JMS and JDBC services
types of applications and their related configuration files
  • webapps (war)
web.xml
weblogic.xml
  • EJB apps (jar)
ejb-jar.xml
weblogic-ejb-jar.xml
wls-rdbms-cmp-jar.xml (optional, only used when container-managed persistent beans are used)
wls-rdbms-cmr-jar.xml (optional)
  • enterprise apps (ear)
application.xml
weblogic-application.xml
commandline tool for deploying:
java weblogic.Deployer -adminurl -name -source -targets -deploy -redeploy -listapps -listtask
virtual hosts
  • Lab deploying web apps

Day 3

Lecture on EJB applications
There are 4 kinds of EJBs and each type has its own container:
  • Stateless session (simple, fast method)
  • Stateful session (shopping cart)
  • Entity (represents persisted data)
  • Message driven
Weblogic builder is a gui xml-editor for the config files.
When you deploy an app, a hidden folder is created .donotdelete01 that may need to be deleted if you really want to redeploy that app in a completely clean environment.
Lecture on EAR applications (enterprise, collection of other apps)
  • Lab deploying EJBs, EARs
Lecture on transactions (JTA)
Lecture on security
  • Lab creating a security realm
Lecture on SSL
keytool commandline utility
  1. generate a self-signed digital certificate
  2. create a Certificate Signing Request CSR --> creates a PEM file
  3. import the certificate reply from the CA --> sends back a PEM file
  • Lab setting up SSL
WLST script tool. Download from dev2dev.bea.com. Search for WLSTScriptGenerator to find the tool on an employee blog.
If we install a daemon called NodeManager we could use the admin gui to start up weblogic on the cluster, or have it restart them automatically when they go down.
  • Lab using nodemanager goes horribly wrong, no one can complete it: bad certificate
WL8 nodemanager uses 2-way SSL so it tries to verify the hostname. In WL9, it uses 1-way SSL. The hostname that it verifies against is the hostname that was present when the product was installed.
The workaround for the certificate error is to turn off host name verification (host name verification: none) for each managed server under the advanced options for Configuration > Keystores & SSL. That enabled nodemanager to work.
Installed SP5. Tried to install SP5 for 8.1 Server, but it complained that I had more functionality than just the server, so I had to install SP5 for 8.1 Platform. That worked, but it was a lot more than just putting a jar on the classpath. It looked like hundreds of files were changed. This command on /opt/bea:
[root@StudentA11 bea]# find . -mtime -1 -type f | wc
  13811   13815 1236795

Day 4

Managed server independence. You can boot a server without the admin server being up. You have to copy the config.xml to msi-config.xml and push it to each server. In WLS8.1 there is no failover for admin servers, but you can have a warm standby.
  • Lab cluster failover test
Startup and shutdown classes
you can register java classes to run as part of the startup or shutdown of the app server

Day 5

Lecture on performance testing strategies
open source load generation tools
Apache JMeter, Grinder, OpenSTA, Dieseltest
Several mbeans contain useful metric info
starting the sun jvm with -hotspot allows it to dynamically optimize the bytecode
If you allocate too much memory to a jvm, it can make garbage collection run slower and make the app stall
for best performance, set min and max memory for the jvm to the same value. the growing and shrinking of the jvm has overhead.
start with -verbosegc on the commandline. this will include in stdout information about the garbage collection. It should take less than a second. If GC takes longer than 3 seconds, then reduce the heap size to make GC happen more often and thus have GC do less work each time.
can turn on generational GC (NewSize) must be using hotspot. Creates a nursery in the heap where partial GCs run more frequently. Assumes most objects are short-lived.
JRockit, only supported on Intel. Beta support for solaris.
Locate the bottleneck: CPU, IO, DB.
Network tune: set tcp_time_wait_interval from 240 to 60 on solaris
execute thread pool is set to 25 in production mode and 15 on development
native IO socket readers are much faster than pure java threads. So check the box that says enable native IO.
25 to 65 is optimal for Execute threads.
A stuck thread cannot be released without rebooting the jvm. When all the threads in the server are stuck, the server's health is flagged as critical. Nodemanager can be set to automatically restart a server that is critical.
Lecture on object pooling, passivation, activation
WLST interactive mode is like having an ftp client that connects to the configuration files of the weblogic server and lets you cd around and change settings.

WLS supports snmp. It has an agent only on the admin server, but it is not active by default. MIB reference is on edocs. The agent does trapping and polling, but not setting.

No comments:

Post a Comment