Wednesday, September 19, 2012

hacf -cftocmd to recreate the commands from the main.cf file


The whole VCS config can be recreated by recreating the commands from the main.cf file.


Location of config file - /etc/VRTSvcs/conf/config


dump the exsisting config details in the memory to the disk.


(Solaris1:/root)# cd /etc/VRTSvcs/conf/config
(Solaris1:/etc/VRTSvcs/conf/config)# haconf -dump
(Solaris1:/etc/VRTSvcs/conf/config)#


now create the command file from the main.cf file using the hacf command

(Solaris1:/etc/VRTSvcs/conf/config)# hacf
VCS INFO V-16-1-10601 Usage:
         hacf -cftocmd   [-dest ] [-display]
         hacf -cmdtocf   [-dest ]
         hacf -verify     [-display]
         hacf -help

(Solaris1:/etc/VRTSvcs/conf/config)#


This command will create the command file whioch can be used to recreate the whole cluster.

    hacf -cftocmd   [-dest ] [-display]


(Solaris1:/etc/VRTSvcs/conf/config)# hacf -cftocmd . -dest .


(Solaris1:/etc/VRTSvcs/conf/config)# ls -ltr | tail
-rw-------   1 root     root       29075 Nov 13 14:31 main.cf.13Nov2012.14.31.22
-rw-------   1 root     root       29362 Nov 26 12:32 main.cf.26Nov2012.12.32.09
-rw-------   1 root     root       30286 Nov 27 11:35 main.cf.27Nov2012.11.35.18
-rw-------   1 root     root       30649 Dec 24 10:27 main.cf.24Dec2012.10.27.42
-rw-------   1 root     root       30722 Dec 24 10:29 main.cf.24Dec2012.10.29.13
-rw-------   2 root     root       33096 Feb 25 14:34 main.cf.previous
-rw-------   2 root     root       33096 Feb 25 14:34 main.cf.25Feb2013.14.34.29
-rw-------   2 root     root       33099 Mar 26 11:22 main.cf.26Mar2013.11.22.57
-rw-------   2 root     root       33099 Mar 26 11:22 main.cf
-rw-------   1 root     root      192090 Mar 26 11:23 main.cmd
(Solaris1:/etc/VRTSvcs/conf/config)# 


(Solaris1:/etc/VRTSvcs/conf/config)# more main.cmd
haclus -modify  PrintMsg 0
haclus -modify  UserNames  alex bIGmJLhRJfIReHFgFI bibon ejjEjpInjEgkFg sarco JlmKliLilFljKslNltKglFmh
KulS indigo dKLjKFjQKiKSjHKmKF naglel aHHoHCgIHjHQhEEbED idone cpoLpyOxpJpvLkmKmmKn z_zone1
_Solaris1 chhPilGqhOedDdeAed
haclus -modify  ClusterAddress "10.20.02.180"
haclus -modify  Administrators  alex bibon sarco indigo naglel idone
haclus -modify  SourceFile "./main.cf"
haclus -modify  ClusterName vcs-cluster1
hatype -add ASG
hatype -modify ASMDG SourceFile "./OracleMTypes.cf"
hatype -modify ASMDG AgentDirectory "/opt/VRTSagents/ha/bin/ASG"
hatype -modify ASMDG ArgList Sid Owner Home DBAUser DBAPword DiskGroups EnvFile Encoding
hatype -modify ASMDG ContainerOpts RunInContainer 1 PassCInfo 0
haattr -add ASG Home -string
haattr -add ASG Owner -string

No comments:

Post a Comment