Results 1 to 3 of 3

Thread: How to trigger a restart of the clone service

Hybrid View

  1. #1

    How to trigger a restart of the clone service

    Hi Guys,

    Have a cluster of multiple nodes, which has a primitive resource, say 'R' and a clone resource 'C' (which should be running on all nodes).
    Now the requirement is that whenever resource 'R' fails, 'C' should restart on the node where 'R' was running. Even if 'R' restarts on the same node, 'C' should have been restarted on the same node. But if 'R' gets migrated due to migration-threshold achieved, 'C' may not be restarted on target node.

    My both resources 'R' and 'C' are systemd services. I am not able to find a way to achieve the above. Can somebody help ?

    Thanks

  2. #2

    Re: How to trigger a restart of the clone service

    Quote Originally Posted by mnshsnghl View Post
    Hi Guys,

    Have a cluster of multiple nodes, which has a primitive resource, say 'R' and a clone resource 'C' (which should be running on all nodes).
    Now the requirement is that whenever resource 'R' fails, 'C' should restart on the node where 'R' was running. Even if 'R' restarts on the same node, 'C' should have been restarted on the same node. But if 'R' gets migrated due to migration-threshold achieved, 'C' may not be restarted on target node.

    My both resources 'R' and 'C' are systemd services. I am not able to find a way to achieve the above. Can somebody help ?

    Thanks

    So you have 2 services 'R' & 'C'.
    Then you need first to clone 'C'.
    As 'C' depends on 'R' ,you want 'C-clone' to be restarted when 'R' restarts, right ?

    This looks like the dlm & clvmd dependency but one of them is regular resource.

    You have to:
    1. Create a clone for 'C'
    2. Set 2 order constraints (1 -> C starts after R, 2 -> C stops before R) that C is started after R. When R get migrated 'C-clone' will be stopped first, then R is started, then C-clone is started
    You can use 'crm help' to check the syntax.
    3. Test properly !

  3. #3

    Re: How to trigger a restart of the clone service

    Quote Originally Posted by hunter86_bg View Post
    So you have 2 services 'R' & 'C'.
    Then you need first to clone 'C'.
    As 'C' depends on 'R' ,you want 'C-clone' to be restarted when 'R' restarts, right ?

    This looks like the dlm & clvmd dependency but one of them is regular resource.

    You have to:
    1. Create a clone for 'C'
    2. Set 2 order constraints (1 -> C starts after R, 2 -> C stops before R) that C is started after R. When R get migrated 'C-clone' will be stopped first, then R is started, then C-clone is started
    You can use 'crm help' to check the syntax.
    3. Test properly !
    When you create the order rules , use C-clone instead of resource C.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •