[Pacemaker] Extending CTS with other tests
Vit Pelcak
vpelcak at suse.cz
Tue Nov 30 12:32:24 UTC 2010
Dne 30.11.2010 13:14, Andrew Beekhof napsal(a):
>>>> 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.
Ah.
Got it.
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"''' % ("mount-dir", "ocfs2-disk"))
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''')
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"''' % ("disk", "mysql-dir", "fstype"))
self._create('''property no-quorum-policy="ignore" op monitor
interval="10" timeout="120" start-delay="10 params binary="%s"
pid="%s''' % ("mysql-exec", "mysql-pid"))
self._create('''primitive sql1 ocf:heartbeat:mysql''')
self._create('''colocation col-sql1 +inf: sql1 fs1''')
self._create('''order order-sql1 +inf: fs1 sql1''')
More information about the Pacemaker
mailing list