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

Forum Registrant forum.reg.1702 at gmail.com
Fri Apr 26 05:34:58 EDT 2013


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?

!!! Scheme:
==- Normalsituation:
Node 1 (Core1.Test)
MySQL is running
NginX is running
Php-Fpm is running
Core1_IP is on Node1

Node 2 (vCore1.Test)
MySQL is running
NginX is running
Php-Fpm is running
vCore1_IP is on Node2

==- 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 Node2

Node 2 (vCore1.Test)
MySQL is running
NginX is running
Php-Fpm is running
vCore1_IP is on Node2
Core1_IP is on Node2

!!! 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"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clusterlabs.org/pipermail/pacemaker/attachments/20130426/02d653f8/attachment-0002.html>


More information about the Pacemaker mailing list