Monday, May 20, 2013

NodeManager


NodeManager setup and WebLogic startup with NodeManager

This is detailed guide for setting up the WebLogicServer NodeManager service and managing the WebLogicServer instance using this service. Also this post provides you an explanation on how to setup WebLogic Server processes to be automatically managed by Node Manager, when an OS instance is rebooted. When an OS instance is rebooted, WebLogic Server will return to the state as it was prior to the reboot.

Assuming the WebLogic Server installation has been done and a domain has been setup with the base configuration as you would like.

Note: Any information below should be updated to match your directory structures and information.
       - %WL_HOME% - C:\oracle\Middleware
       - %DOMAIN_NAME% - base_domain
       - %DOMAIN_HOME% -  C:\oracle\Middleware\user_projects\domains\base_domain 
       - %MACHINE_NAME% - localhost
       - Admin Server [Running] and ManagedServer [shutdown] in the domain

Installing the NodeManager service


      1. Open the Command Prompt
      2. Run %WL_HOME%\wlserver_10.3\server\bin\setWLSEnv.cmd to set Weblogic Environment variables like WL_HOME, JAVA_HOME, PATH, CLASSPATH etc..
      3. Edit the installNodeMgrSvc.cmd to bind to a hostname for remote starts
          set NODEMGR_HOST=localhost
      4. Now run the %WL_HOME%\wlserver_10.3\server\bin\installNodeMgrSvc.cmd
          Validate the service from the services list as well using the services.msc utility
         
      5. Start the NodeManager service named as above “Oracle WebLogic NodeManager…”
      6. Make sure starting the NodeManager service should create a  nodemanager.properties file under %WL_HOME%\wlserver_10.3\common\nodemanager

Setup NodeManager to restore servers to their last known state after a reboot
      
      1. Open nodemanager.properties located at %WL_HOME%\wlserver_10.3\common\nodemanager
      2. Set CrashRecoveryEnabled property value to true
          CrashRecoveryEnabled=true
      3. Set StartScriptEnabled property value to true to invoke the startWeblogic script
          StartScriptEnabled=true
      4. Set StopScriptEnabled property value to true to invoke the stopWeblogic script and get the managed servers to shutdown cleanly
         StopScriptEnabled=false 
      5. Restart of NodeManager service for each change to this nodemanager.properties file

Setup the machine
      
      1. Login to the AdminServer console
      2. Navigate through Domain Structure to %DOMAIN_NAME% -> Environment -> Machines
           
     3. Create a new machine
          Name : localhost
          OS     : Other - as my operating system is Windows 
                
      4. Create one machine for each instance of OS for a different host.
      5. Assign the ManagedServer to machines based on which machine the ManagedServer is hosted. Take Lock & Edit and navigate through %DOMAIN_NAME% -> Environment -> Machines -> %MACHINE_NAME% -> Configuration tab -> Servers tab
           
       6. Do not forget to save and Activate the changes.


Enrolling the domain with NodeManager     

       1. Open command prompt
       2. Run %DOMAIN_HOME%\bin\setDomainEnv.cmd to set domain specific environment variables
       3. Start WLST using java weblogic.WLST
       4. At WLS prompt connect to AdminServer using 
           connect ('weblogic','weblogic','t3://localhost:7001')
  
       5. Run nmEnroll(domainDir='C:/oracle/Middleware/user_pro
jects/domains/base_domain',nmHome='C:/oracle/Middleware/common/nodemanager')

 
           Make sure that you use forward slashes "/" instead of backward "\" as WLST does not recognize forward slashes
           If you use backward slashes "\" you get the below error.
  
        6. Once the domain is successfully enrolled with NodeManager the nodemanager.domains should be updated too with below values.
            #Thu Apr 28 11:54:41 MDT 2011
            base_domain=C\:\\Oracle\\Middleware\\user_projects\\domains\\base_domain  

            Also NodeManager should be reachable in AdminServer console. To validate this, 
            a. Login to AdminServer console
            b. Navigate through
%DOMAIN_NAME% -> Environment -> Machines -> %MACHINE_NAME% -> Monitoring -> Node Manager Status
              

Server Startup Configuration

      1. Login to the AdminServer console
      2. Navigate through Domain Structure to %DOMAIN_NAME% -> Environment -> Servers -> ManagedServer_1 -> Configuration tab -> Server Start tab
         
          
       3. Take Lock & Edit and input values as appropriate.
           Java Home - C:\oracle\Middleware\jdk160_14_R27.6.5-32 
               Java Vendor - Sun - As I am using Sun JDK 
               BEA Home - C:\oracle\Middleware 
               Root Directory - C:\oracle\Middleware\user_projects\domains\base_domain 
               Classpath - Can be left blank as we have configured the nodemanager.properties to use startWeblogic script in  Setup NodeManager to restore servers to their last known state after a reboot  step 3 and you can setup necessary values in that script. 
               Arguments - Can be left blank as we have configured the nodemanager.properties to use startWeblogic script in  Setup NodeManager to restore servers to their last known state after a reboot  step 3 and you can setup necessary values in that script. But i am using memory arguments as input here "-Xms64m -Xmx128m" 
               Security Policy File - C:\oracle\Middleware\wlserver_10.3\server\lib\weblogic.policy 
               User Name - weblogic 
               Password - weblogic 
               Confirm Password - weblogic
          
         
        4. Save and activate the changes
        5. Repeat steps 1-4 for each ManagedServer in the domain.

NodeManager Domain Username and password

        1. Login to the AdminServer console
        2. Click on Domain name in the Domain Structure and navigate through %DOMAIN_NAME% -> Security tab -> General tab -> Advanced link 
        3. Take Lock & Edit  and input the NodeManager username/password/confirm passwords fields and these could be unique from your weblogic console password. I have chosen to input same as my console credentials username: weblogic & password: weblogic. This setup would help user who use WLST to connect to NodeManager via nmConnect()
           
        4. Save and Activate the changes

Finally the setup is complete and now its time to start your ManagedServer in Admin console using NodeManager.

Starting the ManagedServer using the NodeManager setup

        1. Login to the AdminServer console
        2. Navigate through Domain Structure to %DOMAIN_NAME% -> Environment -> Servers -> ManagedServer_1 -> Control tab -> Start/Stop tab
          
          
        3. Under the Server Status section select the ManagedServer and click on start button
           
            When prompted to confirm the Action to be performed, click yes button
           
         4. Monitor the server logs and after a while the server should be in RUNNING state
            


Thanks,
Satya

No comments:

Post a Comment