Hi,
On Fri, Feb 08, 2008 at 03:57:47PM -0500, Eddie C wrote:
> OK a few questions:
>
> Firstly--
> WS_PID=`ps -ef | grep /usr/bin/pen | grep $OCF_RESKEY_control_port |
> grep -v grep | awk '{print $2}'`
>
> I guess this is primitive, but I only have a fundamental understanding
> of awk and regex. What do you suggest replacing the above lines with ?
You could try with this:
WS_PID=`ps -ef | grep "/usr/bin/[p]en.*$OCF_RESKEY_control_port" | awk '{print
$2}'`
> Secondly--
> Are your saying that with the monitor operation I should do an OSI
> Level 7 check?
> That is not always easy because pen can balance any protocol. I can't
> use wget could be LDAP. It would be hard to make the check modular.
> I could use NC to check for an open port.
> I can send a signal to pen and see that it responds.
>
> What do you suggest?
Depends on how the program behaves. It should be enough just to
check if the process is there (using kill -0 or ps). Sometimes,
if the application's not very reliable, a deeper check would be
required, such as opening a connection. A full service check is
the best, but it seems like that in this case it would be really
hard to implement.
Thanks,
Dejan
>
>
>
>
>
> On Feb 8, 2008 2:01 PM, Eddie C <[EMAIL PROTECTED]> wrote:
> > I will take your notes and edit the script.
> >
> > As for the statement about LVS, I wish I could get LVS to work right.
> > I have taken three or four runs at it. I never find a full complete
> > doc that works. I usually have problems with NO-ARP interfaces,
> > configurations showing steps in V1 not V2, and running LVS on the same
> > server as the back ends. It seems like LVS-NAT is the easiest but that
> > is the one I can not use in our deployments. Some docs I find are even
> > talking about 2.4 kernel and some docs say I need ARP tables. From the
> > information I find I am never sure if a step is needed or its not.
> > (I'm running CENT5 FYI). I am probably just missing simple
> > things....but
> >
> > I do agree that LVS is a more graceful option. Pen has some pluses. It
> > is simple and you can kick it up command line. Compared to LVS I can
> > backend something on a completely different network without tunneling.
> > In some installs it might be the solution.
> >
> > Edward
> >
> >
> > On Feb 8, 2008 12:36 PM, Lars Marowsky-Bree <[EMAIL PROTECTED]> wrote:
> > > On 2008-02-08T10:50:31, Eddie C <[EMAIL PROTECTED]> wrote:
> > >
> > > > pen 8080 host1:80 host2:80
> > > >
> > > > This makes it ideal work as an RA, because the load balancer (ok its a
> > > > proxy but close enough) can fail over to any node without having to
> > > > worry about synchronizing configuration files.
> > >
> > > You could do something very similar with LVS as well, btw. No need for
> > > any daemon.
> > >
> > > > #!/bin/sh
> > > > # Edward Guy Capriolo
> > > > # Pen RA: Used to start the pen proxy from linux HA
> > > > #
> > > > # OCF parameters are as below
> > >
> > > This lacks a GPL-license header, and I'd recommend to add one saying to
> > > use GPLv2 or v3.
> > >
> > >
> > > > pen_stop() {
> > > > WS_PID=`ps -ef | grep /usr/bin/pen | grep
> > > > $OCF_RESKEY_control_port | grep -v grep | awk '{print $2}'`
> > > > if [ "$WS_PID" = "" ] ; then
> > > > echo "pen is already stopped"
> > > > return $OCF_SUCCESS
> > > > else
> > > > kill $WS_PID
> > > > echo "pen stopped [OK]"
> > > > return $OCF_SUCCESS
> > > > fi
> > > >
> > > > exit $OCF_SUCCESS
> > > > }
> > >
> > > Code like that always makes me a big worried ;-) The last exit statement
> > > can never be reached.
> > >
> > > > pen_monitor() {
> > > > WS_PID=`ps -ef | grep /usr/bin/pen | grep
> > > > $OCF_RESKEY_control_port | grep -v grep | awk '{print $2}'`
> > > > if [ "$WS_PID" = "" ] ; then
> > > > return $OCF_NOT_RUNNING
> > > > else
> > > > return $OCF_SUCCESS
> > > > fi
> > > >
> > > > return $OCF_ERR_GENERIC
> > > > }
> > >
> > > Same here. The error test code should probably be done separately - if
> > > it is running, check it.
> > >
> > > (The WS_PID search also seems like something which would benefit from
> > > being put into a function so you don't have to repeat it. Chaing grep
> > > with awk also fails to use awk and is needlessly complicated.)
> > >
> > >
> > > Regards,
> > > Lars
> > >
> > > --
> > > Teamlead Kernel, SuSE Labs, Research and Development
> > > SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N?rnberg)
> > > "Experience is the name everyone gives to their mistakes." -- Oscar Wilde
> > >
> > >
> > > _______________________________________________
> > > Linux-HA mailing list
> > > [email protected]
> > > http://lists.linux-ha.org/mailman/listinfo/linux-ha
> > > See also: http://linux-ha.org/ReportingProblems
> > >
> >
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems