Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add Gemfile, and some whitespace / Documentation cleanup #3

Merged
merged 2 commits into from

2 participants

@jthurman42

Some minor space trimming, and the addition of a Gemfile to make things a little easier to get up and running.

@wjessop wjessop merged commit 9eee04b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 48 additions and 6 deletions.
  1. +9 −0 Gemfile
  2. +33 −0 Gemfile.lock
  3. +1 −1  README.md
  4. +5 −5 mysql_role_swap.rb
View
9 Gemfile
@@ -0,0 +1,9 @@
+source "http://rubygems.org"
+
+gem 'mysql', '2.8.1'
+gem 'activerecord'
+#gem 'activerecord-mysql-adapter'
+gem 'statemachine'
+gem 'colorize'
+gem 'choice'
+
View
33 Gemfile.lock
@@ -0,0 +1,33 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activemodel (3.2.9)
+ activesupport (= 3.2.9)
+ builder (~> 3.0.0)
+ activerecord (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activesupport (3.2.9)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.4)
+ choice (0.1.6)
+ colorize (0.5.8)
+ i18n (0.6.1)
+ multi_json (1.4.0)
+ mysql (2.8.1)
+ statemachine (2.0.1)
+ tzinfo (0.3.35)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord
+ choice
+ colorize
+ mysql (= 2.8.1)
+ statemachine
View
2  README.md
@@ -79,7 +79,7 @@ Using the "-d" option:
Floating IP Role: slave
MySQL Version: [5.1.45-log]
Read-Only: true
- Arping Path: /usr/bin/arpingon:[5.1.45-log] Read-Only: true
+ Arping Path: /usr/bin/arping
# Getting help and contributing
View
10 mysql_role_swap.rb
@@ -66,7 +66,7 @@
desc 'Show version'
action do
puts "MySQL Role Swap v#{PROGRAM_VERSION}"
- exit
+ exit
end
end
end
@@ -199,7 +199,7 @@ def self.max_connections
def self.hostname
`host #{self.config['host']}`.split(" ").last.gsub(/.\Z/, "").split(".").first
end
-
+
end
class DatabaseTwo < ActiveRecord::Base
@@ -416,7 +416,7 @@ def check_configuration
puts "MySQL Configuration....Fail. The read/write states of the master or slave are wrong.".red
@statemachine.bad_config
exit EXIT_WARNING
- end
+ end
end
def check_replicaton
@@ -472,7 +472,7 @@ def remove_vip
def set_read_only
if @master
@master.connection.execute("SET GLOBAL read_only = ON")
- puts "Set Master to Read-Only....OK"
+ puts "Set Master to Read-Only....OK"
@statemachine.verify_master_binlog_position
else
puts "Set Master to Read-Only....DOWN"
@@ -742,4 +742,4 @@ def replication_seconds_behind(db)
on_entry :check_read_write_states
end
context MysqlSwitchRoleContext.new
-end
+end
Something went wrong with that request. Please try again.