From e2483aca5f1cdec6d7c69a75e9b9394da61fe183 Mon Sep 17 00:00:00 2001 From: rpedde Date: Thu, 7 Jun 2012 12:32:28 -0500 Subject: [PATCH 1/2] process monitoring for mysql --- attributes/default.rb | 17 +++++++++++++++-- recipes/nova-db.rb | 30 ++++++++++++++++++++++++++++++ recipes/nova-setup-monitoring.rb | 1 - 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 recipes/nova-db.rb diff --git a/attributes/default.rb b/attributes/default.rb index e9a10326..88af56a7 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -112,7 +112,13 @@ when "fedora" "libvirt_service" => "libvirtd", "common_packages" => ["openstack-nova"], "iscsi_helper" => "ietadm", - "package_overrides" => "" + "package_overrides" => "", + "monit_commands" => { + "mysqld" => { + "start" => "/usr/sbin/service mysqld start", + "stop" => "/usr/sbin/service mysqld stop" + } + } } when "ubuntu" default["nova"]["platform"] = { @@ -140,6 +146,13 @@ when "ubuntu" "libvirt_service" => "libvirt-bin", "common_packages" => ["nova-common"], "iscsi_helper" => "tgtadm", - "package_overrides" => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" + "package_overrides" => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'", + "monit_commands" => { + "mysqld" => { + "start" => "/usr/sbin/service mysql start", + "stop" => "/usr/sbin/service mysql stop" + } + } + } end diff --git a/recipes/nova-db.rb b/recipes/nova-db.rb new file mode 100644 index 00000000..6056587a --- /dev/null +++ b/recipes/nova-db.rb @@ -0,0 +1,30 @@ +# +# Cookbook Name:: nova +# Recipe:: nova-db +# +# Copyright 2009, Rackspace Hosting, Inc. +# +# 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_recipe "nova::nova-common" +include_recipe "monit::server" +include_recipe "mysql::server" + +platform_options = node["nova"]["platform"] + +monit_procmon "mysqld" do + process_name "mysqld" + start_cmd platform_options["monit_commands"]["mysqld"]["start"] + stop_cmd platform_options["monit_commands"]["mysqld"]["stop"] +end diff --git a/recipes/nova-setup-monitoring.rb b/recipes/nova-setup-monitoring.rb index 0909c7a1..2848325c 100644 --- a/recipes/nova-setup-monitoring.rb +++ b/recipes/nova-setup-monitoring.rb @@ -25,7 +25,6 @@ include_recipe "collectd-graphite::collectd-client" # First, let's monitor mysql - # this gets me credentials, still need per-role info on db name mysql_info = get_settings_by_role("mysql-master", "mysql") From 0e6c780b79b5e83b7f1d9190291c38ffd669e5e0 Mon Sep 17 00:00:00 2001 From: rpedde Date: Thu, 7 Jun 2012 12:37:47 -0500 Subject: [PATCH 2/2] oops... add dep on monit. food critic, dang you. --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index b55e7469..8bf9f62b 100644 --- a/metadata.rb +++ b/metadata.rb @@ -10,6 +10,6 @@ version "1.0.5" supports os end -%w{ apt collectd-graphite database glance keystone mysql openssh rabbitmq selinux osops-utils }.each do |dep| +%w{ apt collectd-graphite database glance keystone mysql openssh rabbitmq selinux osops-utils monit }.each do |dep| depends dep end