Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (45 sloc) 2.36 KB


MySQL recipes for setting up clients, servers, and MySQL replication.

For replication, you only have to set the 'mysql/server/replication/role' attribute to either 'master', 'dualmaster', or 'slave' (depending on what sort of infrastructure you're looking for), and everything sets itself up as required. Automatic MySQL replication requires use of the Opscode Platform or an installation of chef-server.

If you don't plan on using automated MySQL replication, you can alternatively just apply the mysql::server or mysql::client roles, which should setup a plain box that can be configured for replication through other means.

This cookbook conflicts with the percona cookbook, since both this cookbook and the percona cookbook set the same attributes, plus they also don't play well together on the same box.


Red Hat/CentOS preferred.


attributes/replication.rb contains default, tunable attributes for MySQL replication. attributes/default.rb applies to all server types.


Create a node/role file, and make sure you have this general structure:

default_attributes "mysql" => {
                     "server" => {
                       "bindaddress" => "<ip>",
                       "datadir" => "/var/lib/mysql",
                       "logdir" => "/var/log/mysql",
                       "replication" => {
                         "role" => "master",
                         "user" => "replication",
                         "password" => "foobar"



Lee Huffman (<>) - mysql::client, mysql::default, mysql::server


Christian Paredes (<>) - mysql::master, mysql::slave, mysql::dualmaster


2010, Blue Box Group, LLC

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.