[Pacemaker] Extending CTS with other tests

Andrew Beekhof andrew at beekhof.net
Tue Nov 30 12:14:42 UTC 2010


On Tue, Nov 30, 2010 at 12:41 PM, Vit Pelcak <vpelcak at suse.cz> wrote:
> Dne 30.11.2010 11:21, Andrew Beekhof napsal(a):
>>
>> On Thu, Nov 25, 2010 at 1:36 PM, Vit Pelcak<vpelcak at suse.cz>  wrote:
>>>
>>> Hello everyone.
>>>
>>> I ran into problem.
>>>
>>> I cannot format ocfs2 partition with pcmk until "primitive o2cb
>>> ocf:ocfs2:o2cb" is running. Right?
>>
>> Probably
>
> I have tested mkfs.ocfs2 as Tim suggested and it works. So whole cluster
> configuration could be done by cts now and only mkfs would be ran by script.
>
>>> Now I'm quite unsure. I could prepare ocfs2 partition with pcmk and just
>>> reuse it, but maybe you will come up with better idea.
>>>
>>> I added script I use for adding ocfs2 resource (cluster is expected to be
>>> running and have some stonith ready) to attachment. It works fine so far.
>>>
>>> Frankly, I'm quite clueless how to get this into CTS as I'm not much into
>>> Python. Maybe if somebody could help me how to get some easier scenario
>>> into
>>> CTS, I'd be able to figure out other scenarios as well.
>>
>> The script is fine up to the point where you add ocf:heartbeat:Filesystem.
>> It can stop after you do the mkfs.
>>
>> Copy the HASI class (which already has the logic for adding the dlm
>> and o2cb resources) in CIB.py and add the Filesystem resource line to
>> the end of add_resources().
>> You'll probably need to add the cmirror and clvm parts there too.
>
> This is class for full OCFS2 configuretion (except STONITH):
>
> class OCFS2(CIB10):
>    def add_resources(self):
>        self._create('''primitive clvm ocf:lvm2:clvmd op start interval="0"
> timeout="90s" op stop interval="0" timeout="100s"''')
>        self._create('''primitive cmirror ocf:lvm2:cmirrord op start
> interval="0" timeout="90s" op stop interval="0" timeout="100s"''')
>        self._create('''primitive dlm ocf:pacemaker:controld op start
> interval="0" timeout="90s" op stop interval="0" timeout="100s"''')
>        self._create('''primitive o2cb ocf:ocfs2:o2cb op start interval="0"
> timeout="90s" op stop interval="0" timeout="100s"''')
>        self._create('''primitive ocfs2 ocf:heartbeat:Filesystem params
> directory="%s" fstype="ocfs2" device="%s" op monitor interval="20"
> timeout="40" op start interval="0" timeout="60s" op stop interval="0"
> timeout="60s"''')
>        self._create('''group o2stage dlm clvm o2cb cmirror''')
>        self._create('''clone c-o2stage o2stage meta interleave="true"''')
>        self._create('''clone c-ocfs2 ocfs2 meta interleave="true"
> ordered="true"''')
>        self._create('''colocation colo-ocfs2-o2stage inf: c-ocfs2
> c-o2stage''')
>        self._create('''order order-ocfs2-o2stage 0: c-o2stage c-ocfs2''')
>
> I put in also interval so there are no issues with them.
>
>>> I have put into attachment the one reasonably easy. It is about mounting
>>> ext3 partition into mysql dir and then running mysql.
>>>
>>> Problem here is, that doing so is not enough. I spotted, that is is
>>> needed
>>> to manually restart mysql when that ext3 partition is mounted (and chmod
>>> needs to run before it as well, otherwise mysql has not write permission
>>> there and crashes). Only after that resource starts and works properly.
>>>
>>> So far, I have created:
>>>
>>> class MYSQL(CIB10):
>>>    def add_resources(self):
>>>        self._create('''primitive fs1 ocf:heartbeat:Filesystem op monitor
>>> interval="20" timeout="40" start-delay="10" params device="%s"
>>> directory="%s" fstype="%s"''')
>>
>> you're using "...=%s", but then not passing in any value.  thats not
>> going to work.
>> think of it like a printf
>
> I understand it. But this is just class declaration. So it would be called
> elsewhere.

Not really. This is creating resources in the cib - the definitions
need to be complete.

>
>>>        self._create('''property no-quorum-policy="ignore" op monitor
>>> interval="10" timeout="120" start-delay="10 params binary="%s"
>>> pid="%s''')
>>>        self._create('''primitive sql1 ocf:heartbeat:mysql''')
>>>        self._create('''colocation col-sql1 +inf: sql1 fs1''')
>>>        self._create('''order order-sql1 +inf: fs1 sql1''')
>>
>> Where are your ocfs2 resources?
>
> This is different task. It is about ext3 fs being mounted into dir
> /var/lib/mysql (I didn't specify it in case other distros have it elsewhere)
> and then mysql being ran.
>
> Class with OCFS2 is mentioned above.
>
> Thanks all for help.
>
> Regards
> Vit Pelcak
>
>
> _______________________________________________
> 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
>




More information about the Pacemaker mailing list