[Pacemaker] Bind virtual IP resource to service resource running state

Andrew Beekhof andrew at beekhof.net
Tue Apr 30 04:42:16 UTC 2013


On 26/04/2013, at 7:34 PM, Forum Registrant <forum.reg.1702 at gmail.com> wrote:

> Hi!
> 
> I have 2 node cluster. On each node I have mysql, nginx and php-fpm. Each node have it's own virtual IP. I need this virtual ip to migrate to other node if one of services (mysql/nginx/php-fpm) is down/stopped. How can I do it?

Colocation constraints.

> 
> !!! Scheme:
> ==- Normal situation:
> Node 1 (Core1.Test) 
> MySQL is running
> NginX is running
> Php-Fpm is running
> Core1_IP is on Node 1
> 
> Node 2 (vCore1.Test) 
> MySQL is running
> NginX is running
> Php-Fpm is running
> vCore1_IP is on Node 2
> 
> ==- If some service (for ex. MySQL on Node 1) failed or stopped:
> Node 1 (Core1.Test) 
> MySQL is stopped
> NginX is running
> Php-Fpm is running
> Core1_IP is on Node 2
> 
> Node 2 (vCore1.Test) 
> MySQL is running
> NginX is running
> Php-Fpm is running
> vCore1_IP is on Node 2
> Core1_IP is on Node 2
> 
> !!! My config:
> node Core1.Test \
>         attributes standby="off"
> node vCore1.Test\
>         attributes standby="off"
> primitive Core1_IP ocf:heartbeat:IPaddr2 \
>         params ip="192.168.0.139" nic="bond0"
> primitive P_MYSQL lsb:mysqld \
>         op monitor interval="5s" timeout="20s"
> primitive P_NGINX lsb:nginx \
>         op monitor interval="5s" timeout="20s"
> primitive P_PHP lsb:php-fpm \
>         op monitor interval="5s" timeout="20s"
> primitive vCore1_IP ocf:heartbeat:IPaddr2 \
>         params ip="192.168.0.141" nic="bond0"
> clone CL_MYSQL P_MYSQL \
>         params clone-max="2" clone-node-max="1" globally-unique="false"
> clone CL_NGINX P_NGINX \
>         params clone-max="2" clone-node-max="1" globally-unique="false"
> clone CL_PHP P_PHP \
>         params clone-max="2" clone-node-max="1" globally-unique="false"
> location L_MYSQL_01 CL_MYSQL 100: Core1.Test
> location L_MYSQL_02 CL_MYSQL 100: vCore1.Test
> location L_NGINX_01 CL_NGINX 100: Core1.Test
> location L_NGINX_02 CL_NGINX 100: vCore1.Test
> location L_PHP_01 CL_PHP 100: Core1.Test
> location L_PHP_02 CL_PHP 100: vCore1.Test
> location location_Core1_IP Core1_IP inf: Core1.Test
> location location_Core1_IP_2 Core1_IP 10: vCore1.Test
> location location_vCore1_IP vCore1_IP inf: vCore1.Test
> location location_vCore1_IP_2 vCore1_IP 10: Core1.Test
> property $id="cib-bootstrap-options" \
>         dc-version="1.1.8-7.el6-394e906" \
>         cluster-infrastructure="classic openais (with plugin)" \
>         expected-quorum-votes="2" \
>         no-quorum-policy="ignore" \
>         symmetric-cluster="false" \
>         stonith-enabled="false"
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org





More information about the Pacemaker mailing list