On Thu, Jul 14, 2011 at 1:51 AM, RNZ <[email protected]> wrote:
> I make next resource agent -
> https://github.com/rnz/resource-agents/blob/master/heartbeat/couchdb
> At end of file exist next example configuration:
> ------------
>  node vub001
>  node vub002
>  primitive couchdb-1 ocf:heartbeat:couchdb \
>  params dbuser="user" dbpass="pass"
> replcmds="http://admin:[email protected]:5984/testdb,http://admin:[email protected]:5984/testdb,true;http://admin:[email protected]:5984/testdb1,http://admin:[email protected]:5984/testdb1,true;";
> \
>  op start interval="0" timeout="20s" \
>  op stop interval="0" timeout="20s" \
>  op monitor interval="10s" \
>  meta target-role="Started"
>  primitive couchdb-2 ocf:heartbeat:couchdb \
>  params dbuser="user" dbpass="pass"
> replcmds="http://admin:[email protected]:5984/testdb,http://admin:[email protected]:5984/testdb,true;http://admin:[email protected]:5984/testdb1,http://admin:[email protected]:5984/testdb1,true;";
> \
>  op start interval="0" timeout="20s" \
>  op stop interval="0" timeout="20s" \
>  op monitor interval="10s" \
>  meta target-role="Started"
>  primitive vIP ocf:heartbeat:IPaddr2 \
>  params ip="192.168.1.10" nic="eth1" \
>  op start interval="0" timeout="20s" \
>  op stop interval="0" timeout="20s" \
>  op monitor interval="5s" timeout="20s" depth="0" \
>  meta target-role="Started"
>  location cdb-1-c couchdb-1 inf: vub001
>  location cdb-1-p couchdb-1 -inf: vub002
>  location cdb-2-c couchdb-2 inf: vub002
>  location cdb-2-p couchdb-2 -inf: vub001
>  location vIP_c vIP 100: vub001
>  location vIP_p vIP 10: vub002
>  property $id="cib-bootstrap-options" \
>  cluster-infrastructure="openais" \
>  expected-quorum-votes="2" \
>  no-quorum-policy="ignore" \
>  stonith-enabled="false" \
>  symmetric-cluster="false" \
>  rsc_defaults $id="rsc-options" \
>  resource-stickiness="110"
> ----------
> One CouchDB resources infinite stay per node, because use
> master-master/multi-master replication. And  I want to make easy couchdb
> replication, without use external files for configuration of replication.
>
> Need resource vIP migrate to next node by check fail/stop state resource
> couchdb (per node).
> How make it in pacemaker configuration?

I think you want to be using the Master/Slave construct of pacemaker.
That would let you colocate the vIP with instances of couchdb with the
master role.

>
> May be use "location rule: #uname " or need additional RA for control state
> (as pingd)?
> May use next method:
> #!/bin/bash
> curl -s http://127.0.0.1:5984 | grep -q 'couchdb'
> if [ $? != 0 ]; then
> #... add control by crm_mon of started couchdb on current node
> crm resource migrate vIP
> crm configure delete cli-standby-vIP
> fi
>
> But I think, this is not good....
>
>
> P.S. Sorry for my bad English...
>
> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
>
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to