WebLogic 12.1.3 on CentOS vagrant

This post is related to Weblogic Vagrant from our Oracle Weblogic Administration Training (next batch starts on 8th April, 2017 – Register now ) where we cover Weblogic Installation, configuration, Clustering, Logging, Deployment, JDBC and JMS etc.

WebLogic VagrantThe WebLogic Vagrant project is a set of subprojects that will help you create virtual machines pretty easily, by using Vagrant to set up the VMs with VirtualBox, and Puppet to help creating the necessary logical infrastructure.

1. Getting Started: 

Download the following on your Windows host machine. Here I am working on Windows 8.1 platform.

  1. Vagrant latest version
  2. Oracle Virtual Box latest stable version
  3. Oracle JDK latest version
  4. Oracle WebLogic 12.1.3 generic version
  5. Git for Windows
  6. PuTTy for Windows

Install the Vagrant, Oracle VirtualBox, Git all are wizard based easy to install them.

2. Git Clone WebLogic-Vagrant:

You can get the puppet, shell scripts which are used to configure the WebLogic on CentOS VirtualBox.

git clone WebLogic-Vagrant

Sync folder guest CentOS with host Windows

Make all binaries available in Software folder, Here I have used ‘F:/Softwares’ contains binaries JDK, WebLogic 12c jar file.

3. Modifications in site.pp:

The puppet script which prepared according to the JDK1.7 available that time. Now latest JDK 1.8 and it varies. So you might need to modify these values on your machine as well according to young version of JDK.

Here I am sharing the part of site.pp file.

class java {
  require os

  $remove = [ "java-1.7.0-openjdk.x86_64", "java-1.6.0-openjdk.x86_64" ]

  package { $remove:
    ensure  => absent,
  }

  include jdk8

  jdk8::install7{ 'jdk1.8.0_45':
      version                   => "8u45" ,
      fullVersion               => "jdk1.8.0_45",
      alternativesPriority      => 18000,
      x64                       => true,
      downloadDir               => "/var/tmp/install",

      urandomJavaFix            => true,
      rsakeySizeFix             => true,
      cryptographyExtensionFile => "UnlimitedJCEPolicyJDK8.zip",
      sourcePath                => "/software",
  }
}

The most important one is first line where WebLogic domain template will be used to create new domain.

4. Changes in vagrantfile:

The vagrantfile contains a virtual machine definitions that contains WebLogic admin server, Further you can configure node1, node2 machines and have a production simulated environment.

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

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "wls12cbox" , primary: true do |config|
  config.vm.box = "centos-6.5-x86_64"
  config.vm.box_url = "https://dl.dropboxusercontent.com/s/np39xdpw05wfmv4/centos-6.5-x86_64.box"
   config.vm.hostname = "vagrantcentos64.example.com"
  config.vm.network :forwarded_port, guest: 7001, host: 7001, auto_correct: true
  config.vm.network :private_network, ip: "192.168.33.10"
  config.vm.synced_folder "F:/Softwares", "/vagrant_data"

  config.vm.provider :virtualbox do |vb|
       vb.customize ["modifyvm", :id, "--memory", "3072"]
  end
  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "puppet/manifests"
    puppet.module_path = "puppet/modules"
    puppet.manifest_file  = "site.pp"
    puppet.options = "--verbose"
  end
  end
 end

Now this vagrant box is ready for execution.

vagrant up

WebLogic Vagrant box up

Vagrant Provision

There are many ways to provision the Virtual boxes we can even use Bash Shell scripts to ensure the required configurations made once boxes is launched.

After the VirtualBox creation we can apply the configuration tool such as puppet, Chef or Ansible etc to make a reusable environment within number of minutes. Whereas same was took places in the earlier versions for months. So this configuration procedure would greatly improves the team work, and focus on the targeted issues rather than configuration of infrastructure this way it is helps Agility for JEE projects.

vagrant provision some times requires reload the boxes reload will reapply the Vagrantfile changes. We can further develop this to give better box by editing the Vagrantfile and reloading it.

VagrantReloadProvision

Note that when the vagrant provision fails then we need to find the reasons and fix in the Vagrantfile. The vagrant reload command will help to reload the updated configuration for box.

5. Puppet Manifestation:

Puppet manifestation provisions that CentOS box must contain oracle user, WebLogic server required kernel parameters all OS level changes are configured and then install WebLogic with installwls.pp script. This provisioning uses silent mode installation where it required two files:

  1. responseFile which is provided in xml format silent_1213.xml.erb and
  2. oracle inventory defined by puppet.

Here is the silent.xml.erb that is required for WebLogic 12.1.3. In this script the ORACLE_HOME is substituted from the calling puppet script installWls.pp file.

[ENGINE]
 
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
 
[GENERIC]
 
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home 
ORACLE_HOME=<%= @mdwHome %>
 
#Set this variable value to the Installation Type selected. 
e.g. WebLogic Server, Coherence, Complete 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=
 
#Provide the My Oracle Support Password
MYORACLESUPPORT_PASSWORD=
 
#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
 
#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
 
#Provide the Proxy Host
PROXY_HOST=
 
#Provide the Proxy Port
PROXY_PORT=
 
#Provide the Proxy Username
PROXY_USER=
 
#Provide the Proxy Password
PROXY_PWD=
 
#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=

6. The nodemanager .pp configuration changes for WebLogic 12.1.3:

Here I have validating the $version value present in the nodemanager.pp file and executing the startNodeManager command with the existing value given error.

Whenever the server is booted immediately Nodemanager will be launched. If you use puppet provision that will ensure the WebLogic admin server running when the box is launched.

If you want to learn more issues like above or wish to discuss challenges you are hitting in Oracle Weblogic Server, register for our Oracle Weblogic Administration Training.

We are so confident on quality and value of our training that We provide 100% Money back guarantee so in unlikely case of you didn’t get results in 60 Days provided that you attended sessions, did activity Guides, Applied for Jobs, just drop us a mail before third session and We’ll refund FULL money.

Did you subscribe to our YouTube Channel (1536 already subscribed) and Private FaceBook Group (2639 Members) ?

 

Learn Oracle Weblogic Server Administration

 

Live Interactive Sessions + Dedicated Machine To Practice + Lifetime Access To Membership Portal + FREE Retaking Sessions for Next 2 Years + On-Job Support + Project Support and much more …

Click here to Register Today

About the Author Pavan Bhavani

I am working as a Technical Consultant and providing solutions in WebLogic based platform architect, SOA, integration, Oracle Fusion Middleware, security and web development. Worked extensively on automation with generic WLST Scripts. Many people were impressed with my automation tasks which are developed with a foresight in re usability, troubleshooting the issues. Worked as Java Developer till 2006. Contributed automation scripts for the book titled "Advanced WebLogic Server Automation". Started Technical blogging since 2008 for the following blogs:

follow me on:

Leave a Comment:

Not found