mcgona...@gmail.com (TomTom) writes: > I am trying to puppetize a multi-mysql installation. Our mysql > consultant suggested that we use the pre-compiled binary installations > from mysql.com. > So a multi-instance mysql installation would look like > /data01/multi_mysql/mysql_A/ > /data01/multi_mysql/mysql_B/ > /data01/multi_mysql/mysql_C/ >
I do something like this storing each instance under /mysql/<instance_name> though I have an lvm partition under filesystem and puppet builds this for me. In case it helps I do it like this: ########################################################################### # This is for creating a partition of the defined type if it doesn't exit # and mounting it. # Typical usage: # logicalvolume{ "/tmp/mount_point": # $lvsize => "20G", # $fstype => "xfs", # $mode => "755", # } # # NOTE: use mode 755 for /mysql/<instance> as local socket access for all # users requires access to /mysql/<instance>/data/mysql.sock and mode # 750 breaks that unless you are the user mysql or part of the mysql # group. # Manage a partition and create if needed. # The name SHOULD be the mount point, such as "/mysql/bp" define logicalvolume ( $lvsize = "1G", $fstype = "ext3", $vgname = "vg00", $lvname = "$name", $owner = "root", $group = "root", $mode = "755" ) { # FIXME: Ensure the user/group exist before trying to create the directory # $ getent passwd | grep ^$user: | wc -l # could be replaced by id ? # 1 # $ getent group | grep ^$group: | wc -l # replacable by something else? # 1 # The mysql user will only exist once the MySQL rpm has been installed, # but we can't add the package dependency here as lvm configs should not # depend on mysql configs. file { "${name}": ensure => directory, owner => $owner, group => $group, mode => $mode, } exec { "lvcreate-${vgname}-${lvname}": path => [ "/sbin", "/bin", "/usr/sbin", "/usr/bin" ], logoutput => false, command => "lvcreate -n ${lvname} -L ${lvsize} /dev/${vgname} && mkfs -t ${fstype} /dev/${vgname}/${lvname}", unless => "lvs | grep -q '${lvname}.*${vgname}'", subscribe => File[ "$name"], } mount { "${name}": atboot => true, device => "/dev/$vgname/$lvname", ensure => mounted, fstype => "${fstype}", options => "defaults", dump => "1", pass => "2", require => [ Exec["lvcreate-${vgname}-${lvname}"], File["${name}"] ], } } Then for each instance I need to build I define a class class instance_01 { ... other stuff for this group of boxes logicalvolume { "/mysql/instance_01": lvname => "mysqlVol", lvsize => "150G", fstype => "xfs", vgname => "sysvm", owner => "mysql", group => "mysql", mode => "755", } } This doesn't include your tarball extract and of course may need adjusting for your environment but basically does the same thing as you want. It works well for me. Hope it helps. Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---