OBIEE powered with WebLogic

Majority of OBIEE deployments are implemented with OC4J – this is the default type of OBIEE setup. It is easy.  Well, substitute OC4J with WebLogic is easy as well ( of course, this alternative may be interesting only for shops already running WebLogic, otherwise it might be too expensive).

First, the WebLogic software should be installed – this is not a big deal, interesting to mention only – it is perfectly capable for silent mode installation.  To do that, a pretty simple configuration file should be created – the example from the documentation is a good start point, in my setup i written such config ( silent.xml) with following content:


<?xml version="1.0" encoding="UTF-8"?>
<bea-installer>
 <input-fields>
 <data-value name="BEAHOME" value="/opt/biee/Middleware" />
 <data-value name="WLS_INSTALL_DIR" value="/opt/biee/Middleware/wlserver_10.3" />
 <data-value name="COMPONENT_PATHS"
 value="WebLogic Server" />
 <data-value name="INSTALL_NODE_MANAGER_SERVICE" value="yes"  />
 <data-value name="NODEMGR_PORT" value="5555" />
 <data-value name="BEA_BUNDLED_JVMS" value="/opt/biee/Middleware/jrockit_160_05" />
 </input-fields>
</bea-installer>

There is not too much freedom by the installation – you can vary installation location, individual components, which jdk should be installed/used. The installation itself can be performed then with


./server103_linux32.bin -silent_xml=/opt/biee/stage/silent.xml -mode=silent -log=silent.log

After installer completes, the domain should be created. The concept of domain is again very good explained in the documentation, basically it is a logical entity which contains grouped by some attribute (it may be all development server – building a development domain, or , alternatively,  all server located in Munich – building a geographical domain) WebLogic servers or clusters. To perform administrative tasks on domain, one server, dedicated for this job should be created (typically called AdminServer) – where no custom applications should be deployed. Additionally, any number of managed server or cluster may be created in the same domain.  Another component worth to mention is NodeManager – it adds a lot of flexibility to control your server infrastructure, it can start server, kill server,check server status and alike – again, the documentation is very detailed.  So, to achieve the goal – deployment of OBIEE – the plan could look

  1. Create a bi domain
  2. Create administrative  server
  3. Create managed server
  4. optionally – enroll NodeManager
  5. Deploy OBIEE into managed server

The funny point about this is – all the tasks above can be scripted. No mouse. Ever.

Moreover, it can be done in a lot of ways, my personal favorite is WebLogic Scripting Tool (WLST – a jython based api). There are a lot of functionality already included in WLST, it is highly extensible, for example Oracle Fusion is delivered with additional modules to get better control over individual components.  But if that’s not enough, one can write own scripts using either existing java or python classes. To create a simple domain a supplied script can be used (with some adujstments) – the location of sample wlst scripts is $WLS_INSTALL_DIR/common/templates/scripts/wlst. Google search can provide a lot of nice examples as well, in particular, i used slightly customized version of script found at Bala Kothandaraman’s blog :

### Script to create WebLogic Domain(s) from csv file02.### Reusable Definitions
def buildDomain():
    ### Read Basic Template
    readTemplate(WL_HOME+"/common/templates/domains/wls.jar")
    cd('Servers/AdminServer')
    set('ListenAddress', adminServerAddress)
    set('ListenPort', int(adminServerPort))
    ### Create Admin User
    cd('/Security/base_domain/User')
    delete('weblogic','User')
    create(adminUser,'User')
    cd(adminUser)
    set('Password',adminPassword)
    set('IsDefaultAdmin',1)
    ### Write Domain
    setOption('OverwriteDomain', 'true')
    writeDomain(domainLocation+'/'+domainName)
    closeTemplate()
def printConfirmation():
    ### Print Confirmation
    print ""
    print "Created Domain With Following Values"
    print "Domain Name   = %s " % domainName
    print "Domain Location  = %s " % domainLocation
    print "Admin User   = %s " % adminUser
    print "Admin Password   = %s " % adminPassword
    print "Admin Server Address  = %s " % adminServerAddress
    print "Admin Server port  = %s " % adminServerPort
### Executable Script
### CreateDomain.py
import sys
### Define constants
WL_HOME = "/opt/bea/Middleware/wlserver_10.3"
### Read the command-line arguments
argslength = len(sys.argv)
if argslength < 2 :
    print '==>Insufficient arguments'
    print '==>Syntax: java weblogic.WLST CreateDomain.py csv.file'
    exit()
else:
    ### Read the csv file
    fileName = sys.argv[1]
    print('Reading File \"' + fileName + '\"' )
    f = open(fileName)
    try:
        for line in f.readlines():
        ### Strip the comment lines
          if line.strip().startswith('#'):
              continue
          else:
              ### Split the comma seperated values
              items = line.split(',')
              items = [item.strip() for item in items]
              if len(items) != 6:
                  print "==>Bad line: %s" % line
                  print "==>Syntax: domainName, domainLocation, adminUser, adminPassword, adminServerAddress, adminServerPort"
              else:
                  (domainName, domainLocation, adminUser, adminPassword, adminServerAddress, adminServerPort) = items

                  ### Call the definition buildDomain
                  buildDomain()
                  ### Call the definition printConfirmation
                  printConfirmation()
    except Exception, e:
        print "==>Error Occured"
        print e
exit()

This script reads a csv file with 6 fields filled for domain name,domain location,admin user,admin password,server address,server port. I used a file biee.csv with the contents:

biee,/opt/bea/Middleware/user_projects/domains,admin,weblogic,,7001

Leaving the server address empty means, server will be listening on all available interfaces, otherwise, it would be listen only on the interface with the given ip address.
Script can be executed then by the WLST wrapper ( of course, the csv file can contain definitions for multiple domains, which all are created then in bulk)

wlst.sh CreateDomain.py biee.csv

The next steps – create managed server, enroll NodeManager, deploy application are performed by following wlst script:

## Variable Definitions
DomainName   = 'biee'
DomainLocation  = '/opt/bea/Middleware/user_projects/domains'
DomainDir = DomainLocation + '/' + DomainName
AdminUser   = 'admin'
AdminPassword   = 'weblogic'
AdminServerport  = '7001'
AdminServer='AdminServer'
ManagedServer='biee01'
Machine='unixMachine01'
nmPort=5555
nmType='SSL'
nmHost='localhost'
nmHome='/opt/bea/Middleware/wlserver_10.3/common/nodemanager'

# StartServer - starts AdminServer
startServer(adminServerName=AdminServer,domainName=DomainName,username=AdminUser,password=AdminPassword,
   domainDir=DomainDir)
# connect to server
connect(AdminUser,AdminPassword)
edit()
startEdit()

# create Machine
cmo.createUnixMachine(Machine)
# create managed server
cmo.createServer(ManagedServer)

cd('/Machines/' + Machine + '/NodeManager/' + Machine)
cmo.setNMType(nmType)
cmo.setListenPort(nmPort)
cmo.setListenAddress(nmHost)

cd('/Servers/' + ManagedServer)
cmo.setListenAddress('')
cmo.setListenPort(7003)
cmo.setListenPortEnabled(true)
cmo.setJavaCompiler('javac')
cmo.setMachine(getMBean('/Machines/' + Machine))

cd('/Servers/' + ManagedServer + '/SSL/' + ManagedServer)
cmo.setEnabled(true)
cmo.setListenPort(7004)

cd('/Servers/' + ManagedServer + '/ServerStart/' + ManagedServer)
cmo.setUsername(AdminUser)
cmo.setPassword(AdminPassword)
cmo.setClassPath('/opt/bea/Middleware/patch_wls1030/profiles/default/sys_manifest_classpath/
   weblogic_patch.jar:/opt/bea/Middleware/patch_cie660/profiles/default/sys_manifest_classpath/
   weblogic_patch.jar:/opt/bea/Middleware/jrockit_160_05/lib/tools.jar:/opt/bea/Middleware/
   wlserver_10.3/server/lib/weblogic_sp.jar:/opt/bea/Middleware/wlserver_10.3/server/lib/
   weblogic.jar:/opt/bea/Middleware/modules/features/weblogic.server.modules_10.3.0.0.jar:/
   opt/bea/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/bea/Middleware/modules/
   org.apache.ant_1.6.5/lib/ant-all.jar:/opt/bea/Middleware/modules/
   net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:')
save()
activate()
# enroll NodeManager
nmEnroll(DomainDir,nmHome )
# start Node Manager
startNodeManager(verbose='true',NodeManagerHome=nmHome,ListenPort='5555',ListenAddress=nmHost)
# connect to node manager
nmConnect(AdminUser,AdminPassword, nmHost, 5555, DomainName, DomainDir,'ssl')
# start managed server
start(ManagedServer,'Server')
# deploy application ( oracle bi )
deploy("analytics","/opt/bea/OracleBI/web/analytics.war","biee01,",securityModel="DDOnly",block="true")

The script is pretty self explanatory – it is in general the strength of jython or python scripts – the code is easy readable, but it might be my personal opinion as i use a lot of python in daily work. Another point worth to mention – in the AdminConsole recording can be enabled, so all configuration changes in the Web gui can be saved to a script, that can be a starting point for latter configuration/deployment scripts.
By the last step – deployment – is assumed, Oracle BI EE is already installed. By the way, Oracle BI EE can as well be installed in silent mode – the response file will be created if installer options are like:

$BI_STAGE/setup.sh -console -options -record custom_response.ini

which might be reused then

$BI_STAGE/setup.sh -options custom_response.ini -silent

If BI Server and Presentation Server are started, then you can immediately login to Answers/Dashboards served from WebLogic server. XMLPublisher can be deployed on the same or another managed server, depending on requirements.

### Script to create WebLogic Domain(s) from csv file02.### Reusable Definitions
def buildDomain():
### Read Basic Template
readTemplate(WL_HOME+”/common/templates/domains/wls.jar”)
cd(‘Servers/AdminServer’)
set(‘ListenAddress’, adminServerAddress)
set(‘ListenPort’, int(adminServerPort))
### Create Admin User
cd(‘/Security/base_domain/User’)
delete(‘weblogic’,’User’)
create(adminUser,’User’)
cd(adminUser)
set(‘Password’,adminPassword)
set(‘IsDefaultAdmin’,1)
### Write Domain
setOption(‘OverwriteDomain’, ‘true’)
writeDomain(domainLocation+’/’+domainName)
closeTemplate()
def printConfirmation():
### Print Confirmation
print “”
print “Created Domain With Following Values”
print “Domain Name   = %s ” % domainName
print “Domain Location  = %s ” % domainLocation
print “Admin User   = %s ” % adminUser
print “Admin Password   = %s ” % adminPassword
print “Admin Server Address  = %s ” % adminServerAddress
print “Admin Server port  = %s ” % adminServerPort
### Executable Script
### CreateDomain.py
import sys
### Define constants
WL_HOME = “/opt/bea/Middleware/wlserver_10.3”
### Read the command-line arguments
argslength = len(sys.argv)
if argslength < 2 :
print ‘==>Insufficient arguments’
print ‘==>Syntax: java weblogic.WLST CreateDomain.py csv.file’
exit()
else:
### Read the csv file
fileName = sys.argv[1]
print(‘Reading File \”‘ + fileName + ‘\”‘ )
f = open(fileName)
try:
for line in f.readlines():
### Strip the comment lines
if line.strip().startswith(‘#’):
continue
else:
### Split the comma seperated values
items = line.split(‘,’)
items = [item.strip() for item in items]
if len(items) != 6:
print “==>Bad line: %s” % line
print “==>Syntax: domainName, domainLocation, adminUser, adminPassword, adminServerAddress, adminServerPort”
else:
(domainName, domainLocation, adminUser, adminPassword, adminServerAddress, adminServerPort) = items### Call the definition buildDomain
buildDomain()
### Call the definition printConfirmation
printConfirmation()
except Exception, e:
print “==>Error Occured”
print e
exit()

Advertisements

One thought on “OBIEE powered with WebLogic

  1. Pingback: Oracle BI with multiple Repositories and MySQL Datasource « comSysto.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s