Node Manager as Linux service and Weblogic server autorestart

About

Blog

Privacy Policy

SiteMap

In order to have Node Manager start automatically it must be configured as a daemon. In order to do that, edit the below script to reflect your Weblogic installation path, then save it under /etc/init.d/nodemgr and run ‘chkconfig –add nodemgr’ as root.

#!/bin/sh # # nodemgr Oracle Weblogic NodeManager service # # chkconfig: 345 85 15 # description: Oracle Weblogic NodeManager service # The script needs to be saved as /etc/init.d/nodemgr and then issue chkconfig –add nodemgr as root ### 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 export MW_HOME=”/w01/oracle/bea” export JAVA_HOME=”/w01/jrrt-3.1.2-1.6.0″ DAEMON_USER=”oracle” PROCESS_STRING=”^.*/w01/oracle/bea/.*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

#!/bin/sh

# nodemgr Oracle Weblogic NodeManager service

# chkconfig: 345 85 15

# description: Oracle Weblogic NodeManager service

# The script needs to be saved as /etc/init.d/nodemgr and then issue chkconfig –add nodemgr as root

### 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

export MW_HOME=”/w01/oracle/bea”

export JAVA_HOME=”/w01/jrrt-3.1.2-1.6.0″

DAEMON_USER=”oracle”

PROCESS_STRING=”^.*/w01/oracle/bea/.*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

echo -n $”Starting $SERVICE_NAME: ”

/bin/su $DAEMON_USER -c “$PROGRAM &”

RETVAL=$?

echo

[ $RETVAL -eq 0 ] && touch $LOCKFILE

stop() {

echo -n $”Stopping $SERVICE_NAME: ”

if [ “$OLDPID” != “” ]; then

/bin/kill -TERM $OLDPID

else

/bin/echo “$SERVICE_NAME is stopped”

/bin/rm -f $NodeManagerLockFile

[ $RETVAL -eq 0 ] && rm -f $LOCKFILE

restart() {

stop

sleep 10

start

case “$1” in

start)

stop)

restart|force-reload|reload)

restart

condrestart|try-restart)

[ -f $LOCKFILE ] && restart

status)

/bin/echo “$SERVICE_NAME is running (pid: $OLDPID)”

echo $”Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}”

exit 1

esac

exit $RETVAL

Now the Node Manager can be controlled via the service command, for example to restart NM:

service nodemgr restart

With the NM restarting automatically after a system reboot, you might want the Weblogic managed server to act the same. To have the managed servers automatically restarted by Node Manager, you must activate the Autorestart option in the Administration Console as well as set the CrashRecoveryEnabled to ‘true’ in $WL_HOME/wlserver_10.3/common/nodemanager/nodemanager.properties.

Notice that the weblogic servers will be restarted after a machine reboot only if they were actually running at the time the shutdown command was issues.

You can also download the script in Unix format, by right clicking this link , ‘Save Link as…’ and then use it on Linux.

Share

Email

Tweet

Pocket

← Sending emails via command line

Cannot connect to Node Manager. : Access to domain for user ‘weblogic’ denied →

Vasan February 17, 2012 at 7:42 am No matter what I try the line “echo $”Usage:……….” continues to fail with “Command not found for each item in the list” I am using this Oracle Weblogic 12c on RHEL 5 PLEASE HELP! Thanks in advance Vasan Reply ↓

No matter what I try the line “echo $”Usage:……….” continues to fail with “Command not found for each item in the list” I am using this Oracle Weblogic 12c on RHEL 5 PLEASE HELP! Thanks in advance Vasan

radudobrinescu Post author February 17, 2012 at 8:18 am Hi Vasan, For me it works as expected: [oracle@fmw1 ~]$ echo $”Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}” Usage: -bash {start|stop|status|restart|reload|force-reload|condrestart} Can you make sure you have the ‘echo’ in the PATH? Execute ‘which echo’, it should return something like: [oracle@fmw1 ~]$ which echo /bin/echo Reply ↓

Hi Vasan,

For me it works as expected:

[oracle@fmw1 ~]$ echo $”Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}” Usage: -bash {start|stop|status|restart|reload|force-reload|condrestart}

Can you make sure you have the ‘echo’ in the PATH? Execute ‘which echo’, it should return something like:

[oracle@fmw1 ~]$ which echo /bin/echo

Vasan February 18, 2012 at 4:40 am Thanks. But, I resolved that problem – it was a minor syntax error. But now, I keep getting the error “line82:syntax error: unexpected end of file”, though the last line in the script is line81. Several searches on goole, told me that some earlier process is not closed. This is why the end command “esac” throws an error. I checked every line for all closed quotes and brackets. Still can’t find the issue. Any help is highly appreciated. Reply ↓ radudobrinescu Post author February 18, 2012 at 8:04 am If you are having synthax problems I suggest downloading the pdf file from the link at the end of the post, rather than copy-pasting the script from the post. It should not be a pdf file of course, but wordpress doesn’t allow .sh files. Simply download the file, change the extension and use it on your RHEL5 machine. Thanks, Radu Reply ↓

Thanks. But, I resolved that problem – it was a minor syntax error. But now, I keep getting the error “line82:syntax error: unexpected end of file”, though the last line in the script is line81. Several searches on goole, told me that some earlier process is not closed. This is why the end command “esac” throws an error. I checked every line for all closed quotes and brackets. Still can’t find the issue. Any help is highly appreciated.

radudobrinescu Post author February 18, 2012 at 8:04 am If you are having synthax problems I suggest downloading the pdf file from the link at the end of the post, rather than copy-pasting the script from the post. It should not be a pdf file of course, but wordpress doesn’t allow .sh files. Simply download the file, change the extension and use it on your RHEL5 machine. Thanks, Radu Reply ↓

If you are having synthax problems I suggest downloading the pdf file from the link at the end of the post, rather than copy-pasting the script from the post. It should not be a pdf file of course, but wordpress doesn’t allow .sh files. Simply download the file, change the extension and use it on your RHEL5 machine.

Thanks, Radu

Vikrant Korde June 8, 2012 at 6:21 am The document is not the PDF document. It is a text document. After download rename it to txt or something. Using the document is much simpler than copy+paste the contents manually… Reply ↓

The document is not the PDF document. It is a text document. After download rename it to txt or something. Using the document is much simpler than copy+paste the contents manually…

Liviu December 17, 2012 at 9:35 am Salut Ce surpriza sa dau peste tine aici! Nu mai gaseam init.d-ul si credeam ca am uitat locatia. De fapt, il cautam pe alta masina! Mult success! Liviu Copot Reply ↓ admin December 19, 2012 at 6:55 pm Salut, Liviu!! Da, frumoasa surpriza comentariul tau. 🙂 Merci frumos, succes si tie si sa auzim numai de bine! Reply ↓

Salut

Ce surpriza sa dau peste tine aici! Nu mai gaseam init.d-ul si credeam ca am uitat locatia. De fapt, il cautam pe alta masina!

Mult success!

Liviu Copot

admin December 19, 2012 at 6:55 pm Salut, Liviu!! Da, frumoasa surpriza comentariul tau. 🙂 Merci frumos, succes si tie si sa auzim numai de bine! Reply ↓

Salut, Liviu!! Da, frumoasa surpriza comentariul tau. 🙂 Merci frumos, succes si tie si sa auzim numai de bine!

jdean January 28, 2013 at 10:02 pm I had to replace all double quotes with unix non directional quotes””! Reply ↓

I had to replace all double quotes with unix non directional quotes””!

Pingback: Weblogic Server Auto Restart with Node Manager as Linux service | Rule of Tech

Daniel November 1, 2013 at 6:28 pm ❓ I tried to use your solution and I did install it as a service. But on my tests trying to start, stop, restart and get the status with the command service nodemgr start I get this v121d058:/dsv/dba:service nodemgr start ++ CLASSPATH=/u01/app/oracle/middleware/11g/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/middleware/11g/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0/lib/tools.jar:/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/middleware/11g/modules/features/weblogic.server.modules_10.3.6.0.jar:/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/middleware/11g/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/middleware/11g/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/u01/app/oracle/middleware/11g ++ ‘[‘ ‘!’ -z ” ‘]‘ ++ ‘[‘ ‘!’ -z ” ‘]‘ ++ export CLASSPATH ++ export PATH ++ cd /u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager ++ set -x ++ ‘[‘ ” ‘!=’ ” ‘]‘ ++ ‘[‘ start ‘!=’ ” ‘]‘ ++ /u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0/bin/java -jrockit -Xms128m -Xmx256m -Dcoherence.home=/u01/app/oracle/middleware/11g/coherence_3.7 -Dbea.home=/u01/app/oracle/middleware/11g -Xverify:none -Djava.security.policy=/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.nodemanager.javaHome=/u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0 -DListenAddress=start weblogic.NodeManager -v Nov 1, 2013 4:17:57 PM weblogic.nodemanager.server.NMServerConfig initDomainsMap INFO: Loading domains file: /u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.domains Nov 1, 2013 4:17:57 PM weblogic.nodemanager.server.NMServer INFO: Loaded node manager configuration properties from ‘/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.properties’ Node manager v10.3 Configuration settings: NodeManagerHome=/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager ListenAddress=start ListenPort=5556 ListenBacklog=50 SecureListener=false AuthenticationEnabled=true NativeVersionEnabled=true CrashRecoveryEnabled=true JavaHome=/u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0/jre StartScriptEnabled=true StopScriptEnabled=false StartScriptName=startWebLogic.sh StopScriptName= LogFile=/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.log LogLevel=INFO LogLimit=0 LogCount=1 LogAppend=true LogToStderr=true LogFormatter=weblogic.nodemanager.server.LogFormatter DomainsFile=/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.domains DomainsFileEnabled=true StateCheckInterval=500 UseMACBroadcast=false DomainRegistrationEnabled=false DomainsDirRemoteSharingEnabled=false Domain name mappings: dwcc_domain -> /u01/app/oracle/domains/dwcc_domain Nov 1, 2013 4:17:58 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Startup configuration properties loaded from “/u01/app/oracle/domains/dwcc_domain/servers/IBR_server2/data/nodemanager/startup.properties” Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Resume monitoring of active server process (pid = 21402) Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@1e60fe07 : with config : weblogic.nodemanager.common.StartupConfig@1e6d111a Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Startup configuration properties loaded from “/u01/app/oracle/domains/dwcc_domain/servers/UCM_server2/data/nodemanager/startup.properties” Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Resume monitoring of active server process (pid = 26020) Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@1e6d262c : with config : weblogic.nodemanager.common.StartupConfig@1e6d39ac java.net.UnknownHostException: start at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:876) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1229) at java.net.InetAddress.getAllByName0(InetAddress.java:1180) at java.net.InetAddress.getAllByName(InetAddress.java:1110) at java.net.InetAddress.getAllByName(InetAddress.java:1046) at java.net.InetAddress.getByName(InetAddress.java:996) at weblogic.nodemanager.server.Listener.(Listener.java:34) at weblogic.nodemanager.server.NMServer.start(NMServer.java:203) at weblogic.nodemanager.server.NMServer.main(NMServer.java:382) at weblogic.NodeManager.main(NodeManager.java:31) Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.NMServer main SEVERE: Fatal error in node manager server java.net.UnknownHostException: start at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:876) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1229) at java.net.InetAddress.getAllByName0(InetAddress.java:1180) at java.net.InetAddress.getAllByName(InetAddress.java:1110) at java.net.InetAddress.getAllByName(InetAddress.java:1046) at java.net.InetAddress.getByName(InetAddress.java:996) at weblogic.nodemanager.server.Listener.(Listener.java:34) at weblogic.nodemanager.server.NMServer.start(NMServer.java:203) at weblogic.nodemanager.server.NMServer.main(NMServer.java:382) at weblogic.NodeManager.main(NodeManager.java:31) Why? Reply ↓ admin November 2, 2013 at 9:49 pm Hi Daniel, From the error you are getting it seems that the hostname you have set up for your listen address is not being solved. Actually, off you check your nodemanager.properties file, I think your Listen Address is set to “start”. Doesn’t look like a valid hostname…you can also try to leave this parameter blank Reply ↓

I tried to use your solution and I did install it as a service. But on my tests trying to start, stop, restart and get the status with the command service nodemgr start I get this

v121d058:/dsv/dba:service nodemgr start ++ CLASSPATH=/u01/app/oracle/middleware/11g/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/middleware/11g/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0/lib/tools.jar:/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/weblogic.jar:/u01/app/oracle/middleware/11g/modules/features/weblogic.server.modules_10.3.6.0.jar:/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/webservices.jar:/u01/app/oracle/middleware/11g/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/middleware/11g/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/u01/app/oracle/middleware/11g ++ ‘[‘ ‘!’ -z ” ‘]‘ ++ ‘[‘ ‘!’ -z ” ‘]‘ ++ export CLASSPATH ++ export PATH ++ cd /u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager ++ set -x ++ ‘[‘ ” ‘!=’ ” ‘]‘ ++ ‘[‘ start ‘!=’ ” ‘]‘ ++ /u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0/bin/java -jrockit -Xms128m -Xmx256m -Dcoherence.home=/u01/app/oracle/middleware/11g/coherence_3.7 -Dbea.home=/u01/app/oracle/middleware/11g -Xverify:none -Djava.security.policy=/u01/app/oracle/middleware/11g/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.nodemanager.javaHome=/u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0 -DListenAddress=start weblogic.NodeManager -v

Nov 1, 2013 4:17:57 PM weblogic.nodemanager.server.NMServerConfig initDomainsMap INFO: Loading domains file: /u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.domains

Nov 1, 2013 4:17:57 PM weblogic.nodemanager.server.NMServer INFO: Loaded node manager configuration properties from ‘/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.properties’ Node manager v10.3

Configuration settings:

NodeManagerHome=/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager ListenAddress=start ListenPort=5556 ListenBacklog=50 SecureListener=false AuthenticationEnabled=true NativeVersionEnabled=true CrashRecoveryEnabled=true JavaHome=/u01/app/oracle/middleware/java/jrockit-jdk1.6.0_45-R28.2.7-4.1.0/jre StartScriptEnabled=true StopScriptEnabled=false StartScriptName=startWebLogic.sh StopScriptName= LogFile=/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.log LogLevel=INFO LogLimit=0 LogCount=1 LogAppend=true LogToStderr=true LogFormatter=weblogic.nodemanager.server.LogFormatter DomainsFile=/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.domains DomainsFileEnabled=true StateCheckInterval=500 UseMACBroadcast=false DomainRegistrationEnabled=false DomainsDirRemoteSharingEnabled=false

Domain name mappings:

dwcc_domain -> /u01/app/oracle/domains/dwcc_domain

Nov 1, 2013 4:17:58 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Startup configuration properties loaded from “/u01/app/oracle/domains/dwcc_domain/servers/IBR_server2/data/nodemanager/startup.properties”

Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Resume monitoring of active server process (pid = 21402)

Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@1e60fe07 : with config : weblogic.nodemanager.common.StartupConfig@1e6d111a

Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Startup configuration properties loaded from “/u01/app/oracle/domains/dwcc_domain/servers/UCM_server2/data/nodemanager/startup.properties”

Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Resume monitoring of active server process (pid = 26020)

Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.AbstractServerManager log INFO: Initializing ServerMonitor for weblogic.nodemanager.server.ServerManager@1e6d262c : with config : weblogic.nodemanager.common.StartupConfig@1e6d39ac

java.net.UnknownHostException: start at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:876) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1229) at java.net.InetAddress.getAllByName0(InetAddress.java:1180) at java.net.InetAddress.getAllByName(InetAddress.java:1110) at java.net.InetAddress.getAllByName(InetAddress.java:1046) at java.net.InetAddress.getByName(InetAddress.java:996) at weblogic.nodemanager.server.Listener.(Listener.java:34) at weblogic.nodemanager.server.NMServer.start(NMServer.java:203) at weblogic.nodemanager.server.NMServer.main(NMServer.java:382) at weblogic.NodeManager.main(NodeManager.java:31)

Nov 1, 2013 4:17:59 PM weblogic.nodemanager.server.NMServer main SEVERE: Fatal error in node manager server java.net.UnknownHostException: start at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:876) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1229) at java.net.InetAddress.getAllByName0(InetAddress.java:1180) at java.net.InetAddress.getAllByName(InetAddress.java:1110) at java.net.InetAddress.getAllByName(InetAddress.java:1046) at java.net.InetAddress.getByName(InetAddress.java:996) at weblogic.nodemanager.server.Listener.(Listener.java:34) at weblogic.nodemanager.server.NMServer.start(NMServer.java:203) at weblogic.nodemanager.server.NMServer.main(NMServer.java:382) at weblogic.NodeManager.main(NodeManager.java:31)

Why?

admin November 2, 2013 at 9:49 pm Hi Daniel, From the error you are getting it seems that the hostname you have set up for your listen address is not being solved. Actually, off you check your nodemanager.properties file, I think your Listen Address is set to “start”. Doesn’t look like a valid hostname…you can also try to leave this parameter blank Reply ↓

Hi Daniel,

From the error you are getting it seems that the hostname you have set up for your listen address is not being solved. Actually, off you check your nodemanager.properties file, I think your Listen Address is set to “start”. Doesn’t look like a valid hostname…you can also try to leave this parameter blank

Daniel November 4, 2013 at 11:08 am That is not the point. I just run the command to start the nodemanager service. service nodemgr start, like any other linux service. service And the script is passing the start option as argument ahead. Reply ↓

That is not the point. I just run the command to start the nodemanager service.

service nodemgr start, like any other linux service. service

And the script is passing the start option as argument ahead.

Daniel November 4, 2013 at 11:15 am Also, the line displayed by the startup script of nodemanager ListenAddress=start is not configured inside the nodemanager.properties. It is beeing displayed but not written inside the file Reply ↓ radudobrinescu Post author November 6, 2013 at 2:30 pm Can you share your ‘/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.properties’ file then? Reply ↓

Also, the line displayed by the startup script of nodemanager ListenAddress=start is not configured inside the nodemanager.properties. It is beeing displayed but not written inside the file

radudobrinescu Post author November 6, 2013 at 2:30 pm Can you share your ‘/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.properties’ file then? Reply ↓

Can you share your ‘/u01/app/oracle/middleware/11g/wlserver_10.3/common/nodemanager/nodemanager.properties’ file then?

Steven February 19, 2014 at 12:47 pm Thanks for the script, it works as expected! One minor issue with the script is that it writes info to the system console. This can be fixed with as small modification of the PROGRAM variable definition. PROGRAM=”$MW_HOME/wlserver_10.3/server/bin/startNodeManager.sh > $NodeManagerHome/nodemanager.out 2>&1″ With this fix a new file “nodemanager.out” is written to the NodeManagerHome. Regards, Steven. Reply ↓ Radu Dobrinescu Post author February 19, 2014 at 1:20 pm Thanks for sharing, Steven! Reply ↓

Thanks for the script, it works as expected!

One minor issue with the script is that it writes info to the system console. This can be fixed with as small modification of the PROGRAM variable definition.

PROGRAM=”$MW_HOME/wlserver_10.3/server/bin/startNodeManager.sh > $NodeManagerHome/nodemanager.out 2>&1″

With this fix a new file “nodemanager.out” is written to the NodeManagerHome.

Regards, Steven.

Radu Dobrinescu Post author February 19, 2014 at 1:20 pm Thanks for sharing, Steven! Reply ↓

Thanks for sharing, Steven!

Siva Pokuri June 24, 2014 at 3:45 pm It worked like a champ. Nice Post. — Siva Pokuri. http://findiamsolution.blogspot.com Reply ↓

It worked like a champ. Nice Post.

— Siva Pokuri. http://findiamsolution.blogspot.com

Pingback: Linux Server Management Danish's Story | Danish's Story

Gaurav Dua January 9, 2015 at 11:10 am Hi All, I used the script and put the same inside /sbin/init.d folder on my HP-UX B.11.31 m/c. Also created a soft link as S910nodemgr1 -> /sbin/init.d/nodemgr inside /sbin/rc3.d folder. As the system reboots node manager process starts and it start 1 admin server and then shuts down automatically. Don’t know why??? The node manager should have restarted all servers under its control and were running during server shutdown but it itself gets shutdown after starteing1 admin server only. The process is up for few seconds and there are no logs related to it inside nodemanager log files. Please help. Reply ↓

Hi All,

I used the script and put the same inside /sbin/init.d folder on my HP-UX B.11.31 m/c. Also created a soft link as S910nodemgr1 -> /sbin/init.d/nodemgr inside /sbin/rc3.d folder.

As the system reboots node manager process starts and it start 1 admin server and then shuts down automatically. Don’t know why??? The node manager should have restarted all servers under its control and were running during server shutdown but it itself gets shutdown after starteing1 admin server only. The process is up for few seconds and there are no logs related to it inside nodemanager log files. Please help.

Tj May 18, 2016 at 1:17 pm I have a problem in running the script. Added the script to /etc/init.d/nodemgr. UNIX startup script can be executed only by root ID. After that i am facing issues with the files and PID owned by root. 1) Node manager pid owning by root id even though we wrote “/bin/su $DAEMON_USER -c “$PROGRAM &”” and only root id have access to excecute bin/su command 2) User oracle cannot run the service nodemgr as we dont have access to bin/su 3) LOCKFILE getting create with user Root when run by rootID and and the other way User oracle dint have access to the LOCKFILE directory or lock file owned by User RootID. Please let us know how to solve the issue? Regards, TJ. Reply ↓

I have a problem in running the script. Added the script to /etc/init.d/nodemgr. UNIX startup script can be executed only by root ID. After that i am facing issues with the files and PID owned by root. 1) Node manager pid owning by root id even though we wrote “/bin/su $DAEMON_USER -c “$PROGRAM &”” and only root id have access to excecute bin/su command 2) User oracle cannot run the service nodemgr as we dont have access to bin/su 3) LOCKFILE getting create with user Root when run by rootID and and the other way User oracle dint have access to the LOCKFILE directory or lock file owned by User RootID.

Please let us know how to solve the issue?

Regards, TJ.

Pingback: Setup Nodemanager as a service in Linux – irfanjdecnc

Moon August 30, 2017 at 11:06 pm After server boot up I am able to start node manager and managed server. But not able to start up the Admin server. Could you please help me out. Reply ↓

After server boot up I am able to start node manager and managed server. But not able to start up the Admin server. Could you please help me out.

C February 4, 2018 at 1:58 pm Deploying nodemanager as a service: ============= [oracle@oraofm init.d]$ pwd /etc/rc.d/init.d [oracle@oraofm init.d]$ su – root Password: [root@oraofm ~]# pwd /root [root@oraofm ~]# cd /etc/rc.d/init.d [root@oraofm init.d]# cp -p /u05/soft/nodemanger_auto_start_scripts/nodemanager . [root@oraofm init.d]# ls -lrt nodem* -rwxr-xr-x. 1 oracle oinstall 2592 Feb 4 06:06 nodemanager [root@oraofm init.d]# chkconfig –add nodemanager [root@oraofm init.d]# chkconfig nodemanager on [root@oraofm init.d]# ===== [root@oraofm init.d]# pwd /etc/rc.d/init.d [root@oraofm init.d]# ls -lrt nodemanager -rwxr-xr-x. 1 oracle oinstall 2592 Feb 4 06:06 nodemanager [root@oraofm init.d]# === Usage === [oracle@oraofm scripts]$ service nodemanager status === Issues === I keep on getting “Usage: /etc/init.d/nodemanager {start|stop|status|restart|reload|force-reload|condrestart}” output on the command line. What is wrong with the scripts?, I tried to adapt for 12c. === [oracle@oraofm scripts]$ service nodemanager status Usage: /etc/init.d/nodemanager {start|stop|status|restart|reload|force-reload|condrestart} ===== Scripts ==== #!/bin/sh # # nodemgr Oracle Weblogic NodeManager service # # chkconfig: 345 85 15 # description: Oracle Weblogic NodeManager service # The script needs to be saved as /etc/init.d/nodemgr and then issue chkconfig –add nodegr as root ### 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 export DOMAIN_HOME=”/u01/app/oracle/user_projects/domains/forms_domain” export JAVA_HOME=”/u01/app/oracle/product/JAVA/jdk” export WL_HOME=”/u01/app/oracle/product/FMW/Oracle_Home/wlserver” DAEMON_USER=”oracle” PROCESS_STRING=”^.*/u01/app/oracle/user_projects/domains/forms_domain/.*weblogic.NodeManager.*” source $DOMAIN_HOME/bin/setDomainEnv.sh > /dev/null export NodeManagerHome=”$DOMAIN_HOME/nodemanager” NodeManagerLockFile=”$NodeManagerHome/nodemanager.log.lck” PROGRAM=”$DOMAIN_HOME/bin/startNodeManager.sh > $NodeManagerHome/nodemanager.out 2>&1″ 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 Reply ↓

Deploying nodemanager as a service: ============= [oracle@oraofm init.d]$ pwd /etc/rc.d/init.d [oracle@oraofm init.d]$ su – root Password: [root@oraofm ~]# pwd /root [root@oraofm ~]# cd /etc/rc.d/init.d [root@oraofm init.d]# cp -p /u05/soft/nodemanger_auto_start_scripts/nodemanager . [root@oraofm init.d]# ls -lrt nodem* -rwxr-xr-x. 1 oracle oinstall 2592 Feb 4 06:06 nodemanager [root@oraofm init.d]# chkconfig –add nodemanager [root@oraofm init.d]# chkconfig nodemanager on [root@oraofm init.d]# =====

[root@oraofm init.d]# pwd /etc/rc.d/init.d [root@oraofm init.d]# ls -lrt nodemanager -rwxr-xr-x. 1 oracle oinstall 2592 Feb 4 06:06 nodemanager [root@oraofm init.d]# === Usage === [oracle@oraofm scripts]$ service nodemanager status === Issues === I keep on getting “Usage: /etc/init.d/nodemanager {start|stop|status|restart|reload|force-reload|condrestart}” output on the command line. What is wrong with the scripts?, I tried to adapt for 12c. === [oracle@oraofm scripts]$ service nodemanager status

Usage: /etc/init.d/nodemanager {start|stop|status|restart|reload|force-reload|condrestart}

===== Scripts ==== #!/bin/sh # # nodemgr Oracle Weblogic NodeManager service # # chkconfig: 345 85 15 # description: Oracle Weblogic NodeManager service # The script needs to be saved as /etc/init.d/nodemgr and then issue chkconfig –add nodegr as root

### 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

export DOMAIN_HOME=”/u01/app/oracle/user_projects/domains/forms_domain” export JAVA_HOME=”/u01/app/oracle/product/JAVA/jdk” export WL_HOME=”/u01/app/oracle/product/FMW/Oracle_Home/wlserver” DAEMON_USER=”oracle” PROCESS_STRING=”^.*/u01/app/oracle/user_projects/domains/forms_domain/.*weblogic.NodeManager.*”

source $DOMAIN_HOME/bin/setDomainEnv.sh > /dev/null export NodeManagerHome=”$DOMAIN_HOME/nodemanager” NodeManagerLockFile=”$NodeManagerHome/nodemanager.log.lck”

PROGRAM=”$DOMAIN_HOME/bin/startNodeManager.sh > $NodeManagerHome/nodemanager.out 2>&1″ SERVICE_NAME=`/bin/basename $0` LOCKFILE=”/var/lock/subsys/$SERVICE_NAME”

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

Your email address will not be published.

Comment

Name

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

Dealing with Stuck Threads in WebLogic

Unable to start WLST: "Could Not Find or Load Main Class weblogic.WLST"

How To Improve Weblogic Servers Startup Time

WebLogic 12c Enterprise Deployment Architecture in the Amazon Cloud

Cannot connect to Node Manager. : Access to domain for user 'weblogic' denied

WebLogic AdminServer startup and shutdown scripts

Setting up Watches and Notifications in Weblogic Server

Passing arguments to WLST scripts

Setting up SOA 11g XA Transaction Timeouts - General Rules and Recommendations

Report File System Usage Across All Hosts with EM Cloud Control 12c