Zero Downtime: Restart Admin Server from Admin Console / Rolling Restart of Servers or Cluster (WebLogic 12.2.1)

Before WebLogic 12.2.1 I was often asked if there is any OOTB restart of the admin server, especially from the admin console. Now with WLS 12.2.1 it can be done easily. Also of course you rolling restart a set of servers, a cluster or two, or whole domain!

  • Admin Server has to be assigned to a machine
  • Admin Server has to be started under nodemanager

Goto DOMAIN / ZDT Control / Domain | Cluster | Servers, chose what you would like to rolling restart, then click on Patch.

Select Rolling Restart.

rollingrestart

Oracle Service Bus 12.2.1 JVM Settings: PermSize, Heap, Non-Heap, and ResourceManagement

Oracle Service Bus comes with JVM settings that cause questions to some customers. This posting provides answers to the most common questions I discussed in workshops or received so far.

Warning about PermSize Option

Question 1: “I see the following warning:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=512m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0

Does that mean that Oracle generates the startup scripts with wrong JVM flags?”

Answer: With Oracle JVM 8 the permanent space was removed. Not having a perm space was a JRockit “feature” that has been ported over to the Oracle JVM. The warnings of course are harmless. Startup scripts for WebLogic only domains are generated correctly for WebLogic 12.2.1. So Oracle needs to change this for OSB domains and they know about it.

Heap Size

Question 2: “How big is Oracle Service Bus now? I used to be able to create and run a cluster on my laptop with earlier versions but now I run into resource problems.”

Answer: Default startup parameters are: -Xms1024m -Xmx2048m, i.e. minimum heap size is 1 GB, maximum heap size is 2 GB. Hence you should expect your process size to be larger than 1 GB right from the start.

Screen Shot 2016-02-17 at 13.27.49 Screen Shot 2016-02-17 at 13.29.38

Roughly speaking after starting up a single OSB instance (everything hosted on the admin server), you should expect more than 400 Mb of heap used. Have a look at the screenshot above. The last drop in the first screenshot was caused by an external garbage collection request (I did it manually). In addition there is more than 500 Mb of non-heap used (100 Mb code cache and 400 Mb meta space, GC of course does not affect this area). This shows that 1GB as a minimum setting makes sense.

JVM ResourceManagement Flag

Question 3: “I see the following warning

<Feb 17, 2016 9:45:56 AM CET> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
Should I enable -XX:+ResourceManagement? Will it help to improve OSB 12c performance?"

Answer: You probably have read announcements that emphasize that OSB 12.2.1 is running on top of WebLogic 12.2.1 and WebLogic 12.2.1 supports a number of exciting new features. Nothing wrong with that, kind of marketing logic though.

It is important to understand that Oracle Service Bus 12.2.1 (and other up stack 12c products such as Oracle SOA Suite, Oracle BPM etc.) doesn’t use yet some really cool WebLogic 12.2.1 features such as domain partitioning or elastic cluster.

In short: Oracle JVM 8 resource management is used as a commercial feature together with G1 garbage collector to track JVM resource usage on the JVM level per partition. Based on the collected data about memory, file and thread usage WebLogic can then react and ensure that a WebLogic partition within one domain doesn’t steal too many resources from another partition. It’s important to understand that the magic (the reaction) happens in WebLogic and it’s based on the data provided by the JVM.

So will the -XX:+ResourceManagement setting improve OSB 12.2.1 performance? I’d say no. It will only have benefits when used with partions which are so far not supported by OSB 12.2.1.

 

 

Using HTTP instead of T3 for WebLogic Scripting Tool (WLST)

A friend of mine asked why the WLST connection from the Jython based scripting tool is only working with t3. IMHO using t3 for WLST is not a big deal since it is a WebLogic tool talking to WebLogic itself, and t3 was built and optimised for that.

You might want to replace t3 with HTTP anyway, e.g. for one the following reasons:

– for the sake of standards, you want to use as many standard protocols as possible. t3 is WebLogic vendor specific.

– you might have problems with t3 when connecting through firewalls.

 

Easy Solution

Here is the good news. Unknown to many, WLST does work with HTTP if you enable tunneling for the Admin server ( Admin Server / Protocols / General ).

Screen Shot 2015-03-02 at 10.24.50

then it’ possible to use HTTP for WLST:

wls:/offline> connect('weblogic','welcome1','http://localhost:7001')
Connecting to http://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "simon".
Warning: An insecure protocol was used to connect to the 
server. To ensure on-the-wire security, the SSL port or 
Admin port should be used instead.

Using a Network Channel

Alternatively if you want to separate the admin traffic but not use SSL (which would be enforced e.g. by using the administration port feature of WebLogic), you could create a network channel under Admin Server / Protocols / Channels for the t3 protocol, e.g. on port 8888 and enable “Tunneling” for that channel. Note that http is already enabled for the channel but this is not enough, you must enable tunneling.

Screen Shot 2015-03-02 at 10.15.29

 

Administration Port

The third and most secure possibility of course is using tunneling in combination with the administration port.

 

Comments:

– You do not need the administration port for using WLST with HTTP.

– It’s not required to change WLST from t3 to HTTP. This posting only shows how it can be done if one of the reasons above apply to you.

– Changing other clients from t3 to IIOP or so, e.g. JMS clients or standalone Java clients using RMI typically has more implications which are not discussed here.

 

More?

If you want to learn more about the basics WebLogic scripting tool I recommend to start with the following web cast.

New RESTful Management API in WebLogic 12.1.3

What you should know:

WebLogic 12.1.3 comes with a new implementation of the RESTful management interface.

Why RESTful?

RESTful interfaces are interesting because they …
– can be used from any language (UNIX curl, Python, Java, you name it …)
– are leight-weight. All you send is an URL using http (and possibly some JSON data)
– are leight-weight on the client side. No JVM is required, unlike let’s say JMX.
– can easily be used across firewalls because the underlying protocol is http.

What is new?

Unlike previous versions of the management interface, WebLogic 12.1.3 provides a technically better implementation for RESTful management, since the interface…
– incorperates versioning
– uses canonical URLs
– uses the well-known http verbs GET (to retrieve information. e.g about a configured data sources), POST (to create e.g. a new data source), OPTIONS (to create a JSON data structure used as a template for create a new datasource), DEL (to delete a datasource).
– returns RESTful URLs in the response.

What is missing?

Currently there is no support for JMS, Workmangers, etc. Since there is no generic way of accessing MBean attributes in WebLogic’s implementation of the RESTful management interface you have to wait for Oracle to implement support for those ressources.

Gossip is spreading that the missing ressources will be included in WebLogic 12.2.1.

More?

more information can be found in the Oracle documentation. There are also some web casts available on the WebLogic Book Youtube channel.

Even More?

I recorded a 2 minute tech-tip for OTN. Previously I explained how the open source Jolokia alternative can be used together with WebLogic.

 

WebLogic with Docker in the Cloud

docker

Docker has been without any doubt the most hyped technology this summer. Apart from incrementally and quickly creating light-weight containers that can be hooked up together it seems to become the de-facto standard for spinning up instances locally and in the cloud. In the past there was no real compatibility between cloud providers on an OS/instance-level and also import/export features were “demanding” at best.

Linux containers for clean sandboxing do exist since much longer, e.g. Google is starting over 2 billion Linux containers every week. With Docker there is an open source based de-facto standard now that customers want to use (honestly, few people looked into lxc and kernel namespaces before Docker had it’s appearance)

Docker and WebLogic?

Oracle WebLogic Server currently does not officially support WebLogic running Docker, yet there is a github project to start with created by Bruno Borges. This project contains the Dockerfile with all necessary WLST-scripts to create a Docker container running WebLogic.

Screen Shot 2014-09-21 at 12.19.11

You can run Docker itself in Oracle Enterprise Linux like in most other Linux distributions such as CentOS, Ubuntu etc. Docker containers always run Linux; e.g. you could have WebLogic running on Ubuntu in a Docker container which is running on CentOS.

Docker Hub Registry

The Docker hub registry is best known as a public registry for Docker images to start with but it can be used to store private images as well.

The Docker Registry contains base Docker images for Java, Ubuntu etc., yet there are no official images from Oracle at the moment. Let’s hope that Oracle will not repeat the rather sad story of poor support for Oracle product AMIs for Amazon Cloud.

Public Clouds can either deploy Docker containers directly from github by creating a container on the fly based on a Dockerfile on github, or by accessing an Docker image stored in the Docker registry. I will demonstrate below how to deploy WebLogic as Docker container straight from the Docker registry.

https://hub.docker.com

Clouds: Amazon, Google, …

Amazon Beanstalk, same as the Google Cloud, support Docker containers as well! So you can dockerize your application (including WebLogic) and run the same Docker image on the cloud. To the best of my knowledge there is currently no information available if Oracle has plans to support Docker in the Oracle cloud.

AWS Beanstalk Cloud

HowTo Run Your WebLogic in a Docker Container on Amazon Beanstalk

The following web cast gives a brief overview of the steps involved. It’s not intended as a A-Z tutorial, rather a quick recording to illustrate the point saving you from dozens of boring screen shots. I am using CentOS 7 to run Docker and create the local Docker container.

The following steps are shown:

  1. Create a running Docker container with WebLogic
  2. Create a new image based on the container
  3. Upload the image to Docker hub
  4. Create the Amazon Beanstalk JSON file for running a Docker container
  5. Create an AWS Beanstalk environment that runs the image from Docker hub
  6. To prove that 1. to 5. are working run a demo app in the cloud

 

If you want to know more, I recommend to get a good book about Clouds, and WebLogic, read Bruno Borges blog entry, the Docker documentation, and the AWS Beanstalk documentation.

Oracle supports the licensing of certain AWS/EC2 instances, also different versions of Oracle Database are available at the Amazon cloud, so ask your Oracle sales rep about the licensing with Docker and Beanstalk.

Enjoy!

Update

I just learned that this posting with the web cast made into the Docker Weekly. Cool, thanks!

Update 2

Soon there will be Microsoft in the boat as well. So Amazon, Google and Microsoft amongst others will support Docker containers. I am curious to see what this will mean for Oracle’s own cloud offering.