Ask Your Question
1

how I can configure the mysql module to allow me to run multiple instances of MySQL server on the same node

asked 2014-07-19 15:34:44 -0500

Baljeet gravatar image

Hi I am required to stand up two instances of MySQL server on the same node (different ports, sockets, data directory etc). As the path to my.cnf is hard-coded in params.pp, and I need to be able to configure this (in order to define two different configurations), can anyone suggest how this may be achieved? thanks!

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2016-12-21 00:34:35 -0500

stivesso gravatar image

Hi,

I got similar requirements and also came to the conclusion that it wasn't supported in official puppet module, but there's a way to do that (and even more) by combining puppetlabs-mysql and Docker (garethr/docker). This has been well documented here.

edit flag offensive delete link more

Comments

I was going to recommend a similar path

DarylW gravatar imageDarylW ( 2016-12-21 07:20:00 -0500 )edit
1

answered 2014-07-22 07:47:25 -0500

igalic gravatar image

This is currently not supported(, or even envisioned) in the puppetlabs-mysql module

edit flag offensive delete link more
1

answered 2014-07-22 11:41:34 -0500

ramindk gravatar image

Multi Mysql installs are usually complicated and bespoke per system, distro, and Mysql version. If you wanted to attempt to add your own implementation it might looks like this.

modules/multimysql/manifests/init.pp

class multimysql {

   include ::mysql
}

modules/multimysql/manifests/server.pp

define multimysql::server (
  $rootdir =
) {

  file { "$rootdir": ensure => directory, }
  file { "${rootdir}/etc": ensure => directory, }
  file { "${rootdir}/var": ensure => directory, }

  file { "${rootdir}/etc/my.cnf":
    ensure => file,
    content => template('multimysql/my.cnf.erb')
  }

  file { "/etc/init.d/mysqld-${name}":
    ensure => file,
    content => template('multimysql/my.init.erb')
  }

  service { "mysqld-${name}":
    enable => true,
    ensure => running,
  }
}

This is obviously incomplete and missing a few important parts like initializing the data dir, but might get you started.

edit flag offensive delete link more
0

answered 2016-12-21 05:52:09 -0500

Interesting!

I would review the logic of some of the developers who have written tomcat modules to create multiple instances on one server. This may shed some insight as to how you may want to structure your mysql modules. I never attempted this for mysql. I had only small glitches with this process in tomcat.

Good luck with this.... sorry I am not much help.

-Glynn

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-07-19 15:34:44 -0500

Seen: 568 times

Last updated: Dec 21 '16