Description: The WebLogic Scripting Tool (WLST) is a command-line scripting interface that you can use to monitor and manage WebLogic Server instances and domains. You can use WLST as a Node Manager client to start and stop your server instances. For this guide, I will show you how to configure Node Manager for WLST. Before proceeding. make sure you have configured node manager. If you have not, go to "Configuring and Starting Node Manager" guide. Have node manager and the WebLogic Admin Server running.
Running WLST
WLST can be started by running the "wlst.sh" script which is located in "<wl_home>/common/bin".
cd /home/oracle/Oracle/Middleware/wlserver_10.3/common/bin ./wlst.sh
Setting up and Using nmConnect()
The nmConnect() is a WLST command used to connect to a node manager. You may have a randomly generated node manager credential. If you do, follow these steps to change the node manager credential.
1. Login to the WebLogic Administration Console.
2. Navigate to Domain -> Security -> General. Click Advanced and change "NodeManager Username", "NodeManager Password", and "Confirm NodeManager Password" to your WebLogic Admin credentials.
3. Invoke WLST, connect to the Administration Server, and run nmEnroll().
#connect([username],[password],[url]) - Connects WLST to a WebLogic Server instance wls:/offline> connect('weblogic', 'Password1', 't3://localhost:7001') #Currently connected to the AdminServer. #nmEnroll([domainDirectory].[nodeManagerHome]) - Enrolls the machine on which WLST is currently running. #nm_password.properties and SerializedSystemInt.dat are created or updated in the path you specified for [domainDirectory]. wls:/oim_domain/serverConfig> nmEnroll('/home/oracle/Oracle/Middleware/user_projects/domains/oim_domain','/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager') #Disconnect WLST from a WebLogic Server instance. wls:/oim_domain/serverConfig> disconnect()
4. Test node manager connection with WLST. To find the host name (Listen Address), port, and type of your node manager, navigate to Machines -> [machineName] -> Configuration -> Node Manager. Note that a node manager is associated with a machine.
#nmConnect([nmUsername],[nmPassword],[host],[port],[domain],[domainDirectory],[nmType],[verboseMode]) #Connects WLST to Node Manager to establish a session. wls:/offline> nmConnect('weblogic', 'Password1', 'localhost', '5556', 'oim_domain', '/home/oracle/Oracle/Middleware/user_projects/domains/oim_domain','ssl','false') #nmDisconnect()-Disconnects WLST from a Node Manager Session wls:/nm/oim_domain> nmDisconnect() #exit()-Exits WLST from the user session and closes the scripting shell. wls:/offline> exit()
Troubleshooting
Issue: The administration server fails to startup when you try to boot it up with Node Manager using WLST.
Fix: Create a boot.properties file for the administration server. Here is a guide to do so.
Error Messages:
#WLST
wls:/nm/base_domain> nmStart('AdminServer') Starting server AdminServer ... Error Starting server AdminServer: weblogic.nodemanager.NMException: Exception while starting server 'AdminServer'
#AdminServer.out
<Nov 24, 2013 8:22:29 PM EST> <Critical> <Security> <BEA-090403> <Authentication for user denied> <Nov 24, 2013 8:22:29 PM EST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: Authentication for user denied weblogic.security.SecurityInitializationException: Authentication for user denied at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:966) at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1054) at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873) at weblogic.security.SecurityService.start(SecurityService.java:141) at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64) Truncated. see log file for complete stacktrace Caused By: javax.security.auth.login.FailedLoginException: [Security:090304]Authentication Failed: User javax.security.auth.login.LoginException: [Security:090301]Password Not Supplied at weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.login(LDAPAtnLoginModuleImpl.java:261) at com.bea.common.security.internal.service.LoginModuleWrapper$1.run(LoginModuleWrapper.java:110) at com.bea.common.security.internal.service.LoginModuleWrapper.login(LoginModuleWrapper.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) Truncated. see log file for complete stacktrace
In order to start a managed server with nmStart() you need a startup.properties file in the servers directory under the domain.
ReplyDeleteFor example it would be located in /user_projects/domains//servers//data/nodemanager/startup.properties
This file can be generated by using the weblogic console to startup the server. It will send a request to nodemanager to start the server and it will generate the file.
Then you can use nmStart('managed_server') to start the server with the script.
If you don't have the startup.properties file, WLST will try to start the server as if it were the AdminServer.
Example startup.properties file:
#Server startup properties
#Wed Oct 07 11:32:03 EDT 2015
SSLArguments=-Dweblogic.security.SSL.ignoreHostnameVerification\=false -Dweblogic.ReverseDNSAllowed\=false
RestartMax=2
RestartDelaySeconds=0
RestartInterval=3600
AdminURL=http\://10.0.51.55\:7001
AutoRestart=true
AutoKillIfFailed=false