Scripted OBI 11g Linux startup/shutdown

January 4th, 2012 by

 

 

 

Update – this post is now obsolete

A much neater way of automating the startup/shutdown of OBIEE on Linux is to use the script we have published on the Rittman Mead scripts repository on github. You can see details of how to implement it here.

 

 

 

OBI 11g ships with a one-click startup option for Windows installations, but not for Linux (*NIX). Windows users get a big shiny Click Here type button, whereas Linux users have to ferret around in the middleware folders trying to remember the paths for Node Manger, Web Logic, Managed Server and finally OPMN each time you want to start the stack up and shut it down.

Other than to reenforce the stereotype of the two OSs being easy/difficult to work with respectively, I don’t know why Oracle didn’t provide the same script for Linux. The Windows script uses a platform-agnostic, java-based tool called Ant so can easily be made to run on Linux.

The good thing about it using Ant, an industry-standard tool, is that there’s plenty of documentation on how to use it, and the code is reusable and extensible. Using this ant-based scripting, it handles dependencies and startup order, as well as graceful exit if there’s a problem, and proper checking for a service being up.

You should always aim to have as few bespoke scripts as possible, and keeping all your configuration in one place. This script achieves that, by having all the heavy lifting in the XML which is reusable across deployments (e.g. dev/test/prod), and the environment-specific configuration in the calling script.

There is a Linux startup/stop script on t’internet already, but I believe the option below is preferable for a few reasons:

  • The ant-based script is basically that provided by Oracle for Windows, so is in keeping with the product and easier to adapt in future releases
  • It checks for actual services listening on ports, rather than fixed sleep periods or entries in log files. Log file entries may change with releases, and the script I’ve seen doesn’t time out either (so would hang indefinitely if there were a problem)
  • Being written in Ant it is easy to extend its functionality using existing building-blocks, it avoids having to rewrite logic like checking for a listening port

The Script

The script is basically that provided by Oracle (on both Windows and Linux installations, just unused in the latter), which you will find in Oracle_BI1/bifoundation/install/. With a few tweaks to make it work on Linux, and a bit of improvement, here is a version of the script that you can use and reuse on all your Linux OBI 11g installations. I have improved it to do the following:

  • Include NodeManager in the startup, if not a Simple installation.
  • Automagically determine NodeManager and OPMN listening ports
  • Wait for Answers to become available before launching the web browser
    • This replaces the hardcoded sleep period which is often not enough for the services to have finished starting up, causing a 500 Internal Server error in the browser.

There are two files, available on GitHub here.
Download the files to somewhere convenient on your server, and then do the following:

  1. Make the script executable:

    chmod u+x StartStopServices.sh
  2. Edit the script StartStopServices.sh to provide your environment details:
    # Change these as necessary:
    export MW_HOME=/put/your/mwhome/path/here
    export WLSHOST=yourhostname
    export WLSADMINPORT=7001
    export WLSMGDPORT=9704
    
    • Set MW_HOME to the root of your installation, in which you have the folders like “instances”, “OracleBI1″, “user_projects”, etc.

    • Set WLSHOSTNAME to your machine’s hostname
    • WLSADMINPORT and WLSMGDPORT only need changing if you are using non-default ports of 7001 and 9704 respectively.

    Everything else in the script should not need changing, unless you have a non-default installation. You shouldn’t need to change the XML file at all.

Now all you need to do is call the script to startup:

./StartStopServices.sh start_all

(the start_all is the default, and optional)

And shutdown:

./StartStopServices.sh stop_all

The first time that you start your system this way you will be prompted for the username and password, which are subsequently encrypted and saved in boot.properties file so that you don’t have to supply them each time.

This script was tested on OEL, so ought to work on that and other RHEL flavours. It might need slight tweaking for other *nix platforms.

You actually want a button to click?

I would probably argue that if you’re admining a linux server, you should be comfortable enough with executing a script, but if you really want a button to click like on Windows, then simply create a Launcher (right-click on the Desktop) to call the script :

Lift the icon from a Windows installation and set that too, and you’ll end up with a nice button like this:

Watch out that once you close the window, you close all of the spawned processes, i.e. you’ll shut down OBIEE :-)

(This is on OEL 5, YMMV on other flavours of Linux)

Additional functionality

This script can also do things like check for RCU connectivity at startup (and even start the DB, if you want it to), but to keep it installation-independent I have not included that version here.

It could also be easily amended to reuse the service check sections to support a service_status call, which would report back on all of the listening ports and BI components.

Tidbit for Windows users

If you are on Windows, and you want the Start BI Services script to wait until Answers is available (and not give you a 500 Internal Server error at first), then copy this version of StartStopServices.xml (rename it after download to StartStopServices.xml) into the folder instances\instance1\bifoundation\OracleBIApplication\coreapplication. Make a backup of the file before you overwrite it.

Tags: , , , , ,

Comments

  1. Stewart Bryson Says:

    Excellent post Robin. Have I mentioned how glad I am your work with us now?

  2. Rob Says:

    Does this work for clustered environments as well?

  3. Robin Moffatt Says:

    Hi Rob,
    It’s only been tested on single machines, it would probably need altering to take into account multiple instances.

  4. Christian Says:

    Robin,
    Good post. It looks like you’ve found a new home. Congrats!
    Cheers,
    Christian

  5. Deniss Says:

    Robin,

    You wrote that username/password “are subsequently encrypted and saved in boot.properties file”. Somehow they are not encrypted and stored in plain text. And I cannot find encryption section in StartStopServices.xml. Any suggestions?

    BR
    Deniss

  6. Deniss Says:

    Sorry. My mistake. boot.properties are now encrypted.

    BR
    Deniss

  7. Robin Moffatt Says:

    Hi Deniss, looks like you beat me to it. It should encrypt automatically after first use.

    Ref: http://docs.oracle.com/cd/E21764_01/core.1111/e10105/start.htm#ASADM11646

    thanks, Robin.

  8. Nilesh Agarwal Says:

    I tried running the script on our development environment but it failed giving me the following reason.

    [oracle@OBIEEServer ~]$ ./StartStopServices.sh start_all
    Buildfile: ./StartStopServices.xml does not exist!
    Build failed

    ————————-
    Press any key to continue

  9. Nilesh Agarwal Says:

    I got it now, I had forgotten to copy StartStopServices.xml along with the script.

  10. Damir Vadas Says:

    Hi!

    Why do you not use “&” for sending process in background and allowing to run after the window is closed?
    On windows this is not an option of course, but you are here referencing Linux ….
    Damir Vadas

  11. Justin Pollard Says:

    Not sure what’s happening here, but I cannot get the script to start my WLS. It fires up the node manager without issue, and attempts to start WLS as well. HTOP shows that WLS is spinning off threads, but they all abruptly stop and then the script times out.

    Any ideas?

  12. Justin Pollard Says:

    After a clean install the script runs perfectly. Thanks for the great article.

  13. Pradeep M. Says:

    Thanks for saving a couple of frustrated hours. It didn’t work well for me at first time though but it only took seconds for me to figure out the reason. As I didn’t use the default ‘instance1′ instance name, I had to go and change the INSTANCE_HOME variable too.

  14. Nguyen Says:

    Hi,
    i tried 2 times running the script and it was failed as following error code:
    $./StartStopServices.sh start_all
    Buildfile: ./StartStopServices.xml

    BUILD FAILED
    /home/oracle/StartStopServices/StartStopServices.xml:312: Timed out waiting for weblogic to become available at: :9704

    ———————-
    Press any key to continue

    Can giving me some advices ?
    i guessed it was caused by error when starting 2 services: coreapplication_obis1 + coreapplication_obisch1

  15. tomtom Says:

    Why does Oracle provide a more complete product to Windows customers than Unix ones? Perhaps more to the point is to express this as a tip: Unix customers, be aware that, when you feel you’re missing a crucial part in comparison to a Windows-based solution, you might be right. A good solution–perhaps one even better than the vendor provides–might be only a few lines of
    scripting away. http://bit.ly/RwNFQR

  16. lennon Says:

    Hi,
    I have installed a scaling out BIEE which using cluster controler manaing HA.I would like to know if the embedded startup/shutdown scripts available for scaling out architecture?For example:cluster controler will be managed by the scripts?

    Thanks for your comments.

  17. Shankar S Says:

    Hi Robin,

    Thanks for the script.

    Are there any updates required for this script for OBIEE 11.1.1.6 Simple Install which has AdminServer performing both functions – Admin Server and Managed Server.

    I have tried setting the following:
    export WLSMGDNAME=AdminServer
    export WLS_SINGLE_SERVER_INSTALL_FLAG=true

    but the build times out after 900 seconds.

    If i try other choices like:
    export WLSMGDNAME=bi_server1
    export WLS_SINGLE_SERVER_INSTALL_FLAG=
    then too, the build tries to create the credentials file and fails before it reaches wls.mgd.alive section of script.

    Thanks
    Shankar

  18. Faisal Memon Says:

    Modified it to work on AIX Server :) :) – http://isimplyshare.com/obiee-11g-services-on-system-start-up-of-aix-server/

  19. Ashley Harrell Says:

    Hi Robin,

    When I attempt to run the ./StartStopServices.sh start_all command I get the “Error: JAVA_HOME is not defined correctly” error message. The default JAVA_HOME is set to the same location used during the OBIEE install configuration. Is there any reason why this would not be the same JAVA_HOME needed for this script?

    Thanks for your comments.

  20. Robin Moffatt Says:

    Hi Ashley,

    I don’t know the answer offhand to this, but I would recommend you use a different script, one we have published on our public github repo. I have written about it here. It is a lot more functional and “linuxy”.
    Let me know if you have any questions about it.
    thanks, Robin.

Website Design & Build: tymedia.co.uk