Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support starting corosync-notifyd at cluster startup (draft) #296

Closed

Conversation

inouekazu
Copy link

This is a draft of a patch to allow corosync-notifyd to also be started with pcs cluster start.

  • pcs cluster enable-corosync-notifyd will set ENABLE_COROSYNC_NOTIFYD=yes in /etc/sysconfig/pcs.

    # pcs cluster enable-corosync-notifyd
    Distributing PCS config...
    rhel84-1: PCS config saved
    rhel84-2: PCS config saved
    
    # ssh rhel84-1 cat /etc/sysconfig/pcs
    # This file has been generated by pcs.
    ENABLE_COROSYNC_NOTIFYD=yes
    
    # ssh rhel84-2 cat /etc/sysconfig/pcs
    # This file has been generated by pcs.
    ENABLE_COROSYNC_NOTIFYD=yes
    
  • If this setting is present, corosync-notifyd will also be invoked when the cluster is started.

    # pcs cluster start --all
    rhel84-1: Starting Cluster...
    rhel84-2: Starting Cluster...
    
    # ssh rhel84-1 ps -ef | grep -e corosync -e pacemaker
    root        7491       1  5 14:50 ?        00:00:02 /usr/sbin/corosync -f
    root        7504       1  0 14:50 ?        00:00:00 /usr/sbin/corosync-notifyd -f -l -s -m 192.168.122.160
    root        7506       1  0 14:50 ?        00:00:00 /usr/sbin/pacemakerd -f
    haclust+    7507    7506  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-based
    root        7508    7506  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-fenced
    root        7509    7506  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-execd
    haclust+    7510    7506  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-attrd
    haclust+    7511    7506  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-schedulerd
    haclust+    7512    7506  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-controld
    
    # ssh rhel84-2 ps -ef | grep -e corosync -e pacemaker
    root        6778       1  1 14:50 ?        00:00:03 /usr/sbin/corosync -f
    root        6791       1  0 14:50 ?        00:00:00 /usr/sbin/corosync-notifyd -f -l -s -m 192.168.122.160
    root        6793       1  0 14:50 ?        00:00:00 /usr/sbin/pacemakerd -f
    haclust+    6794    6793  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-based
    root        6795    6793  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-fenced
    root        6796    6793  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-execd
    haclust+    6797    6793  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-attrd
    haclust+    6798    6793  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-schedulerd
    haclust+    6799    6793  0 14:50 ?        00:00:00 /usr/libexec/pacemaker/pacemaker-controld
    
    # pcs status
    Cluster name: my_cluster
    
    WARNINGS:
    No stonith devices and stonith-enabled is not false
    
    Cluster Summary:
      * Stack: corosync
      * Current DC: rhel84-2 (version 2.0.5-9.el8_4.1-ba59be7122) - partition with quorum
      * Last updated: Wed May 26 15:03:38 2021
      * Last change:  Wed May 26 14:27:34 2021 by hacluster via crmd on rhel84-2
      * 2 nodes configured
      * 0 resource instances configured
    
    Node List:
      * Online: [ rhel84-1 rhel84-2 ]
    
    Full List of Resources:
      * No resources
    
    Daemon Status:
      corosync: active/disabled
      corosync-notifyd: active/disabled
      pacemaker: active/disabled
      pcsd: active/enabled
    
  • pcs cluster disable-corosync-notifyd will set ENABLE_COROSYNC_NOTIFYD=no in /etc/sysconfig/pcs. In this case, corosync-notifyd will not be started.

@knet-ci-bot
Copy link

Can one of the admins verify this patch?

@tomjelinek
Copy link
Member

Thank you for this pull request and your effort to make it fit pcs architecture. I read through it and found several points to improve.

Corosync-notifyd has not been added to pcs cluster enable and pcs cluster disable commands. That means corosync-notifyd will only get started and stopped by pcs. Even though that may be sufficient for your use case, others may expect corosync-notifyd to be started after boot as well.

I don't think /etc/sysconfig/pcs is a good place to store ENABLE_COROSYNC_NOTIFYD settings. Files in /etc/sysconfig hold environment variables passed to daemons on their start. I perceive them as files modified once or rarely, usually by an admin. Also, their syntax does not make them ideal to modify them by code. On top of that, we already have several config files in pcs and we would like to avoid adding new ones.

If the setting needs to be stored, then /var/lib/pcs_settings.conf is better place to do it. The advantage is the file is automatically synchronized by pcsd. The disadvantage, for now, is that all code managing the file and synchronization is written in ruby and not easily accessible from python.

Alternatively, an option like --with-corosync-notifyd could be added to pcs cluster start | stop | enable | disable commands instead of having the setting stored in a file.

@inouekazu
Copy link
Author

Thanks for reviewing it.

Even though that may be sufficient for your use case, others may expect corosync-notifyd to be started after boot as well.

Yes, you're right. I'll deal with it.

If the setting needs to be stored, then /var/lib/pcs_settings.conf is better place to do it.

OK! I'll look into it.

@inouekazu
Copy link
Author

I requested a patch (#311) that addresses the issues pointed out.

@inouekazu inouekazu closed this Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants