Permalink
Browse files

Fix namespace clash between cmon and galera

  • Loading branch information...
1 parent 7c50592 commit 8e08eec492d4245cbd2c6bed4a8b55d086083931 @alex-s9s alex-s9s committed Nov 20, 2012
View
121 cmon/README.md
@@ -17,7 +17,8 @@ Platform
Tested on:
-* Ubuntu 11.10 w/ chef-solo and chef-server v0.10.8 only.
+* Ubuntu 12.04 w/ Chef-server v10.16.2.
+* Ubuntu 11.10 w/ Chef-solo and Chef-server v0.10.8.
Cookbooks
---------
@@ -29,37 +30,62 @@ N/A
Attributes
==========
-The cmon controller recipe uses apt/yum packages and there should not be neccssary to change a lof of the attribtues besides specifying a 'root_password'.
-
-Use overrides for changing for example the MySQL root password to be different than for the cmon controller's.
-
-* ['mysql']['root_password'] - Monitored MySQL root password (password)
-* ['mysql']['mysql_bin'] = ['mysql']['bin_dir'] + "/mysql"
-
-* ['controller']['mysql_user'] - cmon controller MySQL user (cmon)
-* ['controller']['mysql_password'] - cmon controller MySQL user's password (cmon)
-* ['controller']['mysql_hostname'] - cmon controller MySQL hostname (nnn)
-* ['controller']['mysql_port'] - cmon controller MySQL port (3306)
-
-* ['cmon_password'] = cmon controller user's password (cmon)
-* ['mode']['agent'] = run as 'agent'
-* ['mode']['controller'] = run as 'controller'
-* ['mode']['dual'] = run in 'dual' mode, i.e., both as controller and agent
-
-* ['agent']['mysql_user'] - agent's MySQL user (cmon)
-* ['agent']['mysql_password'] - agent user's password (cmon)
-* ['agent']['mysql_hostname'] - monitored MySQL server hostname (127.0.0.1)
-* ['agent']['mysql_port'] - monitored MySQL port (3306)
-* ['mysql']['root_password'] - Monitored MySQL root password (password)
-
-* ['mysql']['data_dir'] = "/var/lib/mysql"
+The cmon controller recipe uses apt/yum packages and it should not be neccssary to change a many of the attribtues besides specifying a 'root_password' and some MySQL settings like the InnoDB buffer pool etc.
+
+Use role overrides for changing for example the MySQL root password to be different than for the cmon controller's or the location of the MySQL installation for the agents.
+
+ override_attributes({
+ "cmon_mysql" => {
+ "install_dir" => "/usr/local",
+ "mysql_bin" => "/usr/local/mysql/bin/mysql",
+ "root_password" => "password"}
+ }
+ )
+
+* node['cmon_mysql']['root_password'] - Monitored MySQL root password (password)
+
+* node['controller']['mysql_user'] - cmon controller MySQL user (cmon)
+* node['controller']['mysql_password'] - cmon controller MySQL user's password (cmon)
+* node['controller']['mysql_hostname'] - cmon controller MySQL hostname (nnn)
+* node['controller']['mysql_port'] - cmon controller MySQL port (3306)
+* node['cmon_password'] - cmon controller user's password (cmon)
+
+* node['agent']['mysql_user'] - agent's MySQL user (cmon)
+* node['agent']['mysql_password'] - agent user's password (cmon)
+* node['agent']['mysql_hostname'] - monitored MySQL server hostname (127.0.0.1)
+* node['agent']['mysql_port'] - monitored MySQL port (3306)
+* node['mysql']['root_password'] - Monitored MySQL root password (password)
+
+* node['install_dir_cmon'] = "/usr/local"
+* node['cmon_mysql']['install_dir'] = "/"
+* node['cmon_mysql']['basedir'] = "/usr"
+* node['cmon_mysql']['datadir'] = "/var/lib/mysql"
+
+* node['cmon_mysql']['innodb']['buffer_pool_size'] = "256M"
+* node['cmon_mysql']['innodb']['flush_log_at_trx_commit'] = 2
+* node['cmon_mysql']['innodb']['file_per_table'] = 1
+* node['cmon_mysql']['innodb']['doublewrite'] = 0
+* node['cmon_mysql']['innodb']['log_file_size'] = "512M"
+* node['cmon_mysql']['innodb']['log_files_in_group'] = 2
+* node['cmon_mysql']['innodb']['buffer_pool_instances'] = 1
+* node['cmon_mysql']['innodb']['max_dirty_pages_pct'] = 75
+* node['cmon_mysql']['innodb']['thread_concurrency'] = 0
+* node['cmon_mysql']['innodb']['concurrency_tickets'] = 5000
+* node['cmon_mysql']['innodb']['thread_sleep_delay'] = 10000
+* node['cmon_mysql']['innodb']['lock_wait_timeout'] = 50
+* node['cmon_mysql']['innodb']['io_capacity'] = 200
+* node['cmon_mysql']['innodb']['read_io_threads'] = 4
+* node['cmon_mysql']['innodb']['write_io_threads'] = 4
+
+* node['cmon_mysql']['innodb']['file_format'] = "barracuda"
+* node['cmon_mysql']['innodb']['flush_method'] = "O_DIRECT"
and others please see attributes/default.rb
Data Bags
=========
-Data items are used by the controller recipe to for example add agent hosts
+Data items are used by the controller recipe to for example add agent hosts
to its grant table and the agent recipe uses the controller_host_ipaddress to
set a controller host.
@@ -69,10 +95,10 @@ s9s_controller / config.json
"id": "config",
"controller_host_ipaddress": "192.168.122.11",
"mode": "controller",
- "type": "replication",
- "cmon_tarball_x86_64": "cmon-1.1.27-64bit-glibc23-mc70.tar.gz",
- "cmon_tarball_i686": "cmon-1.1.27-32bit-glibc23-mc70.tar.gz",
- "cmon_tarball_i386": "cmon-1.1.27-32bit-glibc23-mc70.tar.gz",
+ "type": "galera",
+ "cmon_tarball_x86_64": "cmon-1.1.35c-64bit-glibc23-mc70.tar.gz",
+ "cmon_tarball_i686": "cmon-1.1.35c-32bit-glibc23-mc70.tar.gz",
+ "cmon_tarball_i386": "cmon-1.1.35c-32bit-glibc23-mc70.tar.gz",
"cmon_source": "http://www.severalnines.com/downloads/cmon",
"cc_pub_key": "",
"agent_hosts": [
@@ -81,48 +107,51 @@ s9s_controller / config.json
"192.168.122.16"
]
}
-
-* **controller_host_ipaddress** The controller's IP address.
-* **agent_hosts** is a list of agents that is deployed. This list is used to setup grants for the agents.
-* **cc_pub_key** is a place holder for the public ssh key which is generated on the ClusterControl controller host. The agent hosts will have this key authorized to access its server. You would paste in the public key here before deploying agents.
+
+* **controller_host_ipaddress** The controller's IP address.
+* **agent_hosts** is a list of agents that is deployed. This list is used to setup grants for the agents.
+* **cc_pub_key** is a place holder for the public ssh key (/root/.ssh/id_rsa) which is generated on the ClusterControl controller host. During installation of the agents this key will be added to authorized_keys on the servers.
+You need to paste in the public key here before deploying agents.
Usage
=====
Roles:
Controller Role: cc_controller
run_list [
- "recipe[cmon::controller_mysql]",
+ "recipe[cmon::controller_mysql]",
+ "recipe[cmon::controller_rrdtool]",
"recipe[cmon::controller]"
]
-Installs the ClusterControl Controller and a MySQL server to store our monitoring data.
+Installs the ClusterControl Controller, standard MySQL server to store cluster data and statistics and rrdtool to create graphs.
Instead of our MySQL recipe you could choose to try any other available MySQL recipe instead.
- Agent Role: cc_agent
+ Web App Role: cc_webapp
run_list [
- "recipe[cmon::agent_packages]",
- "recipe[cmon::agent]"
+ "recipe[cmon::webserver]",
+ "recipe[cmon::webapp]"
]
-Installs the ClusterControl agent. It requires a MySQL root password in order to setup grants correctly on the monitored MySQL server.
+Installs the ClusterControl web application and apache on the Controller node.
- Web App Role: cc_webapp
+ Agent Role: cc_agent
run_list [
- "recipe[cmon::webserver]",
- "recipe[cmon::webapp]"
+ "recipe[cmon::agent_packages]",
+ "recipe[cmon::agent]"
]
-The ClusterControl web application and a webserver are usually installed on the controller node.
+Installs the ClusterControl agent. It requires the MySQL root password in order to setup grants correctly on the monitored MySQL server.
Change History
===============
-* v0.4 - Fixes for Chef 0.10.10 and working with galera cookbook
+* v0.5 - Cleanup/fixes and tested with Chef 10.16.2, only tested with our galera cookbook
+* v0.4 - Fixes for Chef 0.10.10 and working with our galera cookbook
* v0.3 - Code cleanup, better use of roles, data bags and more tests using Chef-Server 0.10.8.
* v0.2 - Bug fixes and making sure it worked on Chef-Solo.
-* v0.1 - Initial recipes based upon cmon v1.1.25.
+* v0.1 - Initial recipes based upon cmon v1.1.25.
License and Author
==================
View
151 cmon/attributes/default.rb
@@ -1,38 +1,6 @@
-default['install_dir_cmon'] = "/usr/local"
-default['install_config_path'] = "/etc"
-
-default['cluster_id'] = 1
-default['cluster_name'] = "default_cluster_1"
-default['cluster_type'] = "replication"
-
-default['controller']['mysql_user'] = "cmon"
-default['controller']['mysql_hostname'] = "from-databag"
-default['controller']['mysql_password'] = "cmon"
-default['controller']['mysql_port'] = 3306
-default['controller']['ndb_connectstring'] = "from-databag"
-default['controller']['ssh_key'] = "/root/.ssh/id_rsa"
-
-default['cmon_password'] = "cmon"
-
-default['mode']['agent'] = "agent"
-default['mode']['controller'] = "controller"
-default['mode']['dual'] = "dual"
-
-default['agent']['mysql_user'] = "cmon"
-default['agent']['mysql_hostname'] = "127.0.0.1"
-default['agent']['mysql_password'] = "cmon"
-default['agent']['mysql_port'] = 3306
-default['agent']['hostname'] = node['ipaddress']
-
case node['platform']
when 'centos', 'redhat', 'fedora', 'suse', 'scientific', 'amazon'
- default['mysql']['install_dir'] = "/"
- default['mysql']['basedir'] = "/usr"
- default['mysql']['bindir'] = default['mysql']['basedir'] +"/bin"
-
- default['mysql']['ndb_bindir'] = default['mysql']['basedir'] +"/bin"
-
default['agent']['packages'] = %w(psmisc libaio sysstat)
default['controller']['packages'] = %w(rrdtool mysql mysql-server nc wget)
@@ -53,12 +21,6 @@
else
- default['mysql']['installdir'] = "/"
- default['mysql']['basedir'] = "/usr"
- default['mysql']['bindir'] = default['mysql']['basedir'] +"/bin"
-
- default['mysql']['ndb_bindir'] = default['mysql']['basedir'] +"/bin"
-
default['agent']['packages'] = %w(psmisc libaio1 sysstat)
default['controller']['packages'] = %w(rrdtool mysql-server nc wget)
@@ -79,50 +41,81 @@
end
+default['install_dir_cmon'] = "/usr/local"
+default['install_config_path'] = "/etc"
+
+default['cluster_id'] = 1
+default['cluster_name'] = "default_cluster_1"
+default['cluster_type'] = "replication"
+
+default['controller']['mysql_user'] = "cmon"
+default['controller']['mysql_hostname'] = "from-databag"
+default['controller']['mysql_password'] = "cmon"
+default['controller']['mysql_port'] = 3306
+default['controller']['ndb_connectstring'] = "from-databag"
+default['controller']['ssh_key'] = "/root/.ssh/id_rsa"
+
+default['cmon_password'] = "cmon"
+
+default['mode']['agent'] = "agent"
+default['mode']['controller'] = "controller"
+default['mode']['dual'] = "dual"
+
+default['agent']['mysql_user'] = "cmon"
+default['agent']['mysql_hostname'] = "127.0.0.1"
+default['agent']['mysql_password'] = "cmon"
+default['agent']['mysql_port'] = 3306
+default['agent']['hostname'] = node['ipaddress']
+
+default['cmon_mysql']['install_dir'] = "/"
+default['cmon_mysql']['basedir'] = "/usr"
+default['cmon_mysql']['bindir'] = "#{cmon_mysql['basedir']}/bin"
+default['cmon_mysql']['ndb_bindir'] = "#{cmon_mysql['basedir']}/bin"
+
default['xtra']['sleep'] = 60
-default['mysql']['root_password'] = "password"
-default['mysql']['mysql_bin'] = default['mysql']['bindir'] + "/mysql"
-
-default['mysql']['datadir'] = "/var/lib/mysql"
-default['mysql']['rundir'] = "/var/run/mysqld"
-default['mysql']['pid_file'] = default['mysql']['datadir'] + "/mysqld.pid"
-default['mysql']['socket'] = default['mysql']['rundir'] + "/mysqld.sock"
-
-default['mysql']['port'] = 3306
-default['mysql']['tmpdir'] = "/tmp"
-
-default['mysql']['innodb']['buffer_pool_size'] = "256M"
-default['mysql']['innodb']['flush_log_at_trx_commit'] = 2
-default['mysql']['innodb']['file_per_table'] = 1
-default['mysql']['innodb']['doublewrite'] = 0
-default['mysql']['innodb']['log_file_size'] = "512M"
-default['mysql']['innodb']['log_files_in_group'] = 2
-default['mysql']['innodb']['buffer_pool_instances'] = 1
-default['mysql']['innodb']['max_dirty_pages_pct'] = 75
-default['mysql']['innodb']['thread_concurrency'] = 0
-default['mysql']['innodb']['concurrency_tickets'] = 5000
-default['mysql']['innodb']['thread_sleep_delay'] = 10000
-default['mysql']['innodb']['lock_wait_timeout'] = 50
-default['mysql']['innodb']['io_capacity'] = 200
-default['mysql']['innodb']['read_io_threads'] = 4
-default['mysql']['innodb']['write_io_threads'] = 4
-
-default['mysql']['innodb']['file_format'] = "barracuda"
-default['mysql']['innodb']['flush_method'] = "O_DIRECT"
+default['cmon_mysql']['root_password'] = "password"
+default['cmon_mysql']['mysql_bin'] = "#{cmon_mysql['bindir']}/mysql"
+
+default['cmon_mysql']['datadir'] = "/var/lib/mysql"
+default['cmon_mysql']['rundir'] = "/var/run/mysqld"
+default['cmon_mysql']['pid_file'] = "#{cmon_mysql['datadir']}/mysqld.pid"
+default['cmon_mysql']['socket'] = "#{cmon_mysql['rundir']}/mysqld.sock"
+
+default['cmon_mysql']['port'] = 3306
+default['cmon_mysql']['tmpdir'] = "/tmp"
+
+default['cmon_mysql']['innodb']['buffer_pool_size'] = "256M"
+default['cmon_mysql']['innodb']['flush_log_at_trx_commit'] = 2
+default['cmon_mysql']['innodb']['file_per_table'] = 1
+default['cmon_mysql']['innodb']['doublewrite'] = 0
+default['cmon_mysql']['innodb']['log_file_size'] = "512M"
+default['cmon_mysql']['innodb']['log_files_in_group'] = 2
+default['cmon_mysql']['innodb']['buffer_pool_instances'] = 1
+default['cmon_mysql']['innodb']['max_dirty_pages_pct'] = 75
+default['cmon_mysql']['innodb']['thread_concurrency'] = 0
+default['cmon_mysql']['innodb']['concurrency_tickets'] = 5000
+default['cmon_mysql']['innodb']['thread_sleep_delay'] = 10000
+default['cmon_mysql']['innodb']['lock_wait_timeout'] = 50
+default['cmon_mysql']['innodb']['io_capacity'] = 200
+default['cmon_mysql']['innodb']['read_io_threads'] = 4
+default['cmon_mysql']['innodb']['write_io_threads'] = 4
+
+default['cmon_mysql']['innodb']['file_format'] = "barracuda"
+default['cmon_mysql']['innodb']['flush_method'] = "O_DIRECT"
#OTHER THINGS, BUFFERS ETC
-default['mysql']['misc']['max_connections'] = 200
-default['mysql']['misc']['thread_cache_size'] = 64
-default['mysql']['misc']['table_open_cache'] = 1024
+default['cmon_mysql']['misc']['max_connections'] = 200
+default['cmon_mysql']['misc']['thread_cache_size'] = 64
+default['cmon_mysql']['misc']['table_open_cache'] = 1024
-default['mysql']['repl_user'] = "repl"
-default['mysql']['repl_password'] = "repl"
+default['cmon_mysql']['repl_user'] = "repl"
+default['cmon_mysql']['repl_password'] = "repl"
-default['sql']['cmon_schema'] = default['install_dir_cmon'] + "/cmon/sql/cmon_db.sql"
-default['sql']['cmon_data'] = default['install_dir_cmon'] + "/cmon/sql/cmon_data.sql"
-default['sql']['controller_grants'] = default['install_dir_cmon'] + "/cmon/sql/cmon_controller_grants.sql"
-default['sql']['controller_agent_grants'] = default['install_dir_cmon'] + "/cmon/sql/cmon_controller_agent_grants.sql"
-default['sql']['agent_grants'] = default['install_dir_cmon'] + "/cmon/sql/cmon_agent_grants.sql"
+default['sql']['cmon_schema'] = "#{install_dir_cmon}/cmon/sql/cmon_db.sql"
+default['sql']['cmon_data'] = "#{install_dir_cmon}/cmon/sql/cmon_data.sql"
+default['sql']['controller_grants'] = "#{install_dir_cmon}/cmon/sql/cmon_controller_grants.sql"
+default['sql']['controller_agent_grants'] = "#{install_dir_cmon}/cmon/sql/cmon_controller_agent_grants.sql"
+default['sql']['agent_grants'] = "#{install_dir_cmon}/cmon/sql/cmon_agent_grants.sql"
default['rrd']['rrdtool'] = "/usr/bin/rrdtool"
default['rrd']['datadir'] = "/var/lib/cmon"
@@ -138,9 +131,9 @@
default['misc']['db_stats_collection_interval'] = 30
default['misc']['host_stats_collection_interval'] = 30
-default['mysql']['script_dir'] = "/usr/bin"
+default['cmon_mysql']['script_dir'] = "/usr/bin"
#default['cmon']['misc']['cmon_core_dir'] = ""
default['misc']['ndb_binary'] = ""
default['misc']['BACKUPDIR'] = ""
-default['misc']['IDENTITY'] = default['controller']['ssh_key']
+default['misc']['IDENTITY'] = "#{controller['ssh_key']}"
View
17 cmon/metadata.rb
@@ -1,16 +1,15 @@
maintainer "Severalnines AB"
maintainer_email "support@severalnines.com"
license "Apache 2.0"
-description "Installs and configures cmon controller and agent"
+description "Installs and configures ClusterControl controller and agents"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "0.1"
-recipe "cmon", "Includes the cmon agent"
-recipe "cmon::agent", "Installs cmon agent"
-recipe "cmon::controller", "Installs cmon controller"
-recipe "cmon::web", "Installs cmon web application"
-recipe "cmon::agent_packages", "Installs cmon agent required packages (psmisc libaio)"
-recipe "cmon::controller_packages", "Installs cmon controller requried packages (rrdtool mysql mysql-server)"
-recipe "cmon::web_packages", "Installs cmon web application required packages (apache2 php5-mysql php5-gd libapache2-mod-php5)"
+version "0.5"
+recipe "cmon::agent", "Installs the ClusterControl agent"
+recipe "cmon::controller", "Installs the ClusterControl controller"
+recipe "cmon::controller_mysql", "Installs ClusterControl MySQL server"
+recipe "cmon::controller_rrdtool", "Installs rrdtool to generate grapsh on the controller node"
+recipe "cmon::webapp", "Installs the ClusterControl web application"
+recipe "cmon::webserver", "Installs Apache2"
%w{ debian ubuntu centos fedora redhat }.each do |os|
supports os
View
11 cmon/recipes/agent.rb
@@ -20,8 +20,8 @@
install_flag = "/root/.s9s_agent_installed"
cmon_config = data_bag_item('s9s_controller', 'config')
-node['controller']['mysql_hostname'] = cmon_config['controller_host_ipaddress']
-node['cluster_type'] = cmon_config['type']
+node.set['controller']['mysql_hostname'] = cmon_config['controller_host_ipaddress']
+node.set['cluster_type'] = cmon_config['type']
cmon_tarball = cmon_config['cmon_tarball_' + node['kernel']['machine']]
# strip .tar.gz
@@ -67,7 +67,7 @@
end
execute "agent-install-privileges" do
- command "#{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -p#{node['mysql']['root_password']} < #{node['sql']['agent_grants']}"
+ command "#{node['cmon_mysql']['mysql_bin']} -uroot -h127.0.0.1 -p#{node['cmon_mysql']['root_password']} < #{node['sql']['agent_grants']}"
action :nothing
not_if { FileTest.exists?("#{install_flag}") }
end
@@ -95,7 +95,7 @@
service "cmon" do
action :nothing
-end
+end
template "cmon.agent.cnf" do
path "#{node['install_config_path']}/cmon.cnf"
@@ -118,9 +118,10 @@
service "cmon" do
supports :restart => true, :start => true, :stop => true, :status => true
action [:enable, :start]
-end
+end
execute "s9s-agent-installed" do
command "touch #{install_flag}"
action :run
+ not_if { FileTest.exists?("#{install_flag}") }
end
View
10 cmon/recipes/controller.rb
@@ -20,7 +20,6 @@
install_flag = "/root/.s9s_controller_installed"
cmon_config = data_bag_item('s9s_controller', 'config')
-#node['controller']['mysql_host name'] = node['ipaddress']
node.set['controller']['mysql_hostname'] = cmon_config['controller_host_ipaddress']
node.set['mode']['controller'] = cmon_config['mode']
node.set['cluster_type'] = cmon_config['type']
@@ -68,19 +67,19 @@
end
execute "controller-create-db-schema" do
- command "#{node['mysql']['mysql_bin']} -uroot -p#{node['mysql']['root_password']} < #{node['sql']['cmon_schema']}"
+ command "#{node['cmon_mysql']['mysql_bin']} -uroot -p#{node['cmon_mysql']['root_password']} < #{node['sql']['cmon_schema']}"
action :run
not_if { FileTest.exists?("#{install_flag}") }
end
execute "controller-import-tables" do
- command "#{node['mysql']['mysql_bin']} -uroot -p#{node['mysql']['root_password']} < #{node['sql']['cmon_data']}"
+ command "#{node['cmon_mysql']['mysql_bin']} -uroot -p#{node['cmon_mysql']['root_password']} < #{node['sql']['cmon_data']}"
action :run
not_if { FileTest.exists?("#{install_flag}") }
end
execute "controller-install-privileges" do
- command "#{node['mysql']['mysql_bin']} -uroot -p#{node['mysql']['root_password']} < #{node['sql']['controller_grants']}"
+ command "#{node['cmon_mysql']['mysql_bin']} -uroot -p#{node['cmon_mysql']['root_password']} < #{node['sql']['controller_grants']}"
action :nothing
not_if { FileTest.exists?("#{install_flag}") }
end
@@ -116,7 +115,7 @@
end
execute "controller-grant-agents" do
- command "#{node['mysql']['mysql_bin']} -uroot -p#{node['mysql']['root_password']} < #{node['sql']['controller_agent_grants']}"
+ command "#{node['cmon_mysql']['mysql_bin']} -uroot -p#{node['cmon_mysql']['root_password']} < #{node['sql']['controller_agent_grants']}"
action :run
not_if { FileTest.exists?("#{install_flag}") }
end
@@ -188,4 +187,5 @@
execute "s9s-controller-installed" do
command "touch #{install_flag}"
action :run
+ not_if { FileTest.exists?("#{install_flag}") }
end
View
20 cmon/recipes/controller_mysql.rb
@@ -43,15 +43,15 @@
end
# MySQL installed with no root password!
-# Let's secure it. Get root password from ['mysql']['root_password']
+# Let's secure it. Get root password from ['cmon_mysql']['root_password']
# todo: maybe erb or tmp file
bash "secure-mysql" do
user "root"
code <<-EOH
- #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "UPDATE mysql.user SET Password=PASSWORD('#{node['mysql']['root_password']}') WHERE User='root'"
- #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "DELETE FROM mysql.user WHERE User='';DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')"
- #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "DROP DATABASE test; DELETE FROM mysql.db WHERE DB='test' OR Db='test\\_%;"
- #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "FLUSH PRIVILEGES"
+ #{node['cmon_mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "UPDATE mysql.user SET Password=PASSWORD('#{node['cmon_mysql']['root_password']}') WHERE User='root'"
+ #{node['cmon_mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "DELETE FROM mysql.user WHERE User='';DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')"
+ #{node['cmon_mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "DROP DATABASE test; DELETE FROM mysql.db WHERE DB='test' OR Db='test\\_%;"
+ #{node['cmon_mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "FLUSH PRIVILEGES"
EOH
not_if { FileTest.exists?("#{install_flag}") }
end
@@ -84,7 +84,7 @@
end
execute "purge-innodb-logfiles" do
- command "rm #{node['mysql']['datadir']}/ib_logfile*"
+ command "rm #{node['cmon_mysql']['datadir']}/ib_logfile*"
action :run
not_if { FileTest.exists?("#{install_flag}") }
end
@@ -96,7 +96,15 @@
subscribes :restart, resources(:template => 'my.cnf')
end
+service "reload-mysql-cnf" do
+ service_name node['mysql']['service_name']
+ supports :stop => true, :start => true, :restart => true, :reload => true
+ action :restart
+ not_if { FileTest.exists?("#{install_flag}") }
+end
+
execute "s9s-controller-mysql-installed" do
command "touch #{install_flag}"
action :run
+ not_if { FileTest.exists?("#{install_flag}") }
end
View
1 cmon/recipes/webapp.rb
@@ -23,7 +23,6 @@
cmon_package = cmon_tarball[0..-8]
cmon_source = cmon_config['cmon_source']
-Chef::Log.info "Downloading #{cmon_tarball}"
remote_file "#{Chef::Config[:file_cache_path]}/#{cmon_tarball}" do
source "#{cmon_source}/#{cmon_tarball}"
action :create_if_missing
View
1 cmon/recipes/webserver.rb
@@ -50,4 +50,5 @@
execute "s9s-webserver-installed" do
command "touch #{install_flag}"
action :run
+ not_if { FileTest.exists?("#{install_flag}") }
end
View
2 cmon/templates/default/cmon.agent.cnf.erb
@@ -29,7 +29,7 @@ os=debian
skip_name_resolve=1
## CMON DB config - mysql_password is for the 'cmon' user
-#mysql_basedir=<%= node['mysql']['basedir'] %>
+#mysql_basedir=<%= node['cmon_mysql']['basedir'] %>
mysql_port=<%= node['controller']['mysql_port'] %>
mysql_hostname=<%= node['controller']['mysql_hostname'] %>
mysql_password=<%= node['controller']['mysql_password'] %>
View
4 cmon/templates/default/cmon.controller.cnf.erb
@@ -29,7 +29,7 @@ os=debian
skip_name_resolve=1
## CMON DB config - mysql_password is for the 'cmon' user
-#mysql_basedir=<%= node['mysql']['basedir'] %>
+#mysql_basedir=<%= node['cmon_mysql']['basedir'] %>
mysql_port=<%= node['controller']['mysql_port'] %>
#mysql_hostname=<%= node['controller']['mysql_hostname'] %>
mysql_hostname=127.0.0.1
@@ -77,7 +77,7 @@ datanode_addresses=
mgmnode_addresses=
###### LEGACY RRD SECTION - graphs ######
-mysql_bindir=<%= node['mysql']['bindir'] %>
+mysql_bindir=<%= node['cmon_mysql']['bindir'] %>
imagedir=<%= node['rrd']['imagedir'] %>
rrdtool=<%= node['rrd']['rrdtool'] %>
rrd_datadir=<%= node['rrd']['datadir'] %>
View
12 cmon/templates/default/cmon.controller.grants.sql.erb
@@ -19,13 +19,13 @@ INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'STAGI
INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'PURGE','7');
INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'LOG_COLLECTION','30');
INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'MYSQL_PORT','<%= node['controller']['mysql_port'] %>');
-INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'BINDIR','<%= node['mysql']['bindir'] %>');
-INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'ROOT_PASSWORD','<%= node['mysql']['root_password'] %>');
-INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'REPL_PASSWORD','<%= node['mysql']['repl_password'] %>');
-INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'REPL_USER','<%= node['mysql']['repl_user'] %>');
+INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'BINDIR','<%= node['cmon_mysql']['bindir'] %>');
+INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'ROOT_PASSWORD','<%= node['cmon_mysql']['root_password'] %>');
+INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'REPL_PASSWORD','<%= node['cmon_mysql']['repl_password'] %>');
+INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'REPL_USER','<%= node['cmon_mysql']['repl_user'] %>');
INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'NDB_CONNECTSTRING','<%= node['controller']['ndb_connectstring'] %>');
-INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'NDB_BINARY','<%= node['mysql']['ndb_bin_dir'] %>');
-INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'SCRIPTDIR','<%= node['mysql']['script_dir'] %>');
+INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'NDB_BINARY','<%= node['cmon_mysql']['ndb_bin_dir'] %>');
+INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'SCRIPTDIR','<%= node['cmon_mysql']['script_dir'] %>');
INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'PRE_INSTALLED_IMAGE',0);
INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'INSTALL_METHOD','TGZ');
INSERT IGNORE INTO cmon.cmon_configuration (cid, param, value) VALUES (1, 'OS_USER_HOME','<%= ENV['HOME'] %>');
View
2 cmon/templates/default/cmon_rrd.cnf.erb
@@ -2,7 +2,7 @@
mysql_port=3306
mysql_hostname=127.0.0.1
mysql_password=<%= node['controller']['mysql_password'] %>
-mysql_bindir=<%= node['mysql']['bindir'] %>
+mysql_bindir=<%= node['cmon_mysql']['bindir'] %>
imagedir=<%= node['rrd']['image_dir'] %>
rrdtool=<%= node['rrd']['rrdtool'] %>
rrd_datadir=<%= node['rrd']['datadir'] %>
View
60 cmon/templates/default/my.cmon.cnf.erb
@@ -8,34 +8,34 @@
[MYSQLD]
user=mysql
-basedir = <%= node['mysql']['basedir'] %>
-datadir = <%= node['mysql']['datadir'] %>
-pid_file = <%= node['mysql']['pid_file'] %>
-socket = <%= node['mysql']['socket'] %>
-port = <%= node['mysql']['port'] %>
+basedir = <%= node['cmon_mysql']['basedir'] %>
+datadir = <%= node['cmon_mysql']['datadir'] %>
+pid_file = <%= node['cmon_mysql']['pid_file'] %>
+socket = <%= node['cmon_mysql']['socket'] %>
+port = <%= node['cmon_mysql']['port'] %>
log_error = error.log
#log
#log_slow_queries
### INNODB
-innodb_buffer_pool_size = <%= node['mysql']['innodb']['buffer_pool_size'] %>
+innodb_buffer_pool_size = <%= node['cmon_mysql']['innodb']['buffer_pool_size'] %>
# buffer pool size > 1GB if you want multiple instances
-innodb_buffer_pool_instances = <%= node['mysql']['innodb']['buffer_pool_instances'] %>
-innodb_flush_log_at_trx_commit = <%= node['mysql']['innodb']['flush_log_at_trx_commit'] %>
-innodb_file_per_table = <%= node['mysql']['innodb']['file_per_table'] %>
-innodb_doublewrite= <%= node['mysql']['innodb']['doublewrite'] %>
-innodb_log_file_size = <%= node['mysql']['innodb']['log_file_size'] %>
-innodb_log_files_in_group = <%= node['mysql']['innodb']['log_files_in_group'] %>
-innodb_max_dirty_pages_pct = <%= node['mysql']['innodb']['max_dirty_pages_pct'] %>
-innodb_io_capacity = <%= node['mysql']['innodb']['io_capacity'] %>
-innodb_thread_concurrency = <%= node['mysql']['innodb']['thread_concurrency'] %>
-innodb_concurrency_tickets = <%= node['mysql']['innodb']['concurrency_tickets'] %>
-innodb_thread_sleep_delay = <%= node['mysql']['innodb']['thread_sleep_delay'] %>
-innodb_lock_wait_timeout = <%= node['mysql']['innodb']['lock_wait_timeout'] %>
-innodb_read_io_threads = <%= node['mysql']['innodb']['read_io_threads'] %>
-innodb_write_io_threads = <%= node['mysql']['innodb']['write_io_threads'] %>
-innodb_file_format = <%= node['mysql']['innodb']['file_format'] %>
-innodb_flush_method = <%= node['mysql']['innodb']['flush_method'] %>
+innodb_buffer_pool_instances = <%= node['cmon_mysql']['innodb']['buffer_pool_instances'] %>
+innodb_flush_log_at_trx_commit = <%= node['cmon_mysql']['innodb']['flush_log_at_trx_commit'] %>
+innodb_file_per_table = <%= node['cmon_mysql']['innodb']['file_per_table'] %>
+innodb_doublewrite= <%= node['cmon_mysql']['innodb']['doublewrite'] %>
+innodb_log_file_size = <%= node['cmon_mysql']['innodb']['log_file_size'] %>
+innodb_log_files_in_group = <%= node['cmon_mysql']['innodb']['log_files_in_group'] %>
+innodb_max_dirty_pages_pct = <%= node['cmon_mysql']['innodb']['max_dirty_pages_pct'] %>
+innodb_io_capacity = <%= node['cmon_mysql']['innodb']['io_capacity'] %>
+innodb_thread_concurrency = <%= node['cmon_mysql']['innodb']['thread_concurrency'] %>
+innodb_concurrency_tickets = <%= node['cmon_mysql']['innodb']['concurrency_tickets'] %>
+innodb_thread_sleep_delay = <%= node['cmon_mysql']['innodb']['thread_sleep_delay'] %>
+innodb_lock_wait_timeout = <%= node['cmon_mysql']['innodb']['lock_wait_timeout'] %>
+innodb_read_io_threads = <%= node['cmon_mysql']['innodb']['read_io_threads'] %>
+innodb_write_io_threads = <%= node['cmon_mysql']['innodb']['write_io_threads'] %>
+innodb_file_format = <%= node['cmon_mysql']['innodb']['file_format'] %>
+innodb_flush_method = <%= node['cmon_mysql']['innodb']['flush_method'] %>
#OTHER THINGS, BUFFERS ETC
key_buffer_size = 8M
@@ -50,21 +50,21 @@ memlock = 0
sysdate_is_now = 1
query_cache_type = 1
query_cache_size = 32M
-max_connections = <%= node['mysql']['misc']['max_connections'] %>
-thread_cache_size = <%= node['mysql']['misc']['thread_cache_size'] %>
-table_open_cache = <%= node['mysql']['misc']['table_open_cache'] %>
+max_connections = <%= node['cmon_mysql']['misc']['max_connections'] %>
+thread_cache_size = <%= node['cmon_mysql']['misc']['thread_cache_size'] %>
+table_open_cache = <%= node['cmon_mysql']['misc']['table_open_cache'] %>
lower_case_table_names = 0
[MYSQL]
-socket=<%= node['mysql']['socket'] %>
+socket=<%= node['cmon_mysql']['socket'] %>
[client]
port = 3306
-socket=<%= node['mysql']['socket'] %>
+socket=<%= node['cmon_mysql']['socket'] %>
[MYSQLD_SAFE]
-basedir = <%= node['mysql']['basedir'] %>
-datadir = <%= node['mysql']['datadir'] %>
-pid_file = <%= node['mysql']['pid_file'] %>
+basedir = <%= node['cmon_mysql']['basedir'] %>
+datadir = <%= node['cmon_mysql']['datadir'] %>
+pid_file = <%= node['cmon_mysql']['pid_file'] %>
log_error = error.log
syslog
View
2 cmon/templates/default/mysql_secure_installation.sql.erb
@@ -1,5 +1,5 @@
SET SQL_LOG_BIN=0;
-UPDATE mysql.user SET Password=PASSWORD('<%= node['mysql']['root_password'] %>') WHERE User='root';
+UPDATE mysql.user SET Password=PASSWORD('<%= node['cmon_mysql']['root_password'] %>') WHERE User='root';
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DROP DATABASE test;
View
97 galera/README.md
@@ -1,15 +1,20 @@
Description
===========
-Installs a Codership's MySQL Galera cluster node.
+Installs Codership's MySQL Galera cluster (http://http://www.codership.com/).
+Galera Cluster provides synchronous multi-master replication for MySQL (replication plugin).
-This cookbook should be used initially for development/tests and not in production.
+* No master failover scripting (automatic failover and recovery)
+* No slave lag
+* Read and write to any node
+* Write scalabilty
+* WAN Clustering
-It currently does not handle a full cluster restart properly by itself, i.e., it does
-not select a node that has the most recent committed transactions as the donor.
-You might end up loosing data if the wrong node becomes the donor node.
+This cookbook enables you to install a Galera cluster from scratch. At minimum you would probaly only need to change a few attributes like
-You can deploy ClusterControl which is able to select a correct node to use when doing a
-complete cluster restart.
+* ['mysql']['root_password'] = "password"
+* ['mysql']['innodb']['buffer_pool_size'] = "256M"
+
+You can also deploy our ClusterControl coookbook with the Galera Cluster which provide additional control and monitoring features.
Howto: Chef, MySQL Galera and ClusterControl
http://support.severalnines.com/entries/21453521-opscode-s-chef-mysql-galera-and-clustercontrol
@@ -24,28 +29,48 @@ Platform
Tested on:
-* Ubuntu 11.10/12.04 w/ Chef (Solo) 0.10.8/0.10.10
+* Ubuntu 12.04 w/ Chef-server 10.16.2 and Galera Cluster v2.2
+* Ubuntu 11.10/12.04 w/ Chef-solo 0.10.8/0.10.10 and Galera Cluster v2.1
Attributes
==========
-* ['galera']['install_dir'] = "/usr/local"
-
-* ['mysql']['root_password'] = "password"
-* ['mysql']['datadir'] = "/var/lib/mysql"
-* ['mysql']['innodb']['buffer_pool_size'] = "128M"
-* ['mysql']['innodb']['log_file_size'] = "256M"
-
-* ['wsrep']['cluster_name'] = "my_galera_cluster"
-* ['wsrep']['slave_threads'] = 1
-* ['wsrep']['certify_nonPK'] = 1
-* ['wsrep']['max_ws_rows'] = 131072
-* ['wsrep']['max_ws_size'] = 1073741824
-* ['wsrep']['retry_autocommit'] = 1
-* ['wsrep']['auto_increment_control'] = 1
-* ['wsrep']['user'] = "wsrep_sst"
-* ['wsrep']['password'] = "wsrep"
-* ['wsrep']['sst_method'] = "mysqldump"
+* node['galera']['install_dir'] = "/usr/local"
+* node['mysql']['root_password'] = "password"
+
+* node['mysql']['basedir'] = "/usr/local"
+* node['mysql']['datadir'] = "/var/lib/mysql"
+* node['mysql']['rundir'] = "/var/run/mysqld"
+* node['mysql']['pid_file'] = /var/lib/mysql/mysqld.pid"
+* node['mysql']['socket'] = /var/run/mysqld/mysqld.sock"
+* node['mysql']['port'] = 3306
+* node['mysql']['tmpdir'] = "/tmp"
+
+* node['mysql']['innodb']['buffer_pool_size'] = "256M"
+* node['mysql']['innodb']['flush_log_at_trx_commit'] = 2
+* node['mysql']['innodb']['file_per_table'] = 1
+* node['mysql']['innodb']['doublewrite'] = 0
+* node['mysql']['innodb']['log_file_size'] = "512M"
+* node['mysql']['innodb']['log_files_in_group'] = 2
+* node['mysql']['innodb']['buffer_pool_instances'] = 1
+* node['mysql']['innodb']['max_dirty_pages_pct'] = 75
+* node['mysql']['innodb']['thread_concurrency'] = 0
+* node['mysql']['innodb']['concurrency_tickets'] = 5000
+* node['mysql']['innodb']['thread_sleep_delay'] = 10000
+* node['mysql']['innodb']['lock_wait_timeout'] = 50
+* node['mysql']['innodb']['io_capacity'] = 200
+* node['mysql']['innodb']['read_io_threads'] = 4
+* node['mysql']['innodb']['write_io_threads'] = 4
+
+* node['mysql']['innodb']['file_format'] = "barracuda"
+* node['mysql']['innodb']['flush_method'] = "O_DIRECT"
+
+* node['wsrep']['cluster_name'] = "my_galera_cluster"
+* node['wsrep']['slave_threads'] = 1
+* node['wsrep']['certify_nonPK'] = 1
+* node['wsrep']['max_ws_rows'] = 131072
+* node['wsrep']['max_ws_size'] = 1073741824
+* node['wsrep']['retry_autocommit'] = 1
and more in attributes/default.rb
@@ -72,30 +97,34 @@ s9s_galera / config.json
"mysql_wsrep_tarball_x86_64": "mysql-5.5.23_wsrep_23.6-linux-x86_64.tar.gz",
"mysql_wsrep_tarball_i686": "mysql-5.5.23_wsrep_23.6-linux-i686.tar.gz",
"galera_package_i386": {
- "deb": "galera-23.2.1-i386.deb",
- "rpm": "galera-23.2.1-1.rhel5.i386.rpm"},
+ "deb": "galera-23.2.2-i386.deb",
+ "rpm": "galera-23.2.2-1.rhel5.i386.rpm"},
"galera_package_x86_64": {
- "deb": "galera-23.2.1-amd64.deb",
- "rpm": "galera-23.2.1-1.rhel5.x86_64.rpm"
+ "deb": "galera-23.2.2-amd64.deb",
+ "rpm": "galera-23.2.2-1.rhel5.x86_64.rpm"
},
"mysql_wsrep_source": "https://launchpad.net/codership-mysql/5.5/5.5.23-23.6/+download",
- "galera_source": "https://launchpad.net/galera/2.x/23.2.1/+download",
- "sst_method": "mysqldump",
+ "galera_source": "https://launchpad.net/galera/2.x/23.2.2/+download",
+ "sst_method": "rsync",
+ "init_node": "192.168.122.12",
"galera_nodes": [
"192.168.122.12",
"192.168.122.14",
"192.168.122.16"
- ]
+ ],
+ "secure": "yes",
+ "update_wsrep_urls": "no"
}
-* **galera_nodes**
+* **galera_nodes**
These are the IP addresses where you have MySQL Galera nodes running and a random host in this list will be used as the cluster URL for a galera node if the galera recipe is "reloaded".
-* **sst_method**
+* **sst_method**
State Snapshot Transfer method, 'mysqldump', 'rsync' or 'rsync_wan'.
Change History
===============
+* v0.3 - Add init_node which specifies the intital donor node.
* v0.2 - Use wsrep_urls with mysqld_safe
* v0.1 - Initial recipe based upon MySQL Galera 5.5.23
View
21 galera/attributes/default.rb
@@ -1,36 +1,33 @@
-default['galera']['install_dir'] = "/usr/local"
-
case node['platform']
when 'centos', 'redhat', 'fedora', 'suse', 'scientific', 'amazon'
- default['mysql']['basedir'] = default['galera']['install_dir'] + "/mysql"
- default['mysql']['bindir'] = default['mysql']['basedir'] + "/bin"
default['mysql']['servicename'] = "mysqld"
-
default['xtra']['packages'] = "openssl psmisc libaio wget rsync nc"
else
- default['mysql']['basedir'] = default['galera']['install_dir'] + "/mysql"
- default['mysql']['bindir'] = default['mysql']['basedir'] + "/bin"
default['mysql']['servicename'] = "mysql"
-
default['xtra']['packages'] = "libssl0.9.8 psmisc libaio1 wget rsync netcat"
end
+default['galera']['install_dir'] = "/usr/local"
+
+default['mysql']['basedir'] = "#{galera['install_dir']}/mysql"
+default['mysql']['bindir'] = "#{mysql['basedir']}/bin"
+
default['xtra']['sleep'] = 60
default['mysql']['root_password'] = "password"
-default['mysql']['mysqlbin'] = default['mysql']['bindir'] + "/mysql"
+default['mysql']['mysqlbin'] = "#{mysql['bindir']}/mysql"
default['mysql']['datadir'] = "/var/lib/mysql"
default['mysql']['rundir'] = "/var/run/mysqld"
-default['mysql']['pid_file'] = default['mysql']['datadir'] + "/mysqld.pid"
-default['mysql']['socket'] = default['mysql']['rundir'] + "/mysqld.sock"
+default['mysql']['pid_file'] = "#{mysql['datadir']}/mysqld.pid"
+default['mysql']['socket'] = "#{mysql['rundir']}/mysqld.sock"
default['mysql']['port'] = 3306
default['mysql']['tmpdir'] = "/tmp"
-default['mysql']['innodb']['buffer_pool_size'] = "128M"
+default['mysql']['innodb']['buffer_pool_size'] = "256M"
default['mysql']['innodb']['flush_log_at_trx_commit'] = 2
default['mysql']['innodb']['file_per_table'] = 1
default['mysql']['innodb']['doublewrite'] = 0
View
10 galera/data_bags/s9s_galera/config.json
@@ -3,14 +3,14 @@
"mysql_wsrep_tarball_x86_64": "mysql-5.5.23_wsrep_23.6-linux-x86_64.tar.gz",
"mysql_wsrep_tarball_i686": "mysql-5.5.23_wsrep_23.6-linux-i686.tar.gz",
"galera_package_i386": {
- "deb": "galera-23.2.1-i386.deb",
- "rpm": "galera-23.2.1-1.rhel5.i386.rpm"},
+ "deb": "galera-23.2.2-i386.deb",
+ "rpm": "galera-23.2.2-1.rhel5.i386.rpm"},
"galera_package_x86_64": {
- "deb": "galera-23.2.1-amd64.deb",
- "rpm": "galera-23.2.1-1.rhel5.x86_64.rpm"
+ "deb": "galera-23.2.2-amd64.deb",
+ "rpm": "galera-23.2.2-1.rhel5.x86_64.rpm"
},
"mysql_wsrep_source": "https://launchpad.net/codership-mysql/5.5/5.5.23-23.6/+download",
- "galera_source": "https://launchpad.net/galera/2.x/23.2.1/+download",
+ "galera_source": "https://launchpad.net/galera/2.x/23.2.2/+download",
"sst_method": "rsync",
"init_node": "chef-2",
"galera_nodes": [
View
2 galera/metadata.rb
@@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs a MySQL Galera Node"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "0.1.0"
+version "0.3"
recipe "galera", "Installs a MySQL Galera node"
%w{ debian ubuntu centos fedora redhat }.each do |os|
View
5 galera/recipes/server.rb
@@ -167,8 +167,8 @@
mode "0644"
end
-my_ip = node['hostname'].downcase
-init_host = galera_config['init_node'].downcase
+my_ip = node['ipaddress']
+init_host = galera_config['init_node']
sync_host = init_host
Chef::Log.info "My host = #{my_ip}"
@@ -253,5 +253,6 @@
execute "s9s-galera-installed" do
command "touch #{install_flag}"
action :run
+ not_if { FileTest.exists?("#{install_flag}") }
end
View
14 roles/cc_agent.rb
@@ -1,10 +1,10 @@
name "cc_agent"
description "ClusterControl Agent"
run_list ["recipe[cmon::agent_packages]", "recipe[cmon::agent]"]
-#override_attributes({
-# "mysql" => {
-# "install_dir" => "/usr/local",
-# "mysql_bin" => "/usr/local/mysql/bin/mysql",
-# "root_password" => "password"}
-# }
-#)
+override_attributes({
+ "cmon_mysql" => {
+ "install_dir" => "/usr/local",
+ "mysql_bin" => "/usr/local/mysql/bin/mysql",
+ "root_password" => "password"}
+ }
+)

0 comments on commit 8e08eec

Please sign in to comment.