[Linux-ha-dev] [PATCH] Dynamic change timeout parameters

Keisuke MORI kskmori at intellilink.co.jp
Wed Jan 16 02:34:13 MST 2008


Hello all,

We would like to propose an enhancement for changing
timeout parameters in ha.cf such as deadtime, keepalive, etc.
without stopping heartbeat services.

It is based on the patch created by DAIKI MATSUDA,
(See: http://www.gossamer-threads.com/lists/linuxha/dev/39982 )
and the differences are:
        i) Added hb_chconf command to specify parameters and their values.
           You don't need to modify /etc/ha.d/ha.cf to change the values.
       ii) Fixed some bugs.

See attached README for details.
The patch is made for heartbeat-2.1.3.


Your comments and suggestions are really appreciated.

Best regards,

Keisuke MORI
NTT DATA Intellilink Corporation

-------------- next part --------------
                    Dynamic change the timeout parameters

1. Introduction
    This tool, hb_chconf is an utility to change some timeout parameters in ha.cf
without stopping heartbeat services. And it applies the change to all nodes 
in the same cluster. It can deal with the following parameters:
    keepalive, deadtime, deadping, and warntime.

    It is based on the patch created by DAIKI MATSUDA. (See: 
http://www.gossamer-threads.com/lists/linuxha/dev/39982)
    The differences are:
        i) Added hb_chconf command to specify parameters and their values.
           You don't need to modify /etc/ha.d/ha.cf to change the values.
       ii) Fixed some bugs.
              - CPU is spend almost 100% when you change keepalive's value.
              - It changes not only keepalive but deadtime even if you modify
                only keepalive's value.
              - Some memory leaks.

2. Build
    This patch plays 2 roles. One is modifying heartbeat to be able to 
dynamic change timeout parameters. And the other is to create the command 
tool for ordering heartbeat to change.

    $ cd <root directory of heartbeat's source>
    $ patch -p1 < hbchconf_modify_timeout_value.patch
    $ ConfigureMe configure
    $ make
    $ su
    # make install

    NOTE:    hb_chconf command is installed in /usr/bin directory.

3. How to Use
    Add a line to /etc/ha.d/ha.cf to set apiauth.
    ex.) In the case of which you execute this command as root user or 
         hacluster user.
    apiauth hb_chconf uid=root,hacluster

    And the command's usage is:

    # /usr/bin/hb_chconf -p <[keepalive|deadtime|deadping|warntime]> <#(msec)>

    If you want to change several configurations at once, you can specify two
or more parameters.
    ex.) In the case of which you want to change keepalive and deadtime.
    # /usr/bin/hb_chconf -p keepalive 2000 -p deadtime 40000

    NOTE:    You have to execute this command as the user specified with 
         apiauth on /etc/ha.d/ha.cf.

4. Constraints
    When you change some parameters with this tool, its effect is:
        i) The change executed on a node is applied to other nodes in the same 
           cluster.
       ii) The change is effective only on memory. And it is not applied to 
           /etc/ha.d/ha.cf. So, if you restart a heartbeat server, 
           the configuration is back to the former.

    NOTE:    If there are any nodes which stop when you execute this tool, 
         the change is *not* applied to them.

5. Examples
    An example to change keepalive and deadtime parameters.

    [root at hb2n01 ~]# /usr/bin/cl_status hbparameter -p keepalive
    1001ms
    [root at hb2n01 ~]# /usr/bin/cl_status hbparameter -p deadtime
    10001ms
    
    [root at hb2n01 ~]# hb_chconf -p keepalive 2000 -p deadtime 20000
    Node: hb2n02 [status: active]
      keepalive: 1000ms -> 2000ms
      deadtime: 10000ms -> 20000ms
    Node: hb2n01 [status: active]
      keepalive: 1000ms -> 2000ms
      deadtime: 10000ms -> 20000ms

    [root at hb2n01 ~]# /usr/bin/cl_status hbparameter -p keepalive
    2000ms
    [root at hb2n01 ~]# /usr/bin/cl_status hbparameter -p deadtime
    20000ms
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hbchconf_modify_timeout_value.patch
Type: text/x-patch
Size: 63817 bytes
Desc: hbchconf_modify_timeout_value.patch
Url : http://lists.community.tummy.com/pipermail/linux-ha-dev/attachments/20080116/942f6671/hbchconf_modify_timeout_value-0001.bin


More information about the Linux-HA-Dev mailing list