cancel
Showing results for 
Search instead for 
Did you mean: 

main.cf

linuly
Level 4

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

7 REPLIES 7

snockles
Level 3

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.

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

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.

hi,

the 2 commands haconf -makerw; haconf -dump -makero will write the in-memory content to main.cf.right?

Correct.

hi,

if i copy main.cf.previous from the same node to main.cf or copy main.cf from other node what happen if i do not stop vcs on my node?

tnx

Nothing will happen. Whilst VCS is running, even on a single node in the cluster, the files are irrelevant, and ignored. It's the in-memory configuration that is important.

haconf -dump writes the configuration from memory to disk across all running nodes. A clean shutdown (using hastop without the -force switch) will also check that the files match the in-memory configuration, and create new .cf files if there's a discrepancy.

You could delete the entire contents of the /etc/VRTSvcs/conf/config directory whilst the cluster is running with no effect.