6 Replies Latest reply on Sep 13, 2007 9:10 PM by John van Ommen

    WebLogic

      We have recently started to use BladeLogic and are hoping to use it for application release management.

       

      Is there anyone who would like to comment on how they use BladeLogic to interact with WebLogic.

       

      How do you handle differences between many domains you may deploy? What steps and features of BladeLogic do you use to deploy new applications.

       

      Thanks for any details you can give

        • 1. Re: WebLogic

          Hi,

           

          This is on my todo list. :)

          I'm also interested in the experiences of other BL users regarding this.

          • 2. Re: WebLogic

            Typically you'd install BEA with an RPM. Prior to doing the installation, you'll want to create the proper users, groups, and directories. Here's an nsh script that will take care of that for you.

             

            Here's how to install it.

             

            - Add the script to the depot as a type 1 nsh script ("runscript")

            - create an NSH script job; the target of your job is passed to the script.

             

            A few comments -

            The script is flexible enough to be used with any app; just change the user, group and directories to suit your needs. It's also intelligent enough to detect if some of your directories exist, but the others do not. It would be nice to pass parameters to the script via the GUI but I didn't have time to implement that.

             

            ##########################################################################

            1. Shellscript: add-bl-user.nsh

            2. Author : John van Ommen <jommen@bladelogic.com>

            3. Date : 07-31-07

            ##########################################################################

            1. Changes

            2. 07-31-07 jv Initially created.

            ##########################################################################

             

             

             

             

            MYHOST=$NSH_RUNCMD_HOST

            MYUSER=weblogic

            MYGROUP=weblogic

             

            DIRS="/bea

            /bea/logs

            /local/javaio

            /local/somesitename

            /common/javaio"

             

            1. First we need to figure out if our group exists

            if `cat //$MYHOST/etc/group

            then

            echo "group $MYGROUP exists"; echo

            exit

            else

            echo "creating group $MYGROUP"; echo

            nexec $MYHOST groupadd $MYGROUP

            fi

             

            1. Second we need to figure out if our user exists

            if `cat //$MYHOST/etc/passwd

            then

            echo "user $MYUSER exists"; echo

            exit

            else

            echo "creating user $MYUSER"; echo

            nexec $MYHOST useradd $MYUSER

            fi

             

            echo

             

            for dir in $DIRS

            do

            if [ -e "//$MYHOST$dir" ]

            then

            1. if the directory DOES exist, change ownership to our user

            echo "//$MYHOST$dir exists - changing ownership to $MYUSER:$MYGROUP."; echo

            nexec $MYHOST chown $MYUSER:$MYGROUP $dir

            fi

             

            if [ ! -e "$dir" ]

            then

            1. if the directory in "DIRS" doesn't exist, create it with the proper permissions

            echo "//$MYHOST$dir does not exist - creating now."

            echo

            nexec $MYHOST mkdir $dir > /dev/null 2>&1

            nexec $MYHOST chown $MYUSER:$MYGROUP $dir

            echo "created directory $MYHOST$dir owned by $MYUSER:$MYGROUP."; echo

            continue # on to next

            fi

             

            done

            • 3. Re: WebLogic

              and how would you install and configure a domain?

              • 4. Re: WebLogic

                and how would you install and configure a domain?

                 

                Take a look at this, then wrap an nsh script around the command. Keep in mind there are about 27 steps that have to be completed first!

                 

                http://e-docs.bea.com/wls/docs81/admin_ref/cli_tasks.html#1279979

                 

                To create a domain named mymedrec with an Administration Server named myMedRecServer that listens on port 8001:

                 

                Create an empty directory named mymedrec.

                Change to the empty directory and enter the following command:

                 

                java -Dweblogic.management.username=weblogic

                -Dweblogic.management.password=weblogic

                 

                -Dweblogic.Domain=mymedrec

                -Dweblogic.Name=myMedRecServer

                 

                -Dweblogic.ListenPort=8001

                -Dweblogic.management.GenerateDefaultConfig=true weblogic.Server

                 

                • 5. Re: WebLogic

                  so you would keep all the configuration of the domain within a nsh script?

                  • 6. Re: WebLogic

                    NSH scripts work, but leveraging the Property Dictionary with a BLPackage is attractive.

                     

                    Here's an example of doing this in the context of Weblogic.

                     

                    First, create a property class for you Weblogic properties. Some properties you might want to include the name of the machine, the name of the Admin node, etc...

                     

                    At this point you should have a BLPackage created to deploy the Weblogic RPMs.

                     

                    Once you have your customer property class and your BLPackage, you can add external commands that are parameterized.

                     

                    Here's an example:

                     

                    export CLASSPATH=/usr/bea/weblogic81/server/lib/weblogic.jar

                    /usr/bea/jrockit81sp5_142_08/bin/java weblogic.Admin -url t3://??TARGET.WEBLOGIC.ADMIN_IP??:7001 -username ??TARGET.WEBLOGIC.USERNAME?? -password ??TARGET.WEBLOGIC.PASSWORD?? CREATE -mbean someDomain:Name=??TARGET.HOST??,Type=Machine