Ask Your Question

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 -0600

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

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

stivesso gravatar image


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


I was going to recommend a similar path

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

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

igalic gravatar image

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

edit flag offensive delete link more

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

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.


class multimysql {

   include ::mysql


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

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

greynolds gravatar image


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.


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


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

Seen: 675 times

Last updated: Dec 21 '16