People ask me why they should configure WebSphere Application Server (WAS) nodeagents/dmgr (deployment manager) as a service on Linux. Here is the answer!
Think of a situation when one of the WAS servers goes down due to an unknown reason. If you have a clustered environment, the deployment manager (dmgr) keeps eye on the members through nodeagents. When it sees that one of the member servers is down, it will try to bring the server up automatically. So here you don't need to worry. Dmgr is your savior!
Now think of a situation when a nodeagent of a node goes down for an unknown reason. If any of the servers on this node now goes down due to an unknown reason, dmgr will not be able start it as it has no communication channel (nodeagent is down!). If you would have any other custom monitoring in place, you may get notification about the server being down and you may take a manual action to bring the server and the nodeagent up. But this may take considerable amount of time.
How to prevent this situation?
Here comes the importance of running the nodeagent as a linux (or for that matter windows) server. You can configure nodeagent to run as a Linux service to start automatically if it goes down for unknown reason. There are also other options possible while setting up nodeagent to run as a service.
You may configure to run as a specific user. This option can be used to run a nodeagent as a non-root user.
You may configure the service to start automatically or manually on reboot of the system.
In following example, the service is configured to run as wasadmin user, the nodeagent will be brought up automatically if it goes down due to an unknown reason and the nodeagent will not start automatically on system reboot.
#!/bin/sh
# Initialization
if [ -z "$4" ]
then
echo "Usage: ./installNodeagentService.sh "
exit -1
fi
echo installing nodeagent of profile $1 as service, with logroot for node: $2 and userid: $3 by executing wasservice.sh
${WASBIN}/wasservice.sh -add $1 -serverName nodeagent -profilePath "${PROFILEROOT}/$1" -wasHome "${WASROOT}" -logFile "$2/nodeagent/startServer.log" -logRoot "$2/nodeagent" -userid $3 -password $4 -restart true -startType manual
Note: To configure Linux Service you need root (sudo) access, but once service is configured you will not need root access. Thus you must run above script as root or with sudo. If you don't have either talk to your linux administrator.
In the same manner dmgr can also be configured to run as a Linux Service.