You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@manifoldcf.apache.org by Marcello Lorenzi <ml...@sorint.it> on 2013/11/06 17:09:29 UTC

Manifold agent stop unclean

Hi All,
I'm trying to install and testing the Manifold agent on a clustered
environment based on CentOS 6, and I noticed a strange behavior of agent
when the JVM PID were killed manually without using the stop-agents.sh
scripts. In fact after the kill if I try to start the agent I noticed
this messages "Agent already in use" and I couldn't start the agent.

The only solution is to run locks-clean.sh script to mitigate the issue,
but to run this script I have to stop the agent and the webconsole.

Is it a correct procedure to cleanup the environment ?

Thanks,
Marcello




Re: Manifold agent stop unclean

Posted by Marcello Lorenzi <ml...@sorint.it>.
Hi Karl,
my question was related in specify case when the server where Apache
Manifold is running dies for hardware or OS problems. In this case a
would undestand the best scenario to recover the situation and create an
automatic procedure.

To check this behavior I wrote a Red Hat Cluster agent to move a
Manifold Agent on a 2 nodes cluster with the *-agent.sh scripts and I
fixed the nohup.out file into a specific directory. The nohup.out file
will be monitored by Nagios to identify the logging "Agent already in
use" and the cluster fails the startup of agent when unclean situation
happend before.

Marcello

On 11/06/2013 05:09 PM, Marcello Lorenzi wrote:
> Hi All,
> I'm trying to install and testing the Manifold agent on a clustered
> environment based on CentOS 6, and I noticed a strange behavior of agent
> when the JVM PID were killed manually without using the stop-agents.sh
> scripts. In fact after the kill if I try to start the agent I noticed
> this messages "Agent already in use" and I couldn't start the agent.
>
> The only solution is to run locks-clean.sh script to mitigate the issue,
> but to run this script I have to stop the agent and the webconsole.
>
> Is it a correct procedure to cleanup the environment ?
>
> Thanks,
> Marcello
>
>
>


Re: Manifold agent stop unclean

Posted by Karl Wright <da...@gmail.com>.
Hi Marcello,

The only correct way to shut down a ManifoldCF process is to either use
stop-agents.sh, use ^C, or use plain "kill".  "kill -9" will leave dangling
things around and should be avoided.  If you do kill a process in this way,
then the proper steps are:

(1) Shut down ALL ManifoldCF processes
(2) Run lock-clean.sh
(3) Start the processes back up

Thanks,
Karl



On Wed, Nov 6, 2013 at 11:09 AM, Marcello Lorenzi <ml...@sorint.it>wrote:

> Hi All,
> I'm trying to install and testing the Manifold agent on a clustered
> environment based on CentOS 6, and I noticed a strange behavior of agent
> when the JVM PID were killed manually without using the stop-agents.sh
> scripts. In fact after the kill if I try to start the agent I noticed
> this messages "Agent already in use" and I couldn't start the agent.
>
> The only solution is to run locks-clean.sh script to mitigate the issue,
> but to run this script I have to stop the agent and the webconsole.
>
> Is it a correct procedure to cleanup the environment ?
>
> Thanks,
> Marcello
>
>
>
>

Re: Manifold agent stop unclean

Posted by Mark Libucha <ml...@gmail.com>.
Marcello,

Not sure if this is recommended, but this is what I'm using to start/stop
MCF on CentOS 6. Seems to work fairly well, but I'm not in a production
environment at this point.

I know it doesn't directly address the issue with the agent JVM pid being
killed outside of stop-agents.sh, but adding nohup into the mix minimizes
the likelihood that that happens, to me, anyway.

start.sh:

#!/bin/bash -e
nohup ./start-agents.sh > agents.out 2>&1&
nohup ./start-webapps.sh > webapps.out 2>&1&
echo $! > webapps.pid

stop.sh:

#!/bin/bash -e
./stop-agents.sh
pid=$(<"webapps.pid")
if [[ -z "$pid" ]] ; then
    echo No webapps pid.
    exit 1
fi
gid=$(ps opgid= "$pid")
pkill -TERM -g $gid


Mark


On Wed, Nov 6, 2013 at 8:09 AM, Marcello Lorenzi <ml...@sorint.it> wrote:

> Hi All,
> I'm trying to install and testing the Manifold agent on a clustered
> environment based on CentOS 6, and I noticed a strange behavior of agent
> when the JVM PID were killed manually without using the stop-agents.sh
> scripts. In fact after the kill if I try to start the agent I noticed
> this messages "Agent already in use" and I couldn't start the agent.
>
> The only solution is to run locks-clean.sh script to mitigate the issue,
> but to run this script I have to stop the agent and the webconsole.
>
> Is it a correct procedure to cleanup the environment ?
>
> Thanks,
> Marcello
>
>
>
>