[Pacemaker] Migrate resources based on connectivity

Dan Frincu dfrincu at streamwide.ro
Wed Oct 13 09:04:05 UTC 2010


Hi,

Pavlos Parissis wrote:
> On 12 October 2010 20:00, Dan Frincu <dfrincu at streamwide.ro> wrote:
>   
>> Hi,
>>
>> Lars Ellenberg wrote:
>>
>> On Mon, Oct 11, 2010 at 03:50:01PM +0300, Dan Frincu wrote:
>>
>>
>> Hi,
>>
>> Dejan Muhamedagic wrote:
>>
>>
>> Hi,
>>
>> On Sun, Oct 10, 2010 at 10:27:13PM +0300, Dan Frincu wrote:
>>
>>
>> Hi,
>>
>> I have the following setup:
>> - order drbd0:promote drbd1:promote
>> - order drbd1:promote drbd2:promote
>> - order drbd2:promote all:start
>> - collocation all drbd2:Master
>> - all is a group of resources, drbd{0..3} are drbd ms resources.
>>
>> I want to migrate the resources based on ping connectivity to a
>> default gateway. Based on
>> http://www.clusterlabs.org/wiki/Pingd_with_resources_on_different_networks
>> and http://www.clusterlabs.org/wiki/Example_configurations I've
>> tried the following:
>> - primitive ping ocf:pacemaker:ping params host_list=1.2.3.4
>> multiplier=100 op monitor interval=5s timeout=5s
>> - clone ping_clone ping meta globally-unique=false
>> - location ping_nok all \
>>   rule $id="ping_nok-rule" -inf: not_defined ping_clone or
>> ping_clone number:lte 0
>>
>>
>> Use pingd to reference the attribute in the location constraint.
>>
>>
>> Not to be disrespectful, but after 3 days being stuck on this issue,
>> I don't exactly understand how to do that. Could you please provide
>> an example.
>>
>> Thank you in advance.
>>
>>
>> The example you reference lists:
>>
>> 	primitive pingdnet1 ocf:pacemaker:pingd \
>> 		params host_list=192.168.23.1 \
>> 			name=pingdnet1
>> 			^^^^^^^^^^^^^^
>>
>> 	clone cl-pingdnet1 pingdnet1
>> 			   ^^^^^^^^^
>>
>> param name default is pingd,
>> and is the attribute name to be used in the location constraints.
>>
>> You will need to reference pingd in you location constraint, or set an
>> explicit name in the primitive definition, and reference that.
>>
>> Your ping primitive sets the default 'pingd' attribute,
>> but you reference some 'ping_clone' attribute,
>> which apparently no-one really references.
>>
>>
>>
>> I've finally managed to finish the setup with the indications received
>> above, the behavior is the expected one. Also, I've tried the
>> ocf:pacemaker:pingd and even though it does the reachability tests properly,
>> it fails to update the cib upon restoring the connectivity, I had to
>> manually run attrd_updater -R to get the resources to start again, therefore
>> I'm going with ocf:pacemaker:ping.
>>
>>     
> it would be quite useful for the rest of people if you post your final
> and working configuration.
> Cheers,
> Pavlos
>   
The relevant stuff is related to the group and ping location constraint.

primitive _/ping_gw/_ ocf:pacemaker:ping \
        params host_list="1.1.1.99" multiplier="100" *name="ping_gw_name" *\
        op monitor interval="5s" timeout="60s" \
        op start interval="0s" timeout="60s"
group all virtual_ip_1 virtual_ip_2 Failover_Alert fs_home fs_mysql 
fs_storage httpd mysqld \
        meta target-role="Started"
ms ms_drbd_home drbd_home \
        meta notify="true" globally-unique="false" target-role="Started" 
master-max="1" master-node-max="1" clone-max="2" clone-node-max="1"
ms ms_drbd_mysql drbd_mysql \
        meta notify="true" globally-unique="false" target-role="Started" 
master-max="1" master-node-max="1" clone-max="2" clone-node-max="1"
ms ms_drbd_storage drbd_storage \
        meta notify="true" globally-unique="false" target-role="Started" 
master-max="1" master-node-max="1" clone-max="2" clone-node-max="1"
clone ping_gw_clone _/ping_gw/_ \
        meta globally-unique="false" target-role="Started"
location nok_ping_to_gw all \
        rule $id="nok_ping_to_gw-rule" -inf: not_defined *ping_gw_name* 
or *ping_gw_name* lte 0
colocation all_on_home inf: all ms_drbd_home:Master
colocation all_on_mysql inf: all ms_drbd_mysql:Master
colocation all_on_storage inf: all ms_drbd_storage:Master
order all_after_storage inf: ms_drbd_storage:promote all:start
order ms_drbd_home_after_ms_drbd_mysql inf: ms_drbd_mysql:promote 
ms_drbd_home:promote
order ms_drbd_storage_after_ms_drbd_home inf: ms_drbd_home:promote 
ms_drbd_storage:promote
property $id="cib-bootstrap-options" \
        expected-quorum-votes="2" \
        stonith-enabled="false" \
        symmetric-cluster="true" \
        dc-version="1.0.9-89bd754939df5150de7cd76835f98fe90851b677" \
        no-quorum-policy="ignore" \
        cluster-infrastructure="openais" \
        last-lrm-refresh="1286905225"
rsc_defaults $id="rsc-options" \
        multiple-active="block" \
        resource-stickiness="1000"

I hope this helps.

Regards,

Dan
> _______________________________________________
> 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://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>   

-- 
Dan FRINCU
Systems Engineer
CCNA, RHCE
Streamwide Romania

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20101013/5eeeadc4/attachment-0002.htm>


More information about the Pacemaker mailing list