|
|
Configuring WebLogic Resources, a la wlshell
Paco Gomez's Blog |
July 20, 2007 12:00 AM
|
Comments (0)
In my previous entry, I discussed about how to connect to an Admin Server and how the MBeans are organized in three MBean servers. Here I will explain how to make changes in a domain, creating a Managed Server as an example.
All changes on the domain need to be done on the "Edit" MBean server and within the scope of a configuration session. The general process is as follows:
1. start a configuration session
2. make changes to the configuration
3. save changes
4. activate changes
The Configuration Manager MBean is used to manage a session. Since the name is quite long, I'll define a convenience variable with its name:
#keys
keys Type Name
#Configuration Manager
cm = edit.com.bea:/weblogic.management.mbeanservers.edit.ConfigurationManagerMBean/ConfigurationManager
The "keys" command is very important to be able to navigate the MBeans. There is a complete description of the command and the concept behind it in the wlshell documentation.
Also, I'm going to define some variables that I will use later in the script:
#domain
domain=myDomain
#admin server
server=AdminServer
#managed server
ser=myServer01
The first step can be done by calling the "startEdit" operation:
############################################
#start change session
wm = 60000
tm = 120000
invoke $cm/startEdit $wm $tm
Now I can make changes to the configuration. I'm going to create a Managed Server:
############################################
#make changes
edit.com.bea:
cd /Domain/$domain
invoke createServer $ser
cd /Server/$ser
set ListenPort 7111
You might remember that in WLS pre-9 I had to create an MBean to have a new resource, while here I use an MBean operation to create the resource, "createServer" in this case.
Finally, steps three and four:
############################################
#save and activate
keys Type Name
invoke $cm/save
invoke $cm/activate $tm
The new Managed Server will now appear in the "Edit" and "Domain" MBean servers.
The wlshell distribution contains additional examples using WebLogic 9 and 10:
- create and delete a DataSource
- create and delete a JMS Server and JMS Queues
- create and delete a Managed Server
I will cover some advance configuration topics in future entries, as well as other exciting new features of the shell.
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
|
|