Friday, October 15, 2010

Start Stop Weblogic Server(s)


There are many ways to start & stop weblogic Admin and managed server(s)

You can start/stop Admin Server using -


[A]  Script
[B]  "java weblogic.server" command
       [ The weblogic.Server class is the main class for a WebLogic Server instance ]
[C]  From startup option on windows
[D]  WLST with or without node manager

.
You can start managed server(s) using - 

[A]  scripts
[B]  admin console
[C]  using WLST
[D]  using node manager
[E]  java weblogic.server command
       [ The weblogic.Server class is the main class for a WebLogic Server instance ]


USING SCRIPTS


Script To Start Admin Server
startWebLogic.cmd or .sh

Script to start Managed Server

startManagedWebLogic.sh or .cmd
.
To Start WebLogic Administration Server

Go to domain your domain directory

cd $ORACLE_HOME/user_projects/domains/<your_domain_name>/bin

On Window run below script
startWebLogic.cmd

On unix/Linux, run below script
$ ./startWebLogic.sh

Once server start successfully, you will see below message in the server log file
" <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>"

Note : - Admin server log file you will find under DOMAIN/servers/<Admin_Server_Name>/logs with name as  your_admin_server_name.log as well as your_admin_server_name.out if you are starting using node manager.

To start Managed Server

Go to  YOUR_DOMAIN/bin
$ORACLE_HOME/user_projects/domains/<domain_name>/bin

On windows -
startManagedWebLogic.cmd [ name_of_your_managed_server ]  [ admin_server_url ]

For example -

To start managed server with name ManSer1 where admin server running on localhost on port 7001
startManagedWebLogic.cmd ManSer1 http://localhost:7001


Note :- 

If you want to start and stop managed servers from admin console then make sure to use node manager otherwise you will get an error message that there is no associated machine with the managed server like below.

Message icon - Warning The server JJTU_Server-1 does not have a machine associated with it.

 In this case make sure to create a machine associated with an running active node manager and then assign server to that node manager.


START USING weblogic.server command

To start admin server

First got to your domain/bin and run setDomainEnv.sh, then run below commands

$ java -Dweblogic.Name=<Admin_Server_Name> -Dweblogic.ConfigFile=config.xml -Dweblogic.RootDirectory=<Path_Of_Your_Domain_Directory>  weblogic.Server

Example - 

java -Dweblogic.Name=JJTU_AdminServer -Dweblogic.ConfigFile=C:\Oracle\Middleware2\user_projects\domains\JJTU_Domain1\config\config.xml -Dweblogic.RootDirectory=C:\Oracle\Middleware2\user_projects\domains\JJTU_Domain1  weblogic.Server


To start Managed Server

First got to your domain/bin and run setDomainEnv.sh, then run below commands


java -Dweblogic.Name=YOUR_MANAGED_SERVER_NAME -Dweblogic.management.server=http://<HOSTNAME_WHERE_ADMIN_RUNNING>:<ADMIN_SERVER_PORT> -Dweblogic.RootDirectory=<Path_Of_Your_Domain_Directory> weblogic.Server

Example - 

java -Dweblogic.Name=ManSer1 -Dweblogic.management.server=http://localhost:7001 -Dweblogic.RootDirectory=C:\Oracle\Middleware2\user_projects\domains\JJTU_Domain1 weblogic.Server

where my admin server running on localhost on port 7001 and managed server name is ManSer1 and  C:\Oracle\Middleware2\user_projects\domains\JJTU_Domain1 is my domain directory


To Start/Stop Using WLST


Note - Make sure to modify host, port, path, server names according to your environment on below mentioned commands

Go to your domain/bin directory

run setDomainEnv.[cmd][sh]

Go to WLST prompt

java weblogic.WLST

start node manager using WLST ( if not running there otherwise skip to next step  )

startNodeManager(verbose='true',NodeManagerHome='C:\\Oracle\\Middleware\\wlserver_12.1\\common\\nodemanager',ListenPort='40046',ListenAddress='localhost')

Connect With Node Manager

nmConnect('weblogic','webl0gic','localhost','40046','JJTU_Domain1','C:\\Oracle\\Middleware2\\user_projects\\domains\\JJTU_Domain1','plain')

Start Admin Server

nmStart('JJTU_AdminServer')

To Start Managed Server

connect with admin server

connect('weblogic','webl0gic','localhost:40510')

Start Managed Server

start('ManSer1')



20 comments:

  1. Can you please give the command to stop the weblogic instance.
    Thank you

    ReplyDelete
  2. For an Administration Server -
    -----------------------------------------
    DOMAIN_NAME/bin/stopWeblogic.sh username password admin_url

    For Managed Servers
    --------------------------------------------
    DOMAIN_NAME/bin/stopManagedWeblogic.sh managed_server_name admin_url username password

    Each WebLogic Server instance runs in its own JVM. If you are unable to shut down a server instance using the methods described in the previous sections, you can use an operating system command to kill the JVM.

    kill -9

    find processid with $ps -ef|grep -i you_server_name

    ReplyDelete
  3. what's the difference between the startWebLogic script in the 'domain' folder and the startWebLogic script in the 'domain\bin' folder?

    ReplyDelete
  4. please explain all ways to start adminserver and managed server with an example.

    ReplyDelete
  5. java\jdk1.6.0_05\lib\tools.jar was unexpected at this time, how to remove this error

    ReplyDelete
    Replies
    1. because of there may be space in the installation path of java.
      reinstall java in a path without spaces. changed the java_home correspondingly and start.

      Delete
  6. This comment has been removed by a blog administrator.

    ReplyDelete
  7. Any one tell the weblogic server real time issues

    ReplyDelete
  8. Hi , please could you let me know what are the regular/common production issues in weblogic application server .

    ReplyDelete
  9. Hi i installed weblogic 10.3.5 ......and i cannot start admin server.....even command prompt is not opening......some times i create new domain and tried ...but no use
    .. please help me on this

    Thank you,

    ReplyDelete
  10. Hi

    I am trying to follow the set up of the web logic and how to start up and shut down the Oracle Fusion Middleware, procedures and Oracle Fusion Middleware components.

    Kindly let me know which one to install from the oracl website and the steps for installation and creating your own managed server and others.

    Thank you

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Hi Mukesh, i m not able to start nodemanager. how to start nodemanager and how i will start managed server using nodemanager. Please explain the exact path.

    ReplyDelete
  13. Hi,

    I wanted to create a script and add that as a service on windows/Linux to start Weblogic Admin and managed servers after machine reboot.

    Please advise.

    Thanks,
    Ashutosh

    ReplyDelete
  14. Hello Ashutosh,

    Check my blog for that

    http://myoraclebusinessintelligence.blogspot.com/2014/01/creating-script-and-add-that-as-service.html

    Thanks,

    ReplyDelete
  15. Hi mukesh , when we have to run setDomainEnv.sh or .cmd script?

    ReplyDelete