Friday, June 07, 2013

Tech Review: Oracle Fusion: Friday, June 7, 2013

I really need a better understand of Fusion and how it works.  This reminds me of the old days when I had to search through tons of Unix documentation to figure something out by drawing bits and pieces for many different documents.



Fusion Middleware 11g

Oracle OpenWorld

ORACLE FUSION MIDDLEWARE
  • low on meat and high on buzzword fluff.
Fusion middleware launch

Oracle Fusion Middleware 11g Launch Event announced
  • Look like this came out in 2009 so we are dealing with technology that is already 4 years old.
  • Looks like Oracle is moving towards end-to-end solutions
  • We are building our own using old technology


ORACLE FUSION MIDDLEWARE RELEASE 1 (11.1.1.6)
  • this is the main location for documentation.

GET STARTED WITH ORACLE FUSION MIDDLEWARE


Overview of Oracle Fusion Middleware
  • a collection of standards-based software products
  • software components or enterprise applications
  • Middleware - software layer that lies between OS and application on each side of a distributed computer network
  • Web Tier
    • Horacle HTTP Server
  • Middle Tier
    • Oracle WebLogic Server
  • Data Tier
    • database
Understanding Key Concepts
  • Oracle Fusion Middleware Environment
    • Oracle WebLogic Server domain
      • one Administration Server
        • Oracle WebLogic Server Administration Console
        • Fusion Middleware Control
      • one or more Managed Servers
        • Oracle WebCenter
        • Oracle SOA Suite

Description of Figure 2-1 follows

What Is a Middleware Home?
  • a container for 
    • one (?) Oracle WebLogic Server home
    • 0 or 1 Oracle Common home
    • 0 or more Oracle homes
  • Do we have an 'Instance Home'
  • We have a 'wlserver_10.3' home
    • Is the name of the server there?
    • Could the name be the domain?
    • The wlserver_10.3\common\bin folders has some scripts and config info
      • commEnv.com
        • contains all the 'home' definitions'
        • don't see a server name
  • no oracle_soa1
  • oracle_common
  • What is Oracle_WT1 (Web Tier 1)
  • user_projects
    • applications
      • <domain name>
        • <name>_domain
    • domains
      • <domain name>
        • <name>_domain
        • autodeploy
          • readme.txt
            • quick way to deploy applicatons to development server
            • when WebLogic Server is running in development mode
            • application in this directory are automatically deployed
            • WebLogic Server domains start up in development mode by default
            • all WebLogic Server instances in a domain
            • startWebLogic.cmd
            • can setup domain mode in Administration Console
        • bin
          • secureWebLogic.cmd
            • Sets DOMAIN_HOME
              • <drive>:\Oracle|Middleware\user_projects\domains\<domain name>
<drive>:\Oracle\Middleware\user_projects\domains\<domain name>\sysman\config\ohwconfig.cmd
  • oracle_apache
  • oracle_webcenter
  • weblogic_j2eeserver
<drive>:\Oracle\Middleware\user_projects\domains\<domain name>
  • shutdown.py
    • connect( url='t3://<machine>:7001', adminServerName='AdminServer')
    • shutdown('AdminServer','Server', ignoreSessions='true'
  • startWebLogic.cmd
    • <domain home>\bin\startWebLogic.cmd
<drive>:\Oracle\Middleware\user_projects\domains\<domain name>\bin\secureWebLogic
  • SERVER_NAME - Name of the weblogic server
  • set SERVER_NAME=AdminServer
E:\Oracle\Middleware\wlserver_10.3\common\bin\commEnv.cmd




Oracle WebLogic 11g Creating an Windows Service: Thursday, June 6, 2013



First off, let me simply state that the fact that I have to create this script is an indication of a fundamental flow in Oracle's approach.  For an example of a piece of software that does it right look at LimeSurvey.  Perhaps Oracle has done butter in 12c, but I don't think so.



Setting Up a WebLogic Server Instance as a Windows Service
  • Script
    • sets values for server-specific variables
    • calls a WebLogic master script
Am I setting up a Manage Server to run from WebLogic 

    • add a Java class and modify master script so that the MS Management console will invode the class
Will do this after I get the script up and running.

Creating a Server-Specific Script
  • sets values for variables that identify the name of the server instance and other server-specific information
  • call the master script
    • WL_HOME\server\bin\installScv.cmd
    • master script invokes beasvc utility
      • to learn more about utility - WL_HOME\server\bin\beasvc -help
  • Example script
    • {this is not a complete example}
echo off  SETLOCAL  set DOMAIN_NAME=myWLSdomain  set USERDOMAIN_HOME=d:\Oracle\Middleware\user_projects\domains\myWLSdomain  set SERVER_NAME=myWLSserver  set PRODUCTION_MODE=true  set  JAVA_OPTIONS=-Dweblogic.Stdout="d:\Oracle\Middleware\user_projects\domains\myWLSdomain\  stdout.txt" -Dweblogic.Stderr="d:\Oracle\Middleware\user_projects\domains\myWLSdomain\  stderr.txt"  set ADMIN_URL=http://adminserver:7501  set MEM_ARGS=-Xms40m -Xmx250m  call "d:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd"  ENDLOCAL

These values are being set in the following files:
  • WL_HOME\user_projects\domains\<domain>\bin\startManagedWebLogic.cmd
    • DOMAIN_NAME=myWLSdomain
  • E:\Oracle\Middleware\user_projects\domains\<domain>\init-info\
    • USERDOMAIN_HOME=
The 'root' directory for the Administration server is the same as USERDOMAIN_HOME and contain the domain's configuration file.
  • What is the domain's configuration file name?
And is called 'config.xml'

OK, with this knowledge do I no know where the text file is to be stored?

I think part of the documentation is not correct.  The 'Administration Server's root directory doesn't contain the configuration file, it contains the configuration directory.

I think I want the production mode set to false for now so that it runs in development mode.

The text files needs a '.cmd' extension

The above script is only partial.

Example Java Class that Shuts Down a Server Instance
  • This basically logs into the server and tells it to shutdown.
  • Class is ServerStopper
  • Shutdown all 
They are not giving me enough information.
  • Where does this file go?
  • How is it called?
I have to go to another page to try to piece this together.

OK, let's read though the instructions again.

Setting Up a WebLogic Server Instance as a Windows Service
  • Microsoft Management console (MMC)
    • Where you start, stop and configure Windows services.
  • For every server setup as a Windows service, WebLogic Server creates a key in the Windows Registry
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
    • information in key used to invoke the 'weblogic.Server main class
  • MMC cannot be configured to use Node Manager to start Managed Servers
  • Node Manager's monitoring and automatic restart features cannot be used if Windows service is used to start the WebLogic Server
Setting Up a Windows Service: Main Steps
  • Create a script that sets values of server-specific variables and than calls a WebLogic Server master script
  • Are we installing Managed Server as a Windows service?
There are a lot of servers being talk about and one server can be called by more than one name.
  • Servers
    • WebLogic Server
    • Managed Server
    • Administration Server
      • Some of the naming seems to indicated this is the same as WebLogic Server
  • Do we have a Managed Server?  How do I tell if we are running a Managed Server?
    • Is is started in the WebLogic Server master script?
  • Create Java class to shutdown the service.
What is the service called?  How do i find it in the MMC?
  • I need to redirect the standard out and standard error so it can be read.
  • The Java class for graceful shutdown need to be added to the WebLogic Server master script so that the WebLogic server instance can invoke it.
  • Run the server-specific script
    • I believe this is the script that sets the server-specific variables and calls the WebLogic Server master script.
  • server-specific script
    • AdminServerWebLogicMMCService.cmd
  • located in the Administration Server's root directory
    • Where is this directory located?
      • The absolute pathname of the Administration Server's root directory is contain in the user domain home script variable (USERDOMAIN_HOME).
      • d:\Oracle\Middleware\user_projects\domains\myWLSdomain  
      • <Drive>:\Oracle\Middleware\user_projects\domains\<WLS domain>
      • WebLogic Server (WLS)
  • The following commands are required to start the script:
    • SETLOCAL  
      • What does this command do?
      • http://ss64.com/nt/setlocal.html
        • controls the visibility of environment variables
        • causes script to inherit all current variables from the master environment/session
        • ENDLOCAL  restore the variable to the state when SETLOCAL was called.
    • set DOMAIN_NAME=domain-name  
      • The name of the WebLogic Server domain
      • domain-name is <my domain>
    • set USERDOMAIN_HOME=absolute-pathname  
      • The absolute pathame of the Administration Server's root directory.
      • This is a bit confusing to me because the name seems to the path  to the WLS domain name; however, the name of the server is AdminServer.  Is the administration server the WebLogic server?  Can there be more that one WebLogic server running at a time?
    • set SERVER_NAME=server-name  
      • This name in both the incomplete example script and in my install is 'AdminServer'.
        • Where did is set this?
        • Can there be more than one of these types of servers?
  • The following command are optional.  However, I don't see how that can be 'optional' in normal circumstances where you have a server you that you must log into which seems to be the default install.
    • set WLS_USER=username

    • set WLS_PW=password  
      •   This user name and password are set in the install and by default the user name is 'weblogic'.  I don't think there is a default password.
      • These login credentials are encrypted and stored in the Windows registry.  However, they are is simple text in the server specific script.
    • set PRODUCTION_MODE=[true]  
      • Should leave this off while getting the script running so I have more debug info.
    • set JAVA_OPTIONS=java-options  
      • I believe that I use the one from the example as long as I update the path.
    • set JAVA_VM=-JVM-mode  
      • I believe that I can omit this and let Java use its default
    • set MEM_ARGS=[-XmsNumberm] [-XmxNumberm]  
      • Use the values from the example
    • I think I can leave out the connection retries, ip address and port number
  • The following command are required to end the script
    • call "WL_HOME\server\bin\installSvc.cmd"  
      • I need to put the complete path name
    • ENDLOCAL  
      • causes the environment variables to be restore to there state when SETLOCAL was called.
Ok, now that I have the script written, how do I test it?

Configuring a Connection to the Administration Server
  • Managed Server as a window service
  • location of the domain's Administration Server
  • Managed Server contacts the Administration Server to get configuration data.
  • Administration Server is not a service.
    • I thought that this is what I was the service I am creating.

Configuring Managed Server Connections to the Administration Server
  • How do I start the Administration Server in a shell or command line?
  • Starting and Stopping Servers
  • There are two conditions that I have to do this
    • starting a Managed Server
    • invoking the java weblogic.Server  command directly
  • I am not doing either of those, so I should be off the hook
It seems like the Admin Server and the WebLogic Server are two different things.

Verifying the Setup
  • veirfy that I have successfully set up a WebLogic server as a Windows service
    • Open a command window and set the path variable to server bin
      • set PATH=WL_HOME\server\bin;%PATH%  
    • Navigate to the directory immediately above you domain directory.
      • MW_HOME\user_domains\mydomain  to MW_HOME\user_domains  
    • Execute the beasvc command
      • beasvc -debug "yourServiceName  
How do I determine the service name?

Looking for the beasvc command in script.

Didn't find.

Searching the web brings me back to the above pages.

I am going to assume that it is the name of the server in the SERVER_NAME variable in the server specific script.

How does the above command verify anything?