Permalink
Browse files

remove percona cookbook and add percona_server

  • Loading branch information...
1 parent e5491d9 commit 8e08b8a7c08b2e2ec47b277eed82275da92f7aaf @scoop206 scoop206 committed Sep 14, 2012
View
@@ -1,63 +0,0 @@
-= DESCRIPTION:
-
-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 percona::server or percona::client roles, which should setup a
-plain box that can be configured for replication through other means.
-
-The percona cookbook conflicts with the mysql cookbook, since they set the
-same exact attributes in Chef and don't really play too well together on the
-same box.
-
-= REQUIREMENTS:
-
-Red Hat/CentOS preferred.
-
-= ATTRIBUTES:
-
-attributes/replication.rb contains default, tunable attributes for MySQL
-replication. attributes/default.rb applies to all server types.
-
-= USAGE:
-
-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"
- }
- }
- }
-
-= LICENSE AND AUTHOR:
-
-Author:: Lee Huffman (<lee.huffman@blueboxgrp.com>) - percona::client, percona::default, percona::server
-
-Author:: Christian Paredes (<christian.paredes@blueboxgrp.com>) - percona::master, percona::slave, percona::dualmaster
-
-Copyright:: 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
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-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.
@@ -1,26 +0,0 @@
-#
-# Cookbook Name:: percona
-# Attributes:: default
-#
-# Copyright 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#
-
-default[:mysql][:server][:datadir] = "/var/lib/mysql"
-default[:mysql][:server][:logdir] = "/var/log/mysql"
-default[:mysql][:server][:bindaddress] = "127.0.0.1"
-
-if node.mysql.server.attribute?("replication")
- include_attribute "percona::replication"
-end
@@ -1,34 +0,0 @@
-#
-# Cookbook Name:: mysql
-# Attributes:: replication
-#
-# Copyright 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#
-
-include_attribute "percona::default"
-
-default[:mysql][:server][:replication][:role] = "standalone"
-
-# Provides unique ID for each machine by transforming every character in the
-# node's FQDN to its number representation, and then adding everything up.
-
-sum = 0
-node[:fqdn].each_byte {|c| sum += c}
-sum = sum % 65000
-
-default[:mysql][:server][:replication][:id] = sum
-default[:mysql][:server][:replication][:autoincrementincrement] = 10
-default[:mysql][:server][:replication][:autoincrementoffset] = 2
-default[:mysql][:server][:replication][:user] = "replication"
@@ -1,43 +0,0 @@
-#
-# Cookbook Name:: percona
-# Definition:: master
-#
-# Copyright 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#
-
-# Example:
-# master "ohai" do
-# replication_user replication
-# replication_password foobar
-# master_log_pos 510523
-# master_log_file mysql-bin-log.100
-# ip_address 127.0.0.1
-# port 3306
-# action :create
-# end
-
-define :master, :action => :create, :port => "3306", :replication_user => "replication" do
- if params[:action] == :create
- ruby_block "connect-to-master-#{params[:name]}" do
- block do
- Chef::Log.info("Setting master host to #{params[:ip_address]} on port #{params[:port]}, with user #{params[:replication_user]}, log file at #{params[:master_log_file]}, position #{params[:master_log_pos]}")
- %x[mysql -u root -e "CHANGE MASTER TO master_host='#{params[:ip_address]}', master_port=#{params[:port]}, master_user='#{params[:replication_user]}', master_password='#{params[:replication_password]}', master_log_file='#{params[:master_log_file]}', master_log_pos=#{params[:master_log_pos]};"]
- %x[mysql -u root -e "START SLAVE;"]
- end
- not_if "mysql -u root -e \"show slave status;\" | wc -l | grep -v 0"
- action :create
- end
- end
-end
@@ -1,39 +0,0 @@
-#
-# Cookbook Name:: percona
-# Definition:: slave
-#
-# Copyright 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#
-
-# Example:
-# slave "ohai" do
-# replication_user replication
-# replication_password foobar
-# ip_address 127.0.0.1
-# action :create
-# end
-
-define :slave, :action => :create, :replication_user => "replication" do
- if params[:action] == :create
- ruby_block "create-replication-#{params[:name]}-user" do
- block do
- Chef::Log.info("Granting replication slave on *.* to #{params[:replication_user]}@#{params[:ip_address]}")
- %x[mysql -u root -e "GRANT REPLICATION SLAVE ON *.* TO '#{params[:replication_user]}'@'#{params[:ip_address]}' IDENTIFIED BY '#{params[:replication_password]}';"]
- end
- not_if "mysql -u root -e \"SELECT user,host from mysql.user where user='#{params[:replication_user]}';\" | grep #{params[:replication_user]} | grep #{params[:ip_address]}"
- action :create
- end
- end
-end
View
@@ -1,106 +0,0 @@
-maintainer "Blue Box Group, LLC"
-maintainer_email "support@blueboxgrp.com"
-license "Apache v2.0"
-description "Installs/Configures percona"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.5.0"
-
-depends "system-users"
-conflicts "mysql"
-
-%w{centos redhat}.each do |os|
- supports os
-end
-
-grouping 'mysql/server/replication',
- :title => "MySQL Replication Options",
- :description => "Describe MySQL replication settings below."
-
-attribute 'mysql/server/replication/role',
- :display_name => "MySQL Replication Role",
- :description => "Describes what role the MySQL machine is set to (slave/master/dualmaster)",
- :choice => [ 'slave', 'master', 'standalone', 'dualmaster' ],
- :type => "string",
- :required => "recommended",
- :recipes => [ 'mysql::master', 'mysql::slave', 'mysql::dualmaster' ],
- :default => "standalone"
-
-attribute 'mysql/server/replication/user',
- :display_name => "MySQL Replication User",
- :description => "Username that should be created and used on a master server for replication.",
- :type => "string",
- :required => "optional",
- :recipes => [ 'mysql::master', 'mysql::slave', 'mysql::dualmaster' ],
- :default => "replication"
-
-attribute 'mysql/server/replication/password',
- :display_name => "MySQL Replication Password",
- :description => "Password for connecting to a master server with the replication user.",
- :type => "string",
- :required => "required",
- :recipes => [ 'mysql::master', 'mysql::slave', 'mysql::dualmaster' ]
-
-attribute 'mysql/server/replication/id',
- :display_name => "MySQL server ID",
- :description => "The 'server-id' configuration setting set for each machine in a specific cluster.",
- :type => "string",
- :calculated => true,
- :required => "optional"
-
-attribute 'mysql/server/replication/autoincrementincrement',
- :display_name => "MySQL 'auto_increment_increment'",
- :description => "The 'auto_increment_increment' configuration setting set for each machine in
- a specific cluster.",
- :type => "string",
- :calculated => true,
- :required => "optional"
-
-attribute 'mysql/server/replication/autoincrementoffset',
- :display_name => "MySQL 'auto_increment_offset'",
- :description => "The 'auto_increment_offset' configuration setting set for each machine in
- a specific cluster.",
- :type => "string",
- :calculated => true,
- :required => "optional"
-
-attribute 'mysql/server/replication/log_file',
- :display_name => "MySQL master log file",
- :description => "Last recorded MySQL master log file.",
- :type => "string",
- :calculated => true,
- :required => "optional"
-
-attribute 'mysql/server/replication/log_pos',
- :display_name => "MySQL master log position",
- :description => "Last recorded MySQL master log position.",
- :type => "string",
- :calculated => true,
- :required => "optional"
-
-grouping 'mysql/server',
- :title => "General MySQL Options",
- :description => "Describe general MySQL options below."
-
-attribute 'mysql/server/datadir',
- :display_name => "MySQL data directory",
- :description => "Where your MySQL databases live.",
- :type => "string",
- :required => "optional",
- :recipes => [ 'mysql::server' ],
- :default => "/var/lib/mysql"
-
-attribute 'mysql/server/logdir',
- :display_name => "MySQL log directory",
- :description => "Where your MySQL logs are stored.",
- :type => "string",
- :required => "optional",
- :recipes => [ 'mysql::server' ],
- :default => "/var/log/mysql"
-
-attribute 'mysql/server/bindaddress',
- :display_name => "MySQL bind address",
- :description => "Which IP address MySQL will bind to.",
- :type => "string",
- :required => "recommended",
- :recipes => [ 'mysql::server' ],
- :default => "127.0.0.1"
@@ -1,38 +0,0 @@
-#
-# Cookbook Name:: percona
-# Recipe:: default
-#
-# Copyright 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#
-
-percona_pkg = "percona-release-0.0-1.x86_64.rpm"
-percona_location = "http://www.percona.com/downloads/percona-release/#{percona_pkg}"
-
-remote_file "/tmp/#{percona_pkg}" do
- source "#{percona_location}"
- mode 0644
- owner "root"
- group "root"
- action :create
- notifies :upgrade, "rpm_package[percona]"
-end
-
-rpm_package "percona" do
- source "/tmp/#{percona_pkg}"
- action :install
- only_if {File.exists?("/tmp/#{percona_pkg}")}
-end
-
-include_recipe "percona::client"
Oops, something went wrong.

0 comments on commit 8e08b8a

Please sign in to comment.