Thursday, February 14, 2013

Veritas Cluster Filesystem, samba service and virtual IP configuration


On a two node Veritas cluster:
  • We need to create a shared cluster filesystem. Mounted on all node
  • Samba service should be up on one node, if shared filesystem is already mounted
  • Samba Service should start, if a IP used for samba is already up on the system.
  • Assumption: basic cluset is installed and up

Veritas CLI to configure VCS main.cf


Add a group ClusterFileSystemgroup as CFS filesyetm group.

haconf -makerw
hagrp -add ClusterFileSystemgroup
hagrp -modify ClusterFileSystemgroup SystemList Node1 0 Node2 1
hagrp -modify ClusterFileSystemgroup AutoFailOver 0
hagrp -modify ClusterFileSystemgroup Parallel 1
hagrp -modify ClusterFileSystemgroup AutoStartList Node1 Node2


Add cfsmount1 resource to mount CFS filesystem on all nodes. It will import Fg and start volume

hares -add cfsmount1 CFSMount ClusterFileSystemgroup
hares -modify cfsmount1 Critical 0
hares -modify cfsmount1 MountPoint "/mount/dir"
hares -modify cfsmount1 BlockDevice "/dev/vx/dsk/VxDGname/VxVolName"
hares -modify cfsmount1 NodeList  Node1 Node2
hares -modify cfsmount1 CloneSkip no
hares -modify cfsmount1 Enabled 1
hares -add cvmvoldg1 CVMVolDg ClusterFileSystemgroup
hares -modify cvmvoldg1 Critical 0
hares -modify cvmvoldg1 CVMDiskGroup VxDGname
hares -modify cvmvoldg1 CVMVolume  bvmsanvol
hares -local cvmvoldg1 CVMActivation
hares -modify cvmvoldg1 CVMActivation sw -sys Node1
hares -modify cvmvoldg1 CVMActivation sw -sys Node2
hares -modify cvmvoldg1 Enabled 1


Add cluster volume manager (cvm) group

hagrp -add cvm
hagrp -modify cvm SystemList  Node1 0 Node2 1
hagrp -modify cvm AutoFailOver 0
hagrp -modify cvm Parallel 1
hagrp -modify cvm AutoStartList  Node1 Node2
hares -add vxfsckd CFSfsckd cvm
hares -local vxfsckd ActivationMode
hares -modify vxfsckd ActivationMode  VxDGname sw -sys Node1
hares -modify vxfsckd ActivationMode  VxDGname sw -sys Node2
hares -modify vxfsckd Enabled 1
hares -add cvm_clus CVMCluster cvm
hares -modify cvm_clus CVMClustName lon6bvmdrwww_cluster
hares -modify cvm_clus CVMNodeId  Node1 0 Node2 1
hares -modify cvm_clus CVMTransport gab
hares -modify cvm_clus CVMTimeout 200
hares -modify cvm_clus CVMNodeAddr -delete -keys
hares -modify cvm_clus Enabled 1
hares -add cvm_vxconfigd CVMVxconfigd cvm
hares -modify cvm_vxconfigd Critical 0
hares -modify cvm_vxconfigd CVMVxconfigdArgs  syslog
hares -modify cvm_vxconfigd Enabled 1
hagrp -link ClusterFileSystemgroup cvm online local firm
hares -link cfsmount1 cvmvoldg1
hares -link cvm_clus cvm_vxconfigd
hares -link vxfsckd cvm_clus


Create a failover group SambaServerGroup - When cluster will come up, this goup will be online on Node2

hagrp -add SambaServerGroup
hagrp -modify SambaServerGroup SystemList -add Node2 1 Node1 2
hagrp -modify SambaServerGroup AutoStartList Node2 Node1
hagrp -modify SambaServerGroup Parallel 0


Add a resource SambaFlotingIP in SambaServerGroup group. It will use NIC bond0 (also used for system public link) and assign IP/Netmask

hares -add SambaFlotingIP IP SambaServerGroup
hares -modify SambaFlotingIP Device bond0
hares -modify SambaFlotingIP Address 10.10.10.50
hares -modify SambaFlotingIP NetMask 255.255.255.192
hares -modify SambaFlotingIP Enabled 1

hagrp -modify SambaFlotingIP AutoStartList Node2 Node1

Also add  a resource SambaApplication in SambaServerGroup group to use /etc/init.d/smb script to control service.

hares -add SambaApplication Application SambaServerGroup
hares -modify SambaApplication User "root"
hares -modify SambaApplication StartProgram "/etc/init.d/smb start"
hares -modify SambaApplication StopProgram "/etc/init.d/smb stop"
hares -modify SambaApplication PidFiles "/var/run/smbd.pid"
hares -modify SambaApplication Enabled 1


SambaApplication resource should start if SambaFlotingIP resource is up.

hares -link SambaApplication SambaFlotingIP

And SambaServerGroup should depend on ClusterFileSystemgroup (CFS filesystem group name)

hagrp -link SambaServerGroup ClusterFileSystemgroup online local firm
haconf -dump -makero

No comments:

Post a Comment