From ac591c59d5ce1d8056c0bb7c42dcf3f2c820f243 Mon Sep 17 00:00:00 2001 From: Richard Shade Date: Tue, 28 Feb 2017 11:24:35 -0600 Subject: [PATCH] Update service version (#72) * chef 12 migration * remove obsolute recipe * chef 12 migration * adding tuning config * fix ruby version * fix packages * sync options with older version * fix ruby version * adding .lock files * update mysql to mysql2, use mysql2 to test connections for master/slave * Rakefile update * updating Gemfile * dealing with merge conflicts * updating for cookstyle, and tests * updating Rake and Gemfile * cookstyle autocorrect * updating to only tunable and rs-mysql * updating my.cnf creation * fixing tune attributes * changing 4 to 5 * upping to > 1024 memory * deleting log files after tuning * adding apt * reverting old changes * updating tests, specifying gem version * fixing specs * sending notification immediately * updating apt settings * removing Berksfile.lock * updating tests * updating for rs-base, and tests * adding rs-base, commenting out bad tests * adding create_secrets * using timestamp * updating slave_monitors for rs-base change * adding path to socket file * updating connect for master and log days * updating, adding socket * adding change_master to log * creating the repl user * doing create and grant separately * fixing mispelling * removing broken test * no need for slave to have master rep user * fixing master user creation, and deprecating test * updating master * adding in dependent cookbook attributes * fixing cookstyle * updating for mysql-default in volume and stripe * updating scripts for apparmor, fixing mysql_service_name, and fixing mysql rights * adding dns, dns seems to be abandoned * changing back to rightscale_development_v2 * adding log link for back compatibility * fixing mysql2 connection info * fixing test * updating specs * fixing backup_spec * fixing errors in specs * fixing single quotes from cookstyle * updating Berksfile and Rakefile. Removing branch pins * updating lock file * updating readme * updating berksfile, and kitchen * separating create and start to add mysql user * fixing syling * Add azurerm private IP bind support * Failsafe in bindip helper to skip cloud_v2 if it is null * temporarily ignore block nesting issues in the helper * commiting berksfile * updating for /var/log change * fixing cookstyle and adding more open files * removing selinux_policy * explicitly passing data_dir * removing enforcing check * updating data_dir * updating getenforce for compile_time * hard setting log path, and mvoing dir update * adding in custom work for centos 7 * cleaning up selinux file * going ahead and updating cookstyle * reverting 0 change * fixin to 390 * fixing frozen string * updating helper to have the right less than * doing 390,391,392 * update service on rs-mysql * fixing table_open_cache issue * Eph 3.0 (#75) * updating cookbook for ephemeral_lvm > 3 * updating eph_lvm * updating version * updating readme for mysql versions * updating changelog to reflect changes Signed-off-by: Richard Shade --- .kitchen.yml | 58 +++++++++++++++++++ .ruby-version | 2 +- Berksfile.lock | 47 +++++++-------- CHANGELOG.md | 6 ++ README.md | 6 +- .../old_mysql_cookbook_server_attributes.rb | 4 +- metadata.rb | 6 +- recipes/default.rb | 1 + templates/default/tunable.erb | 4 +- 9 files changed, 99 insertions(+), 35 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 95dbee5..439e6cd 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -61,6 +61,64 @@ suites: rs-mysql: backup: lineage: 'lineage' + mysql: + version: '5.5' + server_root_password: rootpass + server_repl_password: realpass + server_usage: dedicated + application_username: appuser + application_password: apppass + application_database_name: app_test + rightscale: + instance_uuid: '1111111' + +- name: default-56 + run_list: + - recipe[rs-mysql::default] + - recipe[rs-mysql::collectd] + - recipe[fake::database_mysql] + attributes: + apt: + compile_time_update: true + cloud: + provider: 'vagrant' + public_ips: ['100.64.1.1'] + private_ips: ['10.0.2.15'] + rs-base: + collectd_server: 'tss-4.rightscale.com' + rs-mysql: + backup: + lineage: 'lineage' + mysql: + version: '5.6' + server_root_password: rootpass + server_repl_password: realpass + server_usage: dedicated + application_username: appuser + application_password: apppass + application_database_name: app_test + rightscale: + instance_uuid: '1111111' + +- name: default-57 + run_list: + - recipe[rs-mysql::default] + - recipe[rs-mysql::collectd] + - recipe[fake::database_mysql] + attributes: + apt: + compile_time_update: true + cloud: + provider: 'vagrant' + public_ips: ['100.64.1.1'] + private_ips: ['10.0.2.15'] + rs-base: + collectd_server: 'tss-4.rightscale.com' + rs-mysql: + backup: + lineage: 'lineage' + mysql: + version: '5.7' server_root_password: rootpass server_repl_password: realpass server_usage: dedicated diff --git a/.ruby-version b/.ruby-version index 276cbf9..2bf1c1c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.0 +2.3.1 diff --git a/Berksfile.lock b/Berksfile.lock index 04fc93c..21e07ff 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -9,11 +9,11 @@ DEPENDENCIES path: test/cookbooks/fake filesystem git: https://github.com/rightscale-cookbooks-contrib/filesystem_cookbook.git - revision: 9c2a21a8aa41b16d3774ed5292f9a31b018dee92 + revision: eb4bd72462aada927d17d57fcd8da32095a24650 branch: update_lvm_cookbook_dependency_3 machine_tag git: https://github.com/rightscale-cookbooks/machine_tag.git - revision: 581dd0b7ddf2e65939527bb5e6c6c47788d1bf33 + revision: e3b01e6e3af364ce2ee73a28445f08c833a2ac3f marker git: https://github.com/rightscale-cookbooks/marker.git revision: 058e70879408fceceb628c600d487b1ddfa06cdb @@ -29,7 +29,7 @@ DEPENDENCIES revision: 48c24ba0f0815e86200793ef50fe27dce9f09d8e rs-base git: https://github.com/rightscale-cookbooks/rs-base.git - revision: 501761b8977004bee8d38c10b42434c37362d6cb + revision: 5d66d7b46d49d7c2a9eda6dafd12585c8abdfd0c rs-mysql path: . metadata: true @@ -37,10 +37,8 @@ DEPENDENCIES yum-epel GRAPH - apt (5.1.0) - compat_resource (>= 12.16.3) - build-essential (7.0.3) - compat_resource (>= 12.16.3) + apt (6.0.1) + build-essential (8.0.0) mingw (>= 1.1) seven_zip (>= 0.0.0) chef-sugar (3.4.0) @@ -58,19 +56,20 @@ GRAPH build-essential (>= 1.1.0) hosts_file (~> 0.1.4) xml (~> 1.2.0) - ephemeral_lvm (2.0.0) - lvm (~> 3.1) + ephemeral_lvm (3.0.0) + lvm (>= 4.0) + now (>= 0.0.0) fake (0.1.0) database (>= 0.0.0) mysql2_chef_gem (>= 0.0.0) rightscale_tag (>= 0.0.0) rs-mysql (>= 0.0.0) filesystem (0.11.0) - lvm (~> 3.1) + lvm (>= 1.1.0) xfs (>= 0.0.0) hosts_file (0.1.4) - lvm (3.1.0) - machine_tag (2.0.1) + lvm (4.0.5) + machine_tag (2.0.2) apt (>= 0.0.0) build-essential (>= 0.0.0) mariadb (1.0.1) @@ -78,17 +77,16 @@ GRAPH yum (>= 0.0.0) yum-epel (>= 0.0.0) marker (2.0.0) - mingw (1.2.5) - compat_resource (>= 12.16.3) + mingw (2.0.0) seven_zip (>= 0.0.0) mysql (8.2.0) mysql2_chef_gem (1.1.0) build-essential (>= 0.0.0) mariadb (>= 0.0.0) mysql (>= 6.0) + now (1.0.0) ntp (3.3.1) - ohai (4.2.3) - compat_resource (>= 12.14.7) + ohai (5.0.0) openssl (6.1.1) packagecloud (0.2.5) poise (2.7.2) @@ -108,11 +106,11 @@ GRAPH marker (~> 2.0) rightscale_volume (2.0.0) build-essential (>= 0.0.0) - rs-base (2.0.0) + rs-base (2.0.1) apt (>= 0.0.0) collectd (~> 2.2.2) collectd_plugins (~> 2.1.3) - ephemeral_lvm (= 2.0.0) + ephemeral_lvm (~> 3.0) machine_tag (~> 2.0) marker (>= 0.0.0) ntp (>= 0.0.0) @@ -120,15 +118,15 @@ GRAPH rsyslog (>= 0.0.0) swap (>= 0.0.0) yum-epel (>= 0.0.0) - rs-mysql (2.0.1) + rs-mysql (2.0.2) build-essential (>= 0.0.0) chef_handler (>= 0.0.0) collectd (>= 0.0.0) database (>= 0.0.0) dns (>= 0.0.0) - ephemeral_lvm (~> 2.0) + ephemeral_lvm (~> 3.0) filesystem (>= 0.0.0) - lvm (~> 3.1) + lvm (>= 0.0.0) marker (~> 2.0) mysql (>= 0.0.0) mysql2_chef_gem (>= 0.0.0) @@ -137,21 +135,20 @@ GRAPH rightscale_volume (~> 2.0) rs-base (~> 2.0) yum-mysql-community (>= 0.0.0) - rsyslog (5.1.0) - compat_resource (>= 12.14.6) + rsyslog (6.0.0) runit (3.0.5) packagecloud (>= 0.0.0) yum-epel (>= 0.0.0) seven_zip (2.0.2) windows (>= 1.2.2) - swap (0.3.8) + swap (2.0.0) windows (2.1.1) ohai (>= 4.0.0) xfs (2.0.1) xml (1.2.13) build-essential (>= 0.0.0) chef-sugar (>= 0.0.0) - yum (4.1.0) + yum (5.0.0) yum-epel (2.1.1) compat_resource (>= 12.16.3) yum-mysql-community (2.0.3) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5909fe..0dd0eda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ rs-mysql Cookbook CHANGELOG This file is used to list changes made in each version of the rs-mysql cookbook. +v2.0.2 +------ +- adds ephemeral_lvm > 3.0 +- allows customizable mysql server versions, refer to README.md for supported versions. +- updated test-kitchen to allow for testing for multiple versions. + v2.0.1 ------ - adds azure rm support for private ips, issue: [#68][] diff --git a/README.md b/README.md index 209a117..fb3cb53 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,10 @@ Github Repository: [https://github.com/rightscale-cookbooks/rs-mysql](https://gi * See cookbook version 1.2.6 for chef11 support * See cookbook version 1.1.9 for RightLink 6 support * Platform - * Ubuntu 12.04 - * CentOS 6 + * Ubuntu 12.04(MySQL 5.5, MySQL 5.6) + * Ubuntu 14.04(MySQL 5.5, MySQL 5.6) + * CentOS 6(MySQL 5.5, MySQL 5.6, MySQL 5.7) + * CentOS 7(MySQL 5.5, MySQL 5.6, MySQL 5.7) * Cookbooks * [marker](http://community.opscode.com/cookbooks/marker) * [mysql](http://community.opscode.com/cookbooks/mysql) diff --git a/attributes/old_mysql_cookbook_server_attributes.rb b/attributes/old_mysql_cookbook_server_attributes.rb index d08d39b..033d6c5 100644 --- a/attributes/old_mysql_cookbook_server_attributes.rb +++ b/attributes/old_mysql_cookbook_server_attributes.rb @@ -41,8 +41,8 @@ default['rs-mysql']['tunable']['bulk_insert_buffer_size'] = node['rs-mysql']['tunable']['tmp_table_size'] default['rs-mysql']['tunable']['net_read_timeout'] = '30' default['rs-mysql']['tunable']['net_write_timeout'] = '30' -default['rs-mysql']['tunable']['table_cache'] = '128' -default['rs-mysql']['tunable']['table_open_cache'] = node['rs-mysql']['tunable']['table_cache'] # table_cache is deprecated +default['rs-mysql']['tunable']['table_cache'] = '128' if node['rs-mysql']['mysql']['version'] < '5.5' +default['rs-mysql']['tunable']['table_open_cache'] = '128' if node['rs-mysql']['mysql']['version'] > '5.5' # in favor of table_open_cache default['rs-mysql']['tunable']['thread_cache_size'] = 8 default['rs-mysql']['tunable']['thread_concurrency'] = 10 diff --git a/metadata.rb b/metadata.rb index 5fd0e5d..544dc51 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ license 'Apache 2.0' description 'Installs and configures a MySQL server' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '2.0.1' +version '2.0.2' issues_url 'https://github.com/rightscale-cookbooks/rs-mysql/issues' if respond_to?(:issues_url) source_url 'https://github.com/rightscale-cookbooks/rs-mysql' if respond_to?(:source_url) chef_version '>= 12.0' if respond_to?(:chef_version) @@ -19,8 +19,8 @@ depends 'collectd' depends 'rightscale_tag', '~> 2.0' depends 'filesystem' -depends 'ephemeral_lvm', '~> 2.0' -depends 'lvm', '~> 3.1' +depends 'ephemeral_lvm', '~> 3.0' +depends 'lvm' depends 'rightscale_volume', '~> 2.0' depends 'rightscale_backup', '~> 2.0' depends 'build-essential' diff --git a/recipes/default.rb b/recipes/default.rb index a2a8d31..4519fb3 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -183,6 +183,7 @@ class Chef::Recipe mysql_service 'default' do initial_root_password node['rs-mysql']['server_root_password'] + version node['rs-mysql']['mysql']['version'] action [:create] end diff --git a/templates/default/tunable.erb b/templates/default/tunable.erb index 64b2e6a..a58f15a 100644 --- a/templates/default/tunable.erb +++ b/templates/default/tunable.erb @@ -28,10 +28,10 @@ wait_timeout = <%= @config['wait_timeout'] %> net_read_timeout = <%= @config['net_read_timeout'] %> net_write_timeout = <%= @config['net_write_timeout'] %> back_log = <%= @config['back_log'] %> -<%- if node['mysql']['version'].to_f >= 5.6 %> +<%- if node['rs-mysql']['mysql']['version'].to_f >= 5.6 %> table_open_cache = <%= @config['table_open_cache'] %> <%- else %> -table_cache = <%= @config['table_open_cache'] %> +table_cache = <%= @config['table_cache'] %> <%- end %> tmp_table_size = <%= @config['tmp_table_size'] %>