Forum Discussion

linuly's avatar
linuly
Level 4
6 years ago

main.cf

hi,

if main.cf file is corrupted on a node how can i restore it?

1-stop vcs on that node then start vcs will restore main.cf from other node in cluster?

2-stop vcs and copy main.cf from other node.

tnx

  • hastop -local -force or hastop -all -force will stop VCS only on either a single node, or all of them. Services will not be affected.

    On startup, VCS will check the state of the services before taking any action, and if they are already running, continue as if nothing has happened.

    All haconf does is enable you to change the state of the in-memory configuration from read-only to read-write, and back again, as well as saving that configuration to disk. It won't make any changes to the configuration, nor do you need to, to save it back to disk if there has been any corruption, of the file is missing completely.

    But a restart of VCS is not required if that's all you want to do.

  • There's no need to stop VCS at all. The "live" main.cf is the one in memory on the nodes.The on disk copy is only used during a complete cluster startup. So 2 simple options are:

    1. Copy from another node in the cluster
    2. Use the commands haconf -makerw; haconf -dump -makero to cause VCS to write a new main.cf to all the nodes.
    • linuly's avatar
      linuly
      Level 4

      hi,

      if i use haconf then i must add all the resources.right?

      if i stop vcs on a node without to stop the service group then i start vcs on that node-will be there any impact on service group running?

      tnx

      • snockles's avatar
        snockles
        Level 3

        hastop -local -force or hastop -all -force will stop VCS only on either a single node, or all of them. Services will not be affected.

        On startup, VCS will check the state of the services before taking any action, and if they are already running, continue as if nothing has happened.

        All haconf does is enable you to change the state of the in-memory configuration from read-only to read-write, and back again, as well as saving that configuration to disk. It won't make any changes to the configuration, nor do you need to, to save it back to disk if there has been any corruption, of the file is missing completely.

        But a restart of VCS is not required if that's all you want to do.