Showing posts with label WebLogic. Show all posts
Showing posts with label WebLogic. Show all posts

Saturday, May 25, 2024

Ansible automation for WebLogic - Part 3 installation of WebLogic 12.2.1.3.0 quick

As part of "Ansible automation for WebLogic" series - in this post we are going to install the WebLogic 12.2.1.3.0 quick installer. There is very interesting research on how and when to use ansible modules for WebLogic. This is true weekend I set my time to have how this ansible automation works for WebLogic installation task, serious focused on this task.

Prerequisites
We have already seen in the earlier posts [if not visited yet please do visit] following links:
  1. Java Installation using ansible playbook
  2. WebLogic installer unarchive copy response file, oraInst.loc file to remote node
Writing Playbook with command
In this post, I've explored on the below mentioned best suitable ansible modules
  1. command module
  2. pause module
The command module is better one,  I've choosen after trying with shell module.
Installing WebLogic is a single command that need to executed on the remote node.  As we already copied the WebLogic installer and response file, oraInst.loc to /tmp folder of remote nodes, which can be used by command. To give more generic automation solution we need to use the variables in the playbook.

The pause module will pause the playbook execution flow. To install WebLogic it requires some amount of time to complete the execution task of the command, and we need to wait till that so pause after install command is best option to use.

Ansible playbook executes command module to install WebLogic


There are some interesting sections in the playbook that we are going to use in this example post containing  :
  1. vars
  2. debug module
Ansible allows us to use vars with in the playbook and also we can define in separate file, then its reference file can be included in the playbook. There can be global variables which can be reusable in multiple playbooks depends on the roles that requires. We will discuss more on roles in the next post.

When some of the tasks in ansible modules are played then what happened we don't know. To get the insight on that we have debug moduleoption.  When debug module used we need to use the printing option with msg and the register variable to send the result or output to stdout. This stdout is raw string of JSON so that we can use the play.

Ansible playbook is so simple to design and develop code as we are seeing them since last two previous blog posts. If the playbook have a var multiple times same value required to define under vars and use them in multiple lines of a task. Here we will be using java_dir, mw_dir, mw_installer and oracle_home.

vi  wls_install.yml
---
- hosts: appservers
  remote_user: vagrant
  vars:
     java_dir: /home/vagrant/jdk1.8.0_172
     mw_dir: /tmp
     mw_installer: fmw_12.2.1.3.0_wls_quick.jar
     oracle_home: /home/vagrant/fmw
  tasks:
   - name: install WebLogic
     command: "{{ java_dir }}/bin/java -jar  {{ mw_dir }}/{{ mw_installer }} -ignoreSysPrereqs -force -novalidation ORACLE_HOME={{ oracle_home }} -responseFile {{ mw_dir }}/wls_install.rsp -invPtrLoc {{ mw_dir }}/oraInst.loc"
     register: command_result
   - debug:  msg={{ command_result.stdout.split('\n')[:-1]}}
   - name: Wait for installation complete
     pause:
        minutes: 3


The execution of WebLogic installation by playbook is simple as shown below:

vagrant@docking ~/wls-auto $ ansible-playbook -i ~/hosts wls_install.yml



Part 2 of screen shot
ansibible-playbook execution for WebLogic installation



Your valuable feedback is most important to us to improve our next articles. So request you to use the comment box.

Please write your comments and likes about this ansible series. Stay tuned to "WebLogic Tricks & Tips" for another wonderful automation soon.

Reference links
  1. debug module
  2. pause module
  3. command module

Friday, September 9, 2022

Single click installation of WebLogic 14c|12c in Linux

Current IT Trending towards devOps automation in every Software product development. I am also part of  this devOps culture. I had a thought that, How much I can leverage my regular task by making simple shell script for Installation task.

As every Oracle WebLogic system administrator would pass through this situation but only few of them who have "AUTOMATION IN MINDS" could attempt to resolve this with a nicely blended Shell script.

Here I would like to target two types of installations with two different Shell scripts:

  1. Fusion Middleware 12.2.1.2.0 WebLogic Server installation
  2. Fusion Middleware 12.2.1.2.0 Infrastructure installation


Objective of this script is to get single hit would do multiple tasks such as:

  • JAVA installation
  • setting the JAVA_HOME in shell profile
  • using Java run the WebLogic installer in silent mode

YOu can use the same logic in WebLogic 14c the latest version as well.
Assumptions:

  • Downloaded Software will be stored in common shared location. 
  • Installation of software such as JDK, WebLogic will be same mount point and directory structure
  • Linux Operating System user have bash shell!   
Knowledge base:


Auto Install pre-requisite for Application - Script 
wls.cfg
JDK_INSTALLER=jdk-8u*-linux-x64.tar.gz
JDK_INSTALLER_PATH=/u01/app/software/jdk
INSTAL_LOC=/u01/app/oracle
WLS_INSTALLER=fmw_12.*_wls.jar
WLS_INSTALLER_PATH=/u01/app/software/FMW_wls
SILENT_DIR=/u01/app/software/silent

Script name: install_wls.sh
#!/bin/bash
# This script will be installing JDK
# installing WebLogic in silent mode
#
#- Info 
#-    Author   : Pavan Devarakonda
#-    Date     : 30-March-2017
##############################################

. wls.cfg
echo "installing JDK ${JDK_INSTALLER}"
cd $INSTAL_LOC
tar -zxvf $JDK_INSTALLER_PATH/$JDK_INSTALLER

ls -l
echo confirm JDK installation
cd $INSTAL_LOC/jdk*

JAVA_HOME=`pwd`
echo "export JAVA_HOME=$JAVA_HOME">>$HOME/.bashrc
echo "export PATH=$JAVA_HOME/bin:$PATH">>$HOME/.bashrc

. $HOME/.bashrc

echo "Check for java version"
java -version

echo Installing WebLogic now...
echo .

java -jar $WLS_INSTALLER_PATH/$WLS_INSTALLER -silent -invPtrLoc $SILENT_DIR/oraInst.loc -responseFile $SILENT_DIR/wls_install.rsp

echo "WebLogic $WLS_INSTALLER installed successfully...."
echo .
echo setting MW_HOME ...
MW_HOME=`grep ORACLE_HOME $SILENT_DIR/wls_install.rsp |cut -d'=' -f2`
echo "export MW_HOME=$MW_HOME">>$HOME/.bashrc
echo "export WL_HOME=$MW_HOME/wlserver">>$HOME/.bashrc
echo "alias wlst=$MW_HOME/oracle_common/common/bin/wlst.sh">>$HOME/.bashrc
. $HOME/.bashrc
echo "Use wlst command to test everything working..."

Oracle Fusion Middleware Infrastructure installation Shell Script

Here the script is little bit improved the installer normally coming as zip file which can be uncompressed by script and also silent file will be using
INSTALL_TYPE=Fusion Middleware Infrastructure With Examples
Now the script for Infrastructure will be look like this.
#!/bin/bash
# This script will be installing JDK
# installing WebLogic in silent mode
#
JDK_INSTALLER=jdk-8u121-linux-x64.tar.gz
JDK_INSTALLER_PATH=/u01/app/software/jdk
INSTAL_LOC=/u01/app/oracle

echo "installing JDK ${JDK_INSTALLER}"
cd $INSTAL_LOC
tar -zxvf $JDK_INSTALLER_PATH/$JDK_INSTALLER

ls -l
echo confirm JDK installation
cd $INSTAL_LOC/jdk*

JAVA_HOME=`pwd`
echo "export JAVA_HOME=$JAVA_HOME">>$HOME/.bashrc
echo "export PATH=$JAVA_HOME/bin:$PATH">>$HOME/.bashrc

. $HOME/.bashrc

echo "Check for java version"
java -version

echo Installing WebLogic now...
echo .

WLS_INSTALLER=fmw_12.2.1.2.0_infrastructure_Disk1_1of1.zip
WLS_INSTALLER_PATH=/u01/app/software/FMW_wls
cd $WLS_INSTALLER_PATH
unzip $WLS_INSTALLER_PATH/$WLS_INSTALLER

INFRA_JAR=fmw_12.2.1.2.0_infrastructure.jar

SILENT_DIR=/u01/app/software/silent

java -jar $WLS_INSTALLER_PATH/$INFRA_JAR -silent -invPtrLoc $SILENT_DIR/oraInst.loc -responseFile $SILENT_DIR/fmw12.2.1_infra_install.rsp

echo "FMW Infrastructure $WLS_INSTALLER installed successfully...."
echo .
echo setting MW_HOME ...
MW_HOME=`grep ORACLE_HOME $SILENT_DIR/$SILENT_DIR/fmw12.2.1_infra_install.rsp |cut -d'=' -f2`
echo "export MW_HOME=$MW_HOME">>$HOME/.bashrc
echo "export WL_HOME=$MW_HOME/wlserver">>$HOME/.bashrc
echo "alias wlst=$MW_HOME/oracle_common/common/bin/wlst.sh">>$HOME/.bashrc
. $HOME/.bashrc
echo "Use wlst command to test everything working..."


Note: If you are running other than Linux platform you can use ksh shell .profile.

keep in touch with your comment and suggestions for improve more effective way.

cheers!!!

Saturday, July 3, 2021

Learning 2: MiniKube Kubernetes Cluster WebLogic Application deployment

Hey Middleware Expert, I am going to discuss the Kubernetes cluster deployment. This is most important for the topic in Kubernetes in pod management with replicas and deployment for application Lifecycle management.

MiniKube having built-in Kubernetes Dashboard. This post is a continuation of  our  previous post "Learning  1. Minikube  Kubernetes Cluster  Running in the Oracle VirtualBox".

Create a new deployment using a Kubernetes dashboard

To create the new deployment in the minikube Kubernetes dashboard click on the 'deployments' under the workload. On the top right select +CREATE  and there are :

  1. CREATE FROM TEXT INPUT
  2. CREATE FROM FILE
  3. CREATE AN APP
Select the third option

Minikube dash board deployment of WebLogic 
For the App Name, we’ll call this deployment 'wls-app'. Container image for WebLogic 12c we will take ismaleiva90/weblogic12:latest. Here I've used docker pull for this image once it is available in the local docker registry then we can proceed further above step.

To make a deployment complete we need to expose the container port to the host port.


kubectl expose deployment wls-app --port=7001 --type=NodePort

service "wls-app" exposed

kubectl get pods -o wide

kubectl get pods with wide option

kubectl get svc
Listing Kubernetes services with kubectl

It might take few secs to bring up the container in the pod. We can see that the pod is now Running and we will now be able to curl it/browse it:

minikube service wls-app


WebLogic Admin console running in a Kubernetes - local Kube

6. If you want to delete the WebLogic application service wls-app and delete its deployment
kubectl delete service wls-app
service "wls-app" deleted
kubectl delete deployment wls-app
deployment "wls-app" deleted



Sunday, May 13, 2018

Learning 1. Minikube Kubernetes Cluster Running in the Oracle VirtualBox

My learning Kubernetes Cluster is an essential skill for SRE DevOps Engineers on any Cloud platforms. My learning capability keep growing with this daily dose!! :) I like the statement given in one of the author -Kubernetes is like captain of ship where multiple container clusters carried in the huge ship. This is a first step that will help you to enter into world of Kubernetes cluster technologies. Kubernetes is also known as k8s, this is quite young technology in the DevOps stack. Here we have two options to work-out on Learning Kubernetes:
  1. Kubernetes installing in master-slave in multiple nodes
  2. Minikube running a locally single node
The first option will be used in real-time production environments, and the other is used for learning purposes. Here I've selected the second option for running WebLogic on Minikube.


Benefits of Kubernetes cluster

There are many benefits but in brief for WebLogic  

  • Kubernetes is the core component in Cloud Native Engineering platforms
  • It Will be extensively used in aws, azur and BMC (Spartacus)
  • Ready to plug in real time web applications for easy deploy and scale
Running WebLogic server on Minikube Kubernetes cluster

In this article, I will be discussing 
  1. How to prepare the VirtualBox for Minikube?
  2. Installation of Docker CE in Ubuntu
  3. Installation of Minikube in Ubuntu
  4. Deploy the minikube kubernetes dashboard
  5. Running WebLogic container in a pod

Prerequisites for Minikube in Ubuntu Virtual Box               

Install the VirtualBox if it was not latest and try to launch the new Ubuntu virtual disk image. I preferred to use Ubuntu 16.04 Xenial or Ubuntu 17.10 Artful are best suites for this experiment. Select the virtual disk from  uncompressed folder. Assigned the 4Gig Ram and 2 CPUs to the VirtualBox. Start the Ubuntu 16.04 VirtualBox image, after login osboxes user. Install the Guest Additions then try to configure shared folder where you wish to store the software that shares between host machine with a guest machine. Enable the shared clipboard -> bidirectional, and also drag and drop -> bidirectional.

1. Enter into a terminal use sudo -i to switch to the root user, update the apt package index with:

 apt-get update 

2. Install packages to allow apt to use a repository over HTTPS:
 
apt-get install \
                                apt-transport-https \
                                ca-certificates \
                                curl \
                                software-properties-common

3. Add Docker’s official GPG key:
 
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 

4. Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

 apt-key fingerprint 0EBFCD88
docker fingerprint validation in Ubuntu

Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below. 5. Adding repositories for the latest stable version

 add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) \
stable"

Note: Starting with Docker 17.06, stable releases are also pushed to the edge and test repositories. 6. Update the apt package index.

 apt-get update

7.Install the latest version of Docker CE, or go to the next step to install a specific version:

 apt-get install docker-ce 

8. login through root check below command if running or not:
                docker version
                docker info                
 

Install minikube 

Minikube is recommended for development environments or to experience the Kubernetes in a quick way in a local VM/Laptop. Docker swarm is also a similar orchestration tool as Kubernetes. Kubernetes is open-source. Kubernetes is also supports non-docker containers such as rocket containers.

1. Firstly, download minukube and kubectl

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Now kubectl download and move to /usr/local/bin
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && cp kubectl /usr/local/bin 

2. Set the MINIKUBE Env Variables
                export MINIKUBE_WANTUPDATENOTIFICATION=false
                export MINIKUBE_WANTREPORTERRORPROMPT=false
                export MINIKUBE_HOME=$HOME
                export CHANGE_MINIKUBE_NONE_USER=true
                mkdir $HOME/.kube || true
                touch $HOME/.kube/config
                export KUBECONFIG=$HOME/.kube/config

3. Lets start the Minikube with the none driver there are multiple drivers available. Each driver works according the platform where your host machine running. So using for this experiment vm-driver=none is best suitable because it is a Virtualization of Containerization.

minikube start --vm-driver=none

We can use kubectl commands which are able to interact with Minikube cluster. If you get any issue related to certs. The fix will be simply stop the minikube and start it.

Understanding kubernetes Head Node


 Minikube internally runs Kubernetes Head node or some other says that Master node, the whole control will be operated from this node only, which contains all components:

  1. etcd
  2. scheduler
  3. controller
  4. apiserver
  5. addons-manager
All the component required for Head node we can see in the namespace list:
kubectl get po --all-namespaces

Head node work with the set of namespaces

Kubelet is a Kubernetes Node agent which will be always running and monitoring all the components. If anything goes down it will brings up that component service automatically.

The etcd is capable to store the key, values which are used in the Kubernetes cluster. It is developed and inspired from coreos.

Every Kubernetes master will have scheduler, that is actually used to triggered as per the start time value, by default it will be 0.

Kuberneretes master have controller which internally talks to docker environment and a kubelet. Kubelet is like running an agent for Kubernetes master.The internal communication will be using RSA certs.

The apiserver in the master will be serving the client requests and they will be routed to the available Nodes. A Node may have multiple pods of same category.

Think Differently

Using minikube dashboard to deploy WebLogic Console application where many thousands of examples are there to tell hello-world app but say think differently web application that is WebLogic administration console as app to deploy as service and name it as wls-app.

Minikube Kubernetes will be providing us a nice UI dashboard to show the workload on the cluster. What all the status of pods, services, and also allows use to create and manage the deployments etc.

Let's start the dashboard

minikube dashboard

when you run the above command it will try to launch the browser and start the dashboard
Minikube dashboard

Finally stopping the minikube
minikube stop
Stopping local Kubernetes cluster...
Machine stopped.

Next post 


Learning 2: MiniKube Kubernetes Cluster WebLogic Application deployment

Hoping you like this experiment trick. please share this with your techie friends, share your comments.

Saturday, May 5, 2018

3. Learning How to build Best Docker images?

The containerization concept was available since the 1978s in the UNIX. but the real usage and evaluation started from the year 2014 onward, a small community of docker open-source organizations started to focus on it and developing it.

In the last post, we had the unofficial image then it went up the size up to 3.8 GB. But same logic if we try on Oracle Linux 7-Slim version image it reduced 1 GB!!!

  Use Layered approach for Oracle images  

Most of the developers question how do we deliver it to end-user when you create the containers for WebLogic. The best practice to use the layered approach for WebLogic applications. We have demonstrated with the following layer approach the whole stack is going to break down into two major parts:

  1. Read-only 
  2. Read-write 
The latest image is on top which is only allows you to modify the content. where application jar/war/ear file will be deployed.
The bottom stack will be re-used by multiple developers to build their container and work with no-time spending that's the beauty of this containerization technology.


Please refer to the Oracle White paper.
WebLogic docker image layers


Recently we had a requirement to develop the containers of Oracle SOA. if we take the old stack it is not flexible enough to support the requirements. Always prefer to use the latest installers, Oracle SOA 12c is flexible for supporting Containerization.

Use the yum -y clean

When you install any of the dependent libraries that used for WebLogic or database or SOA software in the container. These libraries first pulled from the repo to a buffer, then installation process happen. Better to clean this junk after installation completed.

Preferable option to use official images
When you search for any image then you will be finding many images which are publicly available. Out of the images list there could be official select that one, which is more reliable than others.

Use Dockerfile to build images

Remember that in Dockerfile every instruction line is going to create a container. Each container will be stored in the docker engine just similar to the SVN repository that have id. To build docker image by writing single RUN command with slash for separating commands for multiple commands to execute on the temporary container.

Use docker-compose instead of lengthy docker run

using docker-compose you will be saving time to write lengthy docker run commands. If you store the run command into composing file you will have more advantages you can build the docker image and also run the image as a container in a single go. You can modify the ports and other values to create more containers.

Multi-purpose of docker-compose commands

Please follow my YouTube Channel. Write your experiences/queries with the docker and docker-compose in the below give comment box. We are happy to help you in containerizing your environments.


References

Oracle WebLogic Server on Docker Containers

Wednesday, April 25, 2018

Ansible automation for WebLogic - Part1 Java Installation

Ansible is a task execution engine. Ansible is designed to work on multiple machines to execute the batch of simple task to scale. Ansible is written in Python language, it uses Python 2.6 above is supported platform as requirement.

No Agents required!

Ansible is simple language that is started as opensource and later it is acquired by Red Hat. The core communication happens with SSH. SSH widely available trusted in all UNIX and Linux systems. Ansible can be run any system as it doesn't relay on central machine.
Ansible automation for Java and WebLogic 12c 

Here my experiment goes with two Ubuntu 14 Trusty Tahr machine. In one machine Ansible will be installed and other machine is used as target node, in real-time scenario the target list can be many hundreds and this has been proven by NASA and other Ansible implements. Using Ansible lots of organizations get into structured and role based automation implementations successful.

For Redhat flavors


The actions that need to executed in remote host machine are called TASK. playbooks are executable batches which are ymal files. Plays are having one or more tasks.   Playbooks can be collections of tasks. Plays are executed top to bottom when it parse the playbook. to work with playbook we must define inventory which we define hosts file.

Defining Inventory in hosts file
This can be placed in user home directory or common location /etc/ansible/hosts. The inventory will be defined with groups such as webapps, appservers, dbservers etc. As we are going to work on WebLogic application server we will define it as appservers group in the host inventory.

Host Inventory defining for ansible

There are many alternative options that shown in the above picture to define the host inventory. We can make grouped and un-grouped host list. Mostly grouped inventory is having more options to define the host list. we can include the list with IP address list or you can use hostnames list as well. While grouping we need to think about the task execution procedure.

Lets create a simple one our WebLogic servers host IP into the appservers as a group the file.could be stored in the $HOME path with the content as follows:

vi hosts
[appservers]
192.168.33.100
192.168.33.102


Setting up Ansible to run with SSH


ssh-keygen -t rsa -b 4096 -C "My ansible key"

ssh-keygen for vagrant user

copy the ssh key

ssh-copy-id -i ~/.ssh/id_rsa.pub vagrant@192.168.33.102



now regular Unix level command try to connect with ssh this should not prompt for password
ssh vagrant@192.168.33.10
ssh connection validation for ansible
eval $(ssh-agent)


ssh-add

lets confirm now with ansible all ssh connections are good to go for ansible play.

ansible -i ~/hosts -m ping all

ansible hosts ping all


Create your first yaml file for ansible play

The playbook is developed with yaml coding to set up couple of plays. Each play contain multiple task, which will tell the Ansible engine.

Ansible Playbook structure


Each task can be developed with module which is a part of core module and we can also create custom modules if required. There 700+ modules are freely available in opensource ansible. Here I am going to use the unarchive core module which requires src, dest values and this sample playbook have only have single play that will install Java that is unarchive the tar.gz file that is availabe in the specified shared location mentioned as src. If you don't have shared drive then ansile should use copy module and then use this task.

vagrant@docking ~/wls_auto $ cat java_install.yml
- hosts: appservers
  remote_user: vagrant
  tasks:
   - name: Unpack archive
     unarchive:
        src: /u01/app/software/jdk/jdk-8u172-linux-x64.tar.gz
        dest: /home/vagrant
        remote_src: yes


Please correct if indentation looks wrong

The execution is as follows:



We will be sharing the part 2 which will be install the WebLogic in the remote machine.

Please let me know you have any new thoughts on automation with Ansible code. This post is beginning.

References:

How to install and configure Ansible on Ubuntu?
Unarchive module sample
How to solve “Permissions 0777 for ‘~/.ssh/id_rsa’ are too open.” ?



Monday, July 24, 2017

2. Writing Dockerfiles to install JDK and WebLogic to create docker images

We have a couple of options to create the docker images. In the last post, we got the docker installed Linux environment available. Now in this post, we will develop the Dockerfile such that it can create an image that can have Java JRE installed and WebLogic 12c installed.

Lets jump on the task where we will prepare, create the Dockerfile and build the image and run the container to check all done successful.

Prepare software installation


Remember that official images always the preferable choice. When you search for docker images from the public repository that is hub.docker.com. We might get a huge list some of them are Automated some of them are not. The only one will be committed as an Official Image. Here selecting an image is also a strategy, logic inside. So carefully proceed further.

We need to install Java Development Kit JDK latest version and WebLogic in silent mode installation.

Step 1: Copy installers to data folder this is my convention I've used
Here few Dockerfile commands

  1. FROM - used to specify the base image
  2. MAINTAINER [depricated]- tell about the author
  3. RUN - executable commands separated by &&
  4. USER - like su command in Linux is used for switch user
  5. ENV - environment variables definitions predefined
  6. ADD - share directories or files
  7. WORKDIR - login is like cd in Linux you perform some of the commands there and then you can use one more time and perform
  8. COPY - copy the files from the host machine to container it is like scp
  9. CMD - Execute command where you can give multiple commands in double quotes
  10. ENTRYPOINT - when the container started immediately this instruction will be executed


Now we are good to go for creating the customized Docker Image using Dockerfile as follows:


# WLS DOCKERFILES PROJECT
# --------------------------
# Pull base image
# ---------------
FROM dnraikes/oraclelinux-7:latest

# Maintainer
# ----------
MAINTAINER Pavan Devarakonda 

RUN mkdir -p /u01 /data && \
    chmod a+xr /u01 && \
    useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \
    chown oracle:oracle -R /u01 && \
    chown oracle:oracle -R /data

USER oracle

ENV PATH=/bin:$PATH

ADD ./data /data
ADD ./silent /u01/silent
ADD  wls_installer.sh /u01/wls_installer.sh

WORKDIR /u01
RUN /u01/wls_installer.sh

I'm just doing this experiment how much size this container would make that really matters.

Step 2: Copy silent folder containing wls_install.rsp, oraInst.loc with appropriate group and inventory location. Ref : Single hit installation of WebLogic 12c on Vagrant box

JDK, WebLogic Installation

Revisiting the last blog post few changes made which will help you to prepare the docker image while it creates the image it will install JDK and WebLogic into the intermediate containers.

#!/bin/bash
# This script will be installing JDK installing WebLogic in silent mode
#
#- Info
#-    Author   : Pavan Devarakonda
#-    Date     : 30-March-2017
##############################################3

JDK_INSTALLER=jdk-8u121-linux-x64.tar.gz
JDK_INSTALLER_PATH=/data
INSTAL_LOC=/u01/oracle

echo "installing JDK ${JDK_INSTALLER}"
cd $INSTAL_LOC
tar -zxvf $JDK_INSTALLER_PATH/$JDK_INSTALLER

ls -l
echo confirm JDK installation
cd $INSTAL_LOC/jdk*

JAVA_HOME=`pwd`
echo "export JAVA_HOME=$JAVA_HOME">>$HOME/.bashrc
echo "export PATH=$JAVA_HOME/bin:$PATH">>$HOME/.bashrc

. $HOME/.bashrc

echo "Check for java version"
java -version

echo Installing WebLogic now...
WLS_INSTALLER=fmw_12.2.1.0.0_wls.jar
WLS_INSTALLER_PATH=/data

SILENT_DIR=/u01/silent

java -jar $WLS_INSTALLER_PATH/$WLS_INSTALLER -silent -invPtrLoc $SILENT_DIR/oraInst.loc -responseFile $SILENT_DIR/wls_install.rsp

echo "WebLogic $WLS_INSTALLER installed successfully...."
echo .
echo setting MW_HOME ...
MW_HOME=`grep ORACLE_HOME $SILENT_DIR/wls_install.rsp |cut -d'=' -f2`
echo "export MW_HOME=$MW_HOME">>$HOME/.bashrc
echo "export WL_HOME=$MW_HOME/wlserver">>$HOME/.bashrc
echo "alias wlst=$MW_HOME/oracle_common/common/bin/wlst.sh">>$HOME/.bashrc
. $HOME/.bashrc

Step 3: Run the docker build as follows:
#!/bin/bash
#

# ################## #
# BUILDING THE IMAGE #
# ################## #
echo "Building image '$IMAGE_NAME' ..."

IMAGE_NAME="wlsimg"
NOCACHE=true

BUILD_START=$(date '+%s')
docker build --force-rm=$NOCACHE --no-cache=$NOCACHE -t $IMAGE_NAME . || {
  echo "There was an error building the image."
  exit 1
}
BUILD_END=$(date '+%s')
BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START`

echo ""

chmod u+x build.sh
./build.sh

After the WebLogic docker image builds completed you can see the following lines at the end:

Successful execution of docker build

The docker image list looks like this, where you can see the build image with the tag mentioned in the above :

WebLogic docker image

Further experimenting on dockerization of WebLogic - Using containers will be posted soon.

Reference:

  1. GitHub link for Oracle-WebLogic docker build

Saturday, July 15, 2017

5. docker-compose for WebLogic cluster deployment

In the earlier post you have seen how to use docker-compose for WebLogic images to build and also run the container with new application deployment. In this post you will be able to see the WebLogic managed servers forms cluster and the application will be deployed on top of it.

Prerequisites

Let me keep the list of prerequisite steps which you can follow my previous blog post or youtube video.

  1.  docker pull oraclelinux:7-slim  
  2. git clone https://github.com/oracle/docker-images.git 
  3. download server-jre1.8 latest version copy to OracleJava/dockerfiles build the image and make it as oracle/serverjre:8
  4. download weblogic 12.2.1.2.0 quick installer which is used for development, it is small in size. image name it as oracle/weblogic:12.2.1.2-developer 
  5.  create new docker images where 12212-domain:latest using WLST and shell script which are available in container scripts. 
  6. create new docker images named as 1221-appdeploy:latest where it uses 12212-domain as base images. 
  7. And also docker pull httpd:2.4 6. download the proxy plugin for 12.2.1.2 create the 1221-webtier:latest [apache with proxy plugin configured]

The power of docker-compose script

Now lets pick the following docker-compose.yml file where it will use two images the two images : 1221-appdeploy, 1221-webtier Using last session created admin container for create managedserver with port change
version: '2'

networks:
  &network wlsnet:
    driver: bridge

services:

  # Deploys the wlsServer with default hostname 'wlsadmin' used by scripts in 1221-domain.
  &adm adminserver:
    image: &i 1221-appdeploy
    container_name: wlsadmin
    ports:
    - "8001:7001"
    networks:
      - *network

  # Deploys a container running a Managed Server and a Node Manager to control MS from wlsServer
  managedserver:
    image: *i
    command: createServer.sh
    networks:
      - *network
    depends_on:
      - *adm

  # Deploys a container running only a node manager. to deploy a managed server here later, use wlsServer Web Console
  nodemanager:
    image: *i
    command: createMachine.sh
    networks:
      - *network
    depends_on:
      - *adm

 # WebTier for load balancing requests to cluster
  webtier:
    image: 1221-webtier
    networks:
      - *network
    ports:
    - "8800:80"
    environment:
      - WEBLOGIC_CLUSTER="managedserver:7001"
    links:
      - managedserver

################ END OF compose file ###############################

Next steps

8. Validate the docker configuration syntax docker-compose config
9. If all good then proceed for the run the containers - wlsadmin, managedserver, nodemanager and webtier docker-compose up
10.  Check the containers logs with container names as argument docker-compose ps docker logs wlscluster_managedserver_1 -f
 11. Expansion of docker containers for clustered Weblogic domain. docker-compose scale managedserver=4


We will be more happy to help you for your dockerization of WebLogic environments.

References:


Sunday, May 21, 2017

1. Learning dockerization for WebLogic on Oracle Linux in Vagrant

Writing this blog post after couple of executions experiments and research on docker. The basic requirement for docker is there must be a Linux/Unix based platform. Here I am creating that one on my Windows host machine, and the guest Ubuntu Trusty64 platform with the help of Vagrant and Oracle Virtualbox provider.

vagrant Ubuntu docker - Oracle Linux images

In this Article I am not dicuss about from the scratch What is docker etc. I'm not talking about Virtualization vs Containerization.
Create testnode1 folder on the Windows machine. I've created on F:\testnode1.

The Vagrantfile to launch Ubuntu Trusty64 Virtual machine is as follows:

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.define "test" do |testnode1|
 testnode1.vm.box = "williamyeh/ubuntu-trusty64-docker"
 testnode1.vm.hostname="testnode1.vybhava.com"
 testnode1.vm.network "private_network", ip: "192.168.33.102"
  end
  config.vm.synced_folder "F:/Softwares", "/u01/app/software"
  config.vm.provider "virtualbox" do |vb|
     vb.memory = "4096"
   end
 end

After Vagrant up looks like this

In the Trusty64 terminal the createuser.sh shell script will be executed first time. Next time onwards it will verify and shows message already executed.

Note that this vagrant box built-in with docker, and when you start the box it will automatically brings up the docker-engine.

How do I know docker installed?


Using docker info you will get to know about the docker version, status and information about daemon how much memory, CPU are allotted for it.

docker info
The docker info command execution


How do I check docker engine running?


Using regular Linux service command will tell about docker engine. Of-course docker info already tells the same in one of the line.

service docker status

Checking docker service status


Lets do dockerization

There are multiple docker commands which help you to create docker images, pull them from the global repository. Docker images will be used to generate docker containers. Here image is like blueprint and the container is like object of the blueprint.

docker search oraclelinux

docker search for oraclelinux image in public registry

Once you found your desired image then you can use pull command on docker engine then docker image will be visible.

docker pull oraclelinux7

docker pull oraclelinux-7
After pull successful your docker images stack will be updated to check use docker images command.

docker images

docker images list including oraclelinux-7
Running docker container
We can run the docker container from the pulled images, here we are interested on oraclelinux-7 image.


 docker run -i -t --name orawls --hostname orawls.vybhava.com dnraikes/oraclelinux-7:latest /bin/bash

Next post on Java WebLogic in docker image

Wednesday, April 1, 2015

WebLogic Wrapper Scripts

Administrators with automation skill would perform than many admins. Requirement makes you to write automation scripts. I was working on Oracle Virtual Box, which is running SSH service. Hence I am able to connected thru PUTTy to the ubuntu Guest Linux server. By making Static IP configuration on the additional network adapter this was happen to possible.

 Everything going good! when I ran the WebLogic server from the PuTTY. It is working until when it is connected and alive. Once I went for break/Lunch the Windows system went to sleep then WebLogic server stopped due to PuTTY session inactive. To avoid this we can use the Wrapper start scripts.

 Idea behind the wrapper script/ psuedo code

  1. Using the startWebLogic.sh script in background using &
  2. use the nohup -- no hungup to run the process even the PuTTY inactive or closed
  3. The log file generated by starting WebLogic server redirected to a separate file.
  4. The Standard error file also merged with standard output log 
  5. Display the tail command after doing the above
  6. Additionally you can add back up of old WebLogic file with a time stamp this can be applicable in Production environments.
Startup Wrapper Scripts

Start WebLogic Admin Server with wrapper script

Here is the nohup usage sample:
$ nohup /domain/path/startscript.sh &

No hangup

The nohup UNIX command only writes to nohup.out if the output is otherwise to the terminal. If you redirect the output of the command somewhere else - including /path/redirect or some casees you can use /dev/null - that's where it goes instead.

nohup startWebLogic.sh >/path/redirect 2>&1   # doesn't create nohup.out

In modern bash and zsh (but not ksh) SHELLs you can shorten that to >&/path/redirect.

You can also use as follows:

nohup startWebLogic.sh >/path/redirect 2>&1&


Applying the above ideas into the wrapper scripts you can write a sample startAdmin.sh script in your WebLogic Domain.

New thoughts implemented that is logs path would be automatically created by the script now. I had this for long time but today 01-April-2015 came to improved version as 0.2 as published now!
#!/bin/bash
# Purpose : WebLogic AdminServer wrapper script which redirects logs to admin.out
# Author : Pavan Devarakonda  ver 0.2
# Category  : WebLogic Best Practices
# Override  : Yes, You can modify LOGDIR, LOGPATH values 

clear
DOMAIN_HOME=${PWD}
SERVER_NAME=`ls $DOMAIN_HOME/servers/|grep -i adm`
echo $SERVER_NAME
LOGDIR=$DOMAIN_HOME/$SERVER_NAME/logs
LOGPATH=$LOGDIR/$SERVER_NAME.log


if [ -d $LOGDIR ]; then
 nohup bash -c "$DOMAIN_HOME/startWebLogic.sh 2>&1 >>$LOGPATH" &
 echo .
 echo "Starting admin server..."
 echo "tail -f $LOGPATH"
 exit 0
else
 echo "Log path doesn't exists... creating directory now!!"
 mkdir -p $LOGDIR
 ./$0
fi 

Similarly you can write the wrapper codes for WebLogic Managed servers, NodeManager start scripts, so that you keep running your WebLogic related services without any hangs :)

 ii. Customized start managed server script

The above wrapper scripts there must inclusion of domain name recommended for non-production or multiple domains running on the same machines. There is a need to specify speparate standard output file path, if it is pre-production or Performance load testing environment you must also include GC logs path. Some of the WebLogic managed servers must include PRE_CLASSPATH that need to be processed before weblogic.jar in the CLASSPATH and some of the library jar files must be processed after the weblogic.jar, set them in a separate directories pre and post. Add them to CLASSPATH and it must be exported before startWebLogic.sh or startManagedWebLogic.sh called.

The following start wrapper script saved as "startms.sh" assuming that you might need few instance specific properties need to refer in startWebLogic.sh script. 


#==================================================
# The managed server name as argument for this script
# File : startms.sh  
# Usage: ./startms.sh mymanaged01  
#====================================================
INSTANCE=$1
export INSTANCE # not mandatory 
SOURCE=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cp $INST_HOME/$INSTANCE/logs/$INSTANCE.out $INST_HOME/$INSTANCE/logs/$INSTANCE.out.bkp
nohup $SOURCE/startManagedWebLogic.sh $INSTANCE >$INST_HOME/$INSTANCE/logs/$INSTANCE.out 2>&1 &
echo tail -f $INST_HOME/$INSTANCE/logs/$INSTANCE.out

Here $INST_HOME is defined in the user profile script.

These customized start scripts for admin server and managed servers. In the script make a copy of the last server instance log to instance.out_bkp. Some times due to some panic situations servers might crashed, after monitoring you found that it happen so restarting server should not loss that lost logs. If you maintain the backup of logs file automatically before starting the instance, then you are saved with that backup log file for further analysis about that crash.

Here in the above script, most of the UNIX/Linux environments it would work fine. Your script could use "nohup" that means no hung up when the remote machine is accessed with tools like SSH/PuTTY.

Some older environments (before WebLogic 12c) using JRockit as Java vendor. Better you include the following lines in the wrapper scripts will run in JRockit JVM.

JAVA_VENDOR="BEA"
export JAVA_VENDOR



If you create this script in development/QA environment same script can be used for UAT/PRE-Production or Production because keeping it more portable and flexible with SDIR (source directory path).

WebLogic NodeManager log generation


Node manager gives standard out file which can be collected by redirecting to a file nm.out.
#!/bin/bash
clear
nohup ./startNodeManager.sh  >> nm.out 2>&1 &
tail -f nm.out

# To run the NodeManger wrapper script give permissions
chmod +x startNM.sh

#Run the NM
./startNM.sh

Keep writing us your comments for betterment in this blog.

Monday, March 24, 2014

Thread Dump Analysis


Dear WebLogic users/Administrator you might already visited many other sites that discussed about - how to take the thread dump. But here I am going to tell you about automation script makes more simplified way of working, with more information - almost 70% on the occasion of STUCK thread Thread dumps will reveals. In case of High CPU utilization situations, which method is badly working.

Step by Step analysis for Thread Dump


Step 1: Automated Thread Dump for WebLogic

Take the Thread dump for a managed server that have issues or slowness or latency etc. You just read the description and start applying to your test environment and then try out on your Live environments. Cheers!
#!/bin/bash

# This script will takes the managed server name as argument and it will work generic to Linux or SunOS or HP-UX.
# The only ps command options varies for each platform
# Kill -3 command used for every 10 seconds of interval. You can increase the number of dumps in the for loop

WL_SERVER=$1
OSENV=`uname`

   case $OSENV in
      Linux)WLSPID=`ps auxww|grep weblogic|grep -v grep|grep $WL_SERVER | awk '{print $2}'`;;
      SunOS)WLSPID=`/usr/ucb/ps -auxww|grep weblogi[c]|grep $WL_SERVER | awk '{print $2}'`;;
      HP-UX)WLSPID=`ps -efx|grep -v grep|grep weblogic|grep $WL_SERVER | awk '{print $2}'`;;
   esac
   if [ ! -z "$WLSPID" ]; then
      for i in 1 2 3 4 5
      do
         echo "Generating thread dump number $i in logs/${WL_SERVER}_stdout.log"
         jstack  $WLSPID >> /log/${WL_SERVER}_stdout.log
         sleep 10
      done
   else
      echo "Error!!! process id not found for $WL_SERVER"
   fi

Step 2: Start analizing Thread dump

Take the sed sword into your hands !! sed UNIX utility will give you the right way of using regular expressions to expose desired outputs. The following is more effective script for you, love it share it :)
# Script Name: ThreadAnalizer.sh
# Description: Pass the threa dump log file name as argument to this script it will show you the required lines that need to see 
# Regular expression pattern is applied for search in the log file.
clear

for i in `egrep 'trying to get lock|waiting to lock' $1 |  sed -n 's/.*[<@]\(.*\)[>[].*/\1/p' | sort | uniq`
do
 # Under that above line you will look thru the log for locked or holding lock
    sed -e '/./{H;$!d;}' -ne 'x;/ locked/{;/'${i}'/p;};/Holding lock/{;/'${i}'/p;}' $1
done
Look for more deeper with the handy utility that uses python. The following script can work to convert the given decimal number to hexadecimal number.
USAGE="Usage: $0 {number}"
if [ ! $# == 1 ]; then
  echo $USAGE
  exit
fi
 
python -c "print hex($1)"
exit 0

The following script can work to convert the given decimal number to hexadecimal number.

If you want to generate a separate thread dump file with prstat, pstack commands output it will be much wise. Everything in single file to analysis at the time of critical situations. Ofcourse it happen only in UNIX environments :).

WebLogic Application performance problems: Diagnosing

The following presentation will take you to understand with a clarity on OOME types and what are all the reasons. It also address the High CPU issues.
Write a comment what do you thing on this issues. Happy trouble shooting!!!

RegEx for WebLogic Admin

Trick on grep


Normally every WebLogic user/Admin knows that "ps -ef|grep java" gives you the WebLogic servers process list in any UNIX or Linux environments. Most of the forums suggesting use "|grep -v" to exclude the "grep line". But, here I don't want to use one more pipe and grep -v option really makes expensive in CPU cycles. Searched for the optimistic solutions and finally found! Two choices using --exclude  and using regex.

The exclude options is not available on all UNIX systems. So I've chosen next option.

How do you avoid the grep line in the grep command output itself?
Here the trick is using the regular expression to workout this requirement. Use your searching pattern any one of the character in [] then it will automatically excludes the grep line from the output. actually it wouldn't get output itself!

bash-2.05$ ps -ef |grep jav[a]
weblogic   950   934  0   Feb 10 ?        0:06 /usr/local/bea/jdk142_11/bin/java -client -Xms32m -Xmx200m -Xverify
:none

Note here I have tried out this trick on Sun Solaris 9 machine. Write your experiments in the comment box, share it!

Saturday, July 13, 2013

starting Managed server in invisible Window

Problem: Closing startWebLogic.cmd execution window - SHUTDOWN server

We were working on Oracle Fusion Middleware environment, where the WLS_FORMS managed server was down. We need to bring it up by starting the server immediately, because it is live we have tried to start with nodemanager. But, it is failed! due to the stdout log rotation failure unable to start the managed server. The servers running on the same Windows machine are well and RUNNING state.

Production environments we cannot keep a server DOWN for longer time. So first we tried with immediate temporary solution is to start the managed server from the domain home we need to keep a CMD window open. If someone logged in and closed the window the server will be down again! In UNIX we have nohup and &(ampersand) to run in the background. Now we need similar solution in Windows platform. After working in Unix platform for many years, felt Windows is hard to us!!! There is always a way for this problem. Solution we identified as below:

Temprory Fix: Start Managed server in background on Windows platform


Let me give you complete walk through for the Windows Shell script as workaround. Usually, we run the below command line for starting the Form server manually.
C:\wls_domains\clstr_dom\bin\startManagedWebLogic.cmd WLS_FORMS

This server status cannot be updated to Nodemanager if it is started manually like above. Same line we tried to set in the below Windows shell but it couldn't work, so alternative idea is 'Create a new CMD file for starting managed server... like for us it is WLS_FORMS File named as startforms.cmd.

Now create the following .VBS file that will help you to run the managed server in background.

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run chr(34) & "C:\wls_domains\classicDomain\bin\startForms.cmd" & Chr(34), 0
Set WshShell = Nothing

Copy the above lines to Notepad and save the file with the .VBS extension. Edit the .BAT file name and path accordingly, and save the file. Double-click the .VBS file to run it.

In the background we were working on alternative, complete fix. The analysis started with why nodemanager could not start the managed server? What NodeManager saying about this issue. The nodemanager.log file in the nodemanager in the WebLogic installation. The standard out file for Forms, WLS_FORMS.out file not able to rename to new WLS_FORMS.out001xx. I have tried same thing at the command line. It is telling that unable to rename the file due to some other process is using the file. Now there is a need to find that what other file uses this standard out file.

Solution: Stdout log file (SERVER_NAME.out) file Rotation

In the Oracle Fusion Middleware environments, if the Stdout file is being accessed by dejvm. Oracle Forms, Reports running environment uses Developer JVM (dejvm) process. In the Unix environment you can easy to identify with 'ps -ef| grep dejvm'. To resolve the above issue, go to the Windows TaskManager find the dejvm process and kill that. Now no process is using the stdout file, now you start the managed server using nodemanager or Weblogic Console.

Little idea about dejvm - The process named dejvm is a process that Oracle Forms uses as the JVM controller. The jvmcontroller.cfg file defines the defult dejvms. Its purpose in life is to be the process which a pool of JVMs are attached so that not all Forms process that need use WLS_FORMS Server JVM. This lowers system resource usage and in effect pools of JVMs.

Thankyou for being with me in this blog post. write your comment or suggest your experiences that adds more.

Sunday, September 12, 2010

X11 Forwarding in SSH for Solaris and Linux

You might be wonder what is fun in this blog looking for X11 forwarding on Solaris 5.10!! You might be excited to see the beauty of colorful Oracle Fusion Middleware WebLogic 11g installation window when you executable binaries (wls1033_solaris32.bin), You might wish to see Oracle WebLogic domain configuration Wizard (config.sh), Oracle WebLogic Domain Template builder(config_builder.sh), BEA Smart Update (bsu.sh) windows or your Oracle Database 11g while you work on a remote UNIX machines.

After spending few hours on the Internet found many blogs written on their experiences, few document on websites, which illustrated about SSH, X11 forwarding in UNIX. I understand that what I need to do? To achieve my objective X11 Forwarding using SSH window, I must have a X emulating software installed on my desktop. you guys have this on your desktop?? If not install Hummingbird Connectivity (Xming is alternative)

My experimenting environment is Solaris 10, Oracle WebLogic, SSH (You can use Putty also), Hummingbird Connectivity (Xming is alternative)

Applicable to:
This you can use for any Java AWT or Swing programs in any UNIX based Operating environment.
You might download free Hummingbird Software also providing evaluation version who want to test their environment.

Here I am sharing with smart guys WLA/DBA my version of brain storming on this. When I first-time tried to invoke X window command it rejected and told as shown below:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

I had updated DISPLAY variable as follows

$ export DISPLAY=localhost:11.0

My first experiment with normal UNIX user
When I executed bsu.sh script I got the following in Normal UNIX user:

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class
sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.awt.X11.XToolkit.(XToolkit.java:89)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.Toolkit$2.run(Toolkit.java:834)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:126)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:130)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1591)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:541)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:581)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1343)
at javax.swing.UIManager.initialize(UIManager.java:1432)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1420)
at javax.swing.UIManager.getDefaults(UIManager.java:660)
at javax.swing.UIManager.put(UIManager.java:989)
at com.bea.plateng.common.ui.gui.GUIHelper.initPLAF(GUIHelper.java:69)
at com.bea.plateng.patch.gui.PatchGUIHelper.startGui(PatchGUIHelper.java:90)
at com.bea.plateng.patch.Patch.main(Patch.java:338)

My UNIX admin buddy told that dear, first try with xclock then go for other, then I thought Ohhh!! that's good idea, let me try that...

$ xclock
bash: xclock: command not found

Hmmmmmmm!!, what is this? Think, Think Think!!!, On a Solaris 5.10 you can find some of the commands in OpenSource folder, Let me try in that path this xclock on the following path.
/usr/openwin/bin/xclock

No luck buddy, same kind of error message as bsu.sh got above.

Now I realized and verified all those PATH, CLASSPATH are pointing to proper JAVA_HOME/bin, lib paths respectively, one of them is misconfigured reset to correct path.

One of Sun blog saying about Updating $Home/.ssh/config file as follows:

Host *
ForwardX11 yes
ForwardAgent no

After doing this I had ran the following:

$ ssh -X user@hostname

This is the command will activallte the X emulation on your UNIX machine with given SSH configuration. Actually it will refer to the default configuration /etc/.ssh/config but when you create new config file on your user home directory it will prefer to execute for your user settings. This command also updates .Xauthority file when you ssh -X command.

Verified every step again finally I got X window for xclock

Hey!! Cheerup on my face!!

Experiment 2: LDAP user logon with assume user name as 'pavanwla', switched to role 'wladmin'. I started trying on it for X11 forwarding. First Let me try, xclock on

-->

[wladmin@hostname~]$ /usr/openwin/bin/xclock
Error: Can't open display:

Ohh its same DISPLAY variable problem right? You remember it!!

[wladmin@hostname~]$ export DISPLAY=localhost:10.0
[wladmin@hostname~]$ echo $DISPLAY
localhost:10.0

Let me try now, what it will say...

[wladmin@hostname~]$ /usr/openwin/bin/xclock
X connection to localhost:10.0 broken (explicit kill or server shutdown)

Oh My Gash!!! what to do now????????????
After a while, I bugged again my buddy Mr. Unix Admin about this. He told that configurations, X emulating authoriy must match ldap user and role. Now my turn, first I tried to get xclock on ldap user, that confirms everything fine at ldap user level. This configuration, Xauthority I can use in role user too, then see what I did:

[wladmin@hostname~]$ scp pavanwla@hostname:/home/pavanwla/.ssh/config .ssh/
[wladmin@hostname~]$scp pavanwla@hostname:/home/pavanwla/.Xauthority .

Started ssh session with ssh -X command.

Finally, the climax came to end, xclock started. ahh!!
Reference:

https://cygwin.com/setup-x86_64.exe
http://sourceforge.net/projects/xming/files/Xming/6.9.0.31/Xming-6-9-0-31-setup.exe/download
http://download.oracle.com/docs/cd/E15051_01/common/smartupdate/guide/quickrefax.html

Blurb about this blog

Blurb about this blog

Essential Middleware Administration takes in-depth look at the fundamental relationship between Middleware and Operating Environment such as Solaris or Linux, HP-UX. Scope of this blog is associated with beginner or an experienced Middleware Team members, Middleware developer, Middleware Architects, you will be able to apply any of these automation scripts which are takeaways, because they are generalized it is like ready to use. Most of the experimented scripts are implemented in production environments.
You have any ideas for Contributing to a Middleware Admin? mail to me wlatechtrainer@gmail.com
QK7QN6U9ZST6