Re: [ClusterLabs] Loadbalancing using Pacemaker

2015-11-08 Thread user . clusterlabs . org

> On 8. nov. 2015, at 16.24, Michael Schwartzkopff  wrote:
> 
> Am Samstag, 7. November 2015, 09:40:47 schrieb didier tanti:
>> Hello, i am new to Pacemaker and have a question concerning how to have my
>> cluster services aware of the state and location of the other services in
>> the cluster.  Example:
>> Service A is running on Host XService B1 is running on Host XService B2 is
>> running on Host Y Which API would allow my Service A to send IPC messages
>> to services B1 and B2 in a round robin manner?(for example how Service A
>> would be aware of which B is up and active (B1, B2 or both), and how A
>> would even be able to know on which host B1 or B2 is running?) It looks
>> very basic but i cannot find information on this on clusterlabs.org Is
>> there basic tutorial that would explain how to achieve this ? (I guess i
>> would need to link my service binaries with some pacemaker /corosync libs
>> and use some API ?) Thanks for helping out,
> 
> Hi,
> 
> this task is beyond the ability of pacemaker. Your application has to know 
> how 
> to handle that.
> 
> Best solution would be to use virtual IP addresses for services B1 and B2
Yes and maybe through a IP load balancer like nginx or haproxy to do the round 
robin

 
> make sure that the IP addresses run together with the services. Now you 
> service A only has to talk to the IP addresses, no matter on which host they 
> run.
> 
> pacemaker could take care that they run on different hosts is possible.
> 
> Mit freundlichen Grüßen,
> 
> Michael Schwartzkopff
> 
> -- 
> [*] sys4 AG
> 
> http://sys4.de, +49 (89) 30 90 46 64, +49 (162) 165 0044
> Franziskanerstraße 15, 81669 München
> 
> Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
> Vorstand: Patrick Ben Koetter, Marc Schiffbauer
> Aufsichtsratsvorsitzender: Florian 
> Kirstein___
> Users mailing list: Users@clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org


___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


Re: [ClusterLabs] Howto use ocf:heartbeat:nginx check level > 0

2015-11-08 Thread user . clusterlabs . org

> On 8. nov. 2015, at 10.26, user.clusterlabs@siimnet.dk wrote:
> 
> Setting up my first pacemaker cluster, I’m trying to grasp howto make 
> ocf:heartbeat:nginx monitor with check levels > 0.
> 
> Got this so far:
> 
> [root@afnA ~]# pcs resource
>  Resource Group: afnGroup
>  afnVIP (ocf::heartbeat:IPaddr2):   Started afnA 
>  afnNGinx   (ocf::heartbeat:nginx): Started afnA 
> 
> [root@afnA ~]# pcs resource show afnNGinx
>  Resource: afnNGinx (class=ocf provider=heartbeat type=nginx)
>   Attributes: configfile=/opt/imail/nginx/conf/nginx.conf port=8080 
> httpd=/opt/imail/nginx/sbin/nginx options="-p /opt/imail/nginx" 
> status10url=/ping status10regex=".+ is alive\." 
>   Operations: start interval=0s timeout=60s (afnNGinx-start-interval-0s)
>   stop interval=0s timeout=60s (afnNGinx-stop-interval-0s)
>   monitor interval=10s timeout=20s (afnNGinx-monitor-interval-10s)
>   monitor interval=60s timeout=20s (afnNGinx-monitor-interval-60s)
> [root@afnA ~]# 
> 
> but I cant verify that pacemaker RA ever calls http://localhost:8080/ping 
> , why not?
> 
> Any pointers to info source(s) for better understanding RA configuration and 
> maybe specially check levels?

Found this: 
http://clusterlabs.org/doc/en-US/Pacemaker/1.0/html/Pacemaker_Explained/s-operation-monitor-multiple.html
 


This seemed to work much better:

[root@afnA ~]# pcs resource show afnNGinx
 Resource: afnNGinx (class=ocf provider=heartbeat type=nginx)
  Attributes: configfile=/opt/imail/nginx/conf/nginx.conf port=8080 
httpd=/opt/imail/nginx/sbin/nginx options="-p /opt/imail/nginx" 
status10url=http://localhost:8080/ping status10regex="mss[0-9] is alive\." 
  Meta Attrs: target-role=Started 
  Operations: start interval=0s timeout=60s (afnNGinx-start-interval-0s)
  stop interval=0s timeout=60s (afnNGinx-stop-interval-0s)
  monitor interval=10s timeout=10s (afnNGinx-monitor-interval-10s)
  monitor interval=120s timeout=30s OCF_CHECK_LEVEL=10 
(afnNGinx-monitor-interval-120s)

=>

127.0.0.1 - - [08/Nov/2015:11:34:25 +0100] "GET /ping HTTP/1.1" 200 16 "-" 
"curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC 
zlib/1.2.3 libidn/1.18 libssh2/1.4.2"
127.0.0.1 - - [08/Nov/2015:11:36:25 +0100] "GET /ping HTTP/1.1" 200 16 "-" 
"curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC 
zlib/1.2.3 libidn/1.18 libssh2/1.4.2"
127.0.0.1 - - [08/Nov/2015:11:38:25 +0100] "GET /ping HTTP/1.1" 200 16 "-" 
"curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC 
zlib/1.2.3 libidn/1.18 libssh2/1.4.2"
127.0.0.1 - - [08/Nov/2015:11:40:25 +0100] "GET /ping HTTP/1.1" 200 16 "-" 
"curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC 
zlib/1.2.3 libidn/1.18 libssh2/1.4.2"


[root@afnA]# pcs --version
0.9.139

https://www.mankier.com/8/pcs  seems to indicate 
a debug-monitor command only my pcs version doesn’t seem to support this, might 
it only be in a later version, also I can seem to find ocf-tester from CentOS 6 
repository, where might I find ocf-tester rpm?

/Steffen___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


Re: [ClusterLabs] Loadbalancing using Pacemaker

2015-11-08 Thread Michael Schwartzkopff
Am Samstag, 7. November 2015, 09:40:47 schrieb didier tanti:
> Hello, i am new to Pacemaker and have a question concerning how to have my
> cluster services aware of the state and location of the other services in
> the cluster.  Example:
> Service A is running on Host XService B1 is running on Host XService B2 is
> running on Host Y Which API would allow my Service A to send IPC messages
> to services B1 and B2 in a round robin manner?(for example how Service A
> would be aware of which B is up and active (B1, B2 or both), and how A
> would even be able to know on which host B1 or B2 is running?) It looks
> very basic but i cannot find information on this on clusterlabs.org Is
> there basic tutorial that would explain how to achieve this ? (I guess i
> would need to link my service binaries with some pacemaker /corosync libs
> and use some API ?) Thanks for helping out,

Hi,

this task is beyond the ability of pacemaker. Your application has to know how 
to handle that.

Best solution would be to use virtual IP addresses for services B1 and B2. 
make sure that the IP addresses run together with the services. Now you 
service A only has to talk to the IP addresses, no matter on which host they 
run.

pacemaker could take care that they run on different hosts is possible.

Mit freundlichen Grüßen,

Michael Schwartzkopff

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64, +49 (162) 165 0044
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein

signature.asc
Description: This is a digitally signed message part.
___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


Re: [ClusterLabs] Loadbalancing using Pacemaker

2015-11-08 Thread didier tanti
Thank You Michael,
In fact I spent some more time looking at documentions and indeed Pacemaker is 
only used for resource control and management. To have my HA solution I will 
need to use Corosync directly as well. The OpenAIS API is pretty well described 
and I am starting to understand what must be done (basically link my binaries 
with corosync and use the messages and other APIs to have a accurate states of 
remote objects/services). 
As for the Virtual IP I believe it makes more sense to use it in case of 
Active/Standby services. In my case B services being both active i would need 
to implement the load balancing within service A (using openAIS/Corosync API to 
be updated of service B state changes and how to reach the service B I have 
elected through round robin). For those specific components I don't foreseen 
the need of Virtual IP. However I may use VIP for my service A and other 
components!
Thanks, 


 Le Dimanche 8 novembre 2015 16h24, Michael Schwartzkopff  a 
écrit :
   

 Am Samstag, 7. November 2015, 09:40:47 schrieb didier tanti:
> Hello, i am new to Pacemaker and have a question concerning how to have my
> cluster services aware of the state and location of the other services in
> the cluster.  Example:
> Service A is running on Host XService B1 is running on Host XService B2 is
> running on Host Y Which API would allow my Service A to send IPC messages
> to services B1 and B2 in a round robin manner?(for example how Service A
> would be aware of which B is up and active (B1, B2 or both), and how A
> would even be able to know on which host B1 or B2 is running?) It looks
> very basic but i cannot find information on this on clusterlabs.org Is
> there basic tutorial that would explain how to achieve this ? (I guess i
> would need to link my service binaries with some pacemaker /corosync libs
> and use some API ?) Thanks for helping out,

Hi,

this task is beyond the ability of pacemaker. Your application has to know how 
to handle that.

Best solution would be to use virtual IP addresses for services B1 and B2. 
make sure that the IP addresses run together with the services. Now you 
service A only has to talk to the IP addresses, no matter on which host they 
run.

pacemaker could take care that they run on different hosts is possible.

Mit freundlichen Grüßen,

Michael Schwartzkopff

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64, +49 (162) 165 0044
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein

  ___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org