Starting and stopping WebLogic Server

Web-Logic Server provides several ways to start and stop server instances. The method that you choose depends on whether you prefer using the Administration Console or a command-line interface, and on whether you are using Node Manager to manage the server's life cycle.

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 ]

Start Web-Logic Server

  1. From a command prompt, go to [appserver root]/user_projects/domains/[appserverdomain].
  2. Enter the following command:
    •  startWebLogic.cmd <Windows>
    •  ./startWebLogic.sh <Linux>

Stop WebLogic Server
  1. Start WebLogic Server Administration Console by typing http://[host name]:7001/console in the URL line of a web browser.
  2. Log in by typing the user name and password that was used when creating this WebLogic configuration, and then click Log In.
  3. Under Change Center, click Lock & Edit.
  4. Under Domain Structure, click Environment > Servers.
  5. Click AdminServer and, on the Settings for AdminServer pane, click the Control tab.
  6. Ensure that AdminServer is selected in the Server Status table and click Shutdown.
  7. Select When Work Completes to gracefully shut down the server or select Force Shutdown Now to stop the server immediately without completing ongoing tasks.
  8. On the Server Life Cycle Assistant pane, click Yes to complete the shutdown.
The WebLogic Server Administration Console is no longer available, and the command prompt that you ran the start command from is available.

Start WebLogic Administration Console

  1. If WebLogic Admin Server is not already running, from a command prompt, go to the [appserver root]\user_projects\domains\[domainname] directory, and enter the following command:
    • (Windows) startWebLogic.cmd
    • (Linux, UNIX) ./startWebLogic.sh
  2. Access WebLogic Server Administration Console by typing http://[host name]:[Port]/console in the URL line of a web browser, where [Port] is the non-secure listening port. By default, this port value is 7001.
  3. On the login screen, type your administrator user name and password, and click Log In.

Start Node Manager

  1. Ensure that WebLogic Server is running.
  2. From a new command prompt, go to [appserver root]/server/bin.
  3. Enter the following command:
    • (Windows) startNodeManager.cmd
    • (Linux, UNIX) ./startNodeManager.sh

Stop Node Manager

After you shut down WebLogic Server, you can close the command prompt from which you called Node Manager.

Start a WebLogic managed server

Note: This task can be performed only after you create a WebLogic domain and a managed server.
  1. Ensure that the WebLogic Server and Node Manager are running.
  2. Start WebLogic Server Administration Console by typing http://[host name]:[port]/console in the URL line of a web browser.
  3. Under Domain Structure, click Environment > Servers.
  4. In the right pane, click the Control tab.
  5. Select the managed server that you want to start.
  6. Click the Start button below the managed server you want to start.

Stop a WebLogic managed server

  1. Start WebLogic Server Administration Console by typing http://[host name]:[port]/console in the URL line of a web browser.
  2. Under Domain Structure, click Environment > Servers.
  3. In the right pane, click the Control tab.
  4. Select the managed server that you want to stop.
  5. Click the Shutdown button below the managed server you want to stop.
  6. Select When Work Completes to gracefully shut down the server or select Force Shutdown Now to stop the server immediately without completing ongoing tasks.
  7. On the Server Life Cycle Assistant pane, click Yes to complete the shutdown.
********************************************************************************

$ # Start NodeManager
$ nohup $WLS_HOME/server/bin/startNodeManager.sh > /dev/null 2>&1 &


$ # Start WebLogic
$ nohup /u01/app/oracle/config/domains/mydomain/startWebLogic.sh > /dev/null 2>&1 &
$ # or
$ nohup /u01/app/oracle/config/domains/mydomain/bin/startWebLogic.sh > /dev/null 2>&1 &

$ # Stop WebLogic
$ /u01/app/oracle/config/domains/mydomain/bin/stopWebLogic.sh


$ # Start Managed Server
$ nohup /u01/app/oracle/config/domains/mydomain/bin/startManagedWebLogic.sh AdminServer > /dev/null 2>&1 &

$ # Stop Managed Server
$ /u01/app/oracle/config/domains/mydomain/bin/stopManagedWebLogic.sh AdminServer


$ # Start the configuration wizard
$ $WLS_HOME/common/bin/config.sh


*****************************************************************************************

 start Administration Server in WebLogic
1.Using startup script
2. From Windows Start Menu (windows only)
3. Using “java weblogic.Server” command
4. Using WLST (WebLogic Scripting Tool) and Node Manager
5. Using WLST without Node Manager
.
 start Managed Server in WebLogic 
1.Using startup script
2. Using Administration Console
3. Using WLST and Node Manager
4. Using “java weblogic.Server” command
 .
1. Starting Administration Server (startWebLogic.cmd or .sh)
2. Starting Managed Server (startManagedWebLogic.sh or .cmd)
.
A. To Start WebLogic Administration Server Instance
Go to domain for which you wish to start Administration Server
cd $BEA_HOME/user_projects/domains/<domain_name>/bin
startWebLogic.cmd (for Windows)
startWebLogic.sh (for Unix)
confirm that WebLogic Adminstration Server started properly by looking at message “Service started RUNNING mode“. Log file in below picture shows thatAdminSever is listening on Port 7001 and all IP addresses on specific machine.
Startup/Shutdown Log file can be found at $BEA_HOME/ user_projects/ domains/ <domain_name> /servers/<ServerName> /logs / <ServerName>.log
.
B. Start Managed Server Instance
If you created Managed Server while creating domain then you can start Managed Server using startManagedWebLogic command
$BEA_HOME/user_projects/domains/<domain_name>/bin
startManagedWebLogic.cmd <managed_server_name> <admin_url> (for Windows)
startManagedWebLogic.sh  <managed_server_name> <admin_url> (for Unix)
I created Managed Server MS1 with Admin Port as 7001
startManagedWebLogic.cmd ms1 http://localhost:7001 (Windows)



Weblogic Server Auto Restart with Node Manager as Linux service


For example on Red Hat Enterprise Linux Server 5.8 with Oracle Weblogic Server 10.3.5 the/etc/init.d/nodemgr looks like this (edit the script to reflect your Weblogic installation path):

#!/bin/sh
#
# nodemgr Oracle Weblogic NodeManager service
#
# chkconfig:   345 85 15
# description: Oracle Weblogic NodeManager service

### BEGIN INIT INFO
# Provides: nodemgr
# Required-Start: $network $local_fs
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Oracle Weblogic NodeManager service.
# Description: Starts and stops Oracle Weblogic NodeManager.
### END INIT INFO

. /etc/rc.d/init.d/functions

# Your WLS home directory (where wlserver_10.3 is)
export MW_HOME="/oracle/product/mw11g"
export JAVA_HOME="/oracle/java/jdk1.6.0_29"
DAEMON_USER="oracle"
PROCESS_STRING="^.*/oracle/product/mw11g/.*weblogic.NodeManager.*"

source $MW_HOME/wlserver_10.3/server/bin/setWLSEnv.sh > /dev/null
export NodeManagerHome="$WL_HOME/common/nodemanager"
NodeManagerLockFile="$NodeManagerHome/nodemanager.log.lck"

PROGRAM="$MW_HOME/wlserver_10.3/server/bin/startNodeManager.sh"
SERVICE_NAME=`/bin/basename $0`
LOCKFILE="/var/lock/subsys/$SERVICE_NAME"

RETVAL=0

start() {
        OLDPID=`/usr/bin/pgrep -f $PROCESS_STRING`
        if [ ! -z "$OLDPID" ]; then
            echo "$SERVICE_NAME is already running (pid $OLDPID) !"
            exit
        fi

        echo -n $"Starting $SERVICE_NAME: "
        /bin/su $DAEMON_USER -c "$PROGRAM &"

        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch $LOCKFILE
}

stop() {
        echo -n $"Stopping $SERVICE_NAME: "
        OLDPID=`/usr/bin/pgrep -f $PROCESS_STRING`
        if [ "$OLDPID" != "" ]; then
            /bin/kill -TERM $OLDPID
        else
            /bin/echo "$SERVICE_NAME is stopped"
        fi
        echo
        /bin/rm -f $NodeManagerLockFile
        [ $RETVAL -eq 0 ] && rm -f $LOCKFILE

}

restart() {
        stop
        sleep 10
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|force-reload|reload)
        restart
        ;;
  condrestart|try-restart)
        [ -f $LOCKFILE ] && restart
        ;;
  status)
        OLDPID=`/usr/bin/pgrep -f $PROCESS_STRING`
        if [ "$OLDPID" != "" ]; then
            /bin/echo "$SERVICE_NAME is running (pid: $OLDPID)"
        else
            /bin/echo "$SERVICE_NAME is stopped"
        fi
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
        exit 1
esac

exit $RETVAL


Add the Node Manager to start after server reboot:
# chmod +x /etc/init.d/nodemgr
# chkconfig --add nodemgr
# chkconfig --list
nodemgr         0:off   1:off   2:off   3:on    4:on    5:on    6:off
Also now the Node Manager can be controlled via the service command (e.g. service nodemgr restart).
When you have the Node Manager restarting automatically after a system reboot, you can also have Weblogic managed servers automatically restarted by Node Manager. Managed servers will be restarted only if they were running at the time the shutdown was issued. Just activate the Auto Restart option in the Administration Console (Environment > Servers > selected server > Health Monitoring) and you might also need to set the CrashRecoveryEnabled to “true” in $WL_HOME/wlserver_10.3/common/nodemanager/nodemanager.properties.

No comments:

ORA-00059: Maximum Number Of DB_FILES Exceeded in 19C database

When I am adding datafile to my 19C database facing the below error. SQL> alter tablespace DATA  add datafile '/u01/data/data15.dbf&#...