reptile 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .idea
2
+ pkg
3
+
data/Rakefile CHANGED
@@ -2,23 +2,22 @@ require 'rubygems' unless ENV['NO_RUBYGEMS']
2
2
  %w[rake rake/clean fileutils newgem rubigen].each { |f| require f }
3
3
  require File.dirname(__FILE__) + '/lib/reptile'
4
4
 
5
- # Generate all the Rake tasks
6
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
7
- $hoe = Hoe.new('reptile', Reptile::VERSION) do |p|
8
- p.developer('Nick Stielau', 'nick.stielau@gmail.com')
9
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
10
- p.post_install_message = 'PostInstall.txt'
11
- p.rubyforge_name = p.name
12
- p.bin_files = ["bin/replication_status"]
13
- p.summary = "Cold-blooded MySQL replication monitoring."
14
- p.extra_dev_deps = [
15
- ['newgem', ">= #{::Newgem::VERSION}"]
16
- ]
17
-
18
- p.clean_globs |= %w[**/.DS_Store tmp *.log]
19
- path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
20
- p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
21
- p.rsync_args = '-av --delete --ignore-errors'
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gem|
8
+ gem.name = "reptile"
9
+ gem.summary = %Q{Cold blooded mysql replication monitoring.}
10
+ gem.description = %Q{Cold blooded mysql replication monitoring.}
11
+ gem.email = "nick.stielau@gmail.com"
12
+ gem.homepage = "http://reptile.rubyforge.org/"
13
+ gem.authors = ["Nick Stielau"]
14
+ gem.add_runtime_dependency 'tlsmail', '>= 0'
15
+ gem.add_runtime_dependency 'activerecord', '>= 0'
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
22
21
  end
23
22
 
24
23
  desc "Upload current documentation to Rubyforge"
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.5
data/lib/reptile.rb CHANGED
@@ -7,17 +7,10 @@ require 'rubygems'
7
7
  require 'tlsmail'
8
8
  require 'net/smtp'
9
9
 
10
-
11
10
  require 'reptile/heartbeat'
12
11
  require 'reptile/delta_monitor'
13
12
  require 'reptile/replication_monitor'
14
13
  require 'reptile/status'
15
14
  require 'reptile/runner'
16
15
  require 'reptile/users'
17
- require 'reptile/databases'
18
-
19
- require 'active_record'
20
-
21
- module Reptile
22
- VERSION = '0.0.4'
23
- end
16
+ require 'reptile/databases'
@@ -37,7 +37,11 @@ module Reptile
37
37
  master_counts = get_table_counts
38
38
 
39
39
  deltas= {}
40
- master_counts.each do |table, master_count|
40
+ master_counts.each do |table, master_count|
41
+ if slave_counts[table].nil?
42
+ puts "Table '#{table}' exists on master but not on slave."
43
+ next
44
+ end
41
45
  delta = master_count.first.to_i - slave_counts[table].first.to_i
42
46
  deltas[table] = delta
43
47
  end
@@ -75,7 +75,7 @@ module Reptile
75
75
  end
76
76
 
77
77
  private
78
-
78
+
79
79
  # Format the delay (in seconds) as a human-readable string.
80
80
  def self.strfdelay(delay)
81
81
  seconds = delay % 60
@@ -0,0 +1,39 @@
1
+ config:
2
+ heartbeart_threshold: 10
3
+ delay_threshold_secs: 360
4
+ row_difference_threshold: 10
5
+
6
+ # You can also set username/passwords here,
7
+ # so you don't have to repeat them.
8
+ #
9
+ # users:
10
+ # ro_user:
11
+ # username: ro_user
12
+ # password: secret
13
+ # heartbeat_user:
14
+ # username: heartbeat_user
15
+ # password: secret
16
+ # replication_user:
17
+ # username: repl_user
18
+ # password: secret
19
+
20
+
21
+ database_01:
22
+ master:
23
+ password: test_pass
24
+ username: read_only_user
25
+ adapter: mysql
26
+ database: db01
27
+ host: db1.somehost.com
28
+ port: 3306
29
+ socket: /tmp/mysql.sock
30
+
31
+ slave:
32
+ password: test_pass
33
+ username: read_only_user
34
+ adapter: mysql
35
+ database: db01
36
+ host: localhost
37
+ port: 3307
38
+ socket: /var/lib/mysql/db01.sock
39
+
@@ -0,0 +1,12 @@
1
+ index.page:
2
+ inMenu: true
3
+ orderInfo: 2
4
+
5
+ images:
6
+ indexFile: ~
7
+ ---
8
+ docs.html:
9
+ title: RDoc
10
+ url: http://reptile.rubyforge.org/doc/
11
+ inMenu: true
12
+ orderInfo: 100
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: About
3
+ inMenu: true
4
+ orderInfo: 10
5
+ ---
6
+ h2. About Reptile
7
+
8
+ Reptile is an easy to use utility that will monitor your MySQL replication, so you can forget about it and focus on the good stuff.
9
+
10
+ h2. About the Author
11
+
12
+ The author is just trying to get by. Hit me up at nick.stielau_at_gmail.com if you have any questions, ideas or you actually want to use this thing.
File without changes
@@ -0,0 +1,290 @@
1
+ /* andreas00 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use for any purpose as long as the proper credits are given to the original author.
2
+ Version: 1.1 (Apr 20, 2006) */
3
+
4
+ /***** Body and main container *****/
5
+
6
+ body {
7
+ margin:0 auto;padding:0;font:76% Verdana,Tahoma,Arial,sans-serif;background:#eaeaea url(images/bg.gif) top center repeat-y;color:#3a3a3a;
8
+ }
9
+
10
+ #wrap {
11
+ background-color:#ffffff;color:#303030;margin:0 auto;padding:1px 5px;width:760px;
12
+ }
13
+
14
+ /***** Header *****/
15
+
16
+ #header {
17
+ color:#505050;background:#000000 url(images/front.jpg) bottom right no-repeat;height:250px;margin:0 0 10px 0;padding:0;
18
+ }
19
+
20
+ #header h1 {
21
+ font-size:2.5em;font-weight:normal;letter-spacing:-2px;margin:0 0 4px 15px;padding:15px 0 0 0;
22
+ }
23
+
24
+ #header h1 a,#header h1 a:hover {
25
+ padding:0;
26
+ }
27
+
28
+ #header p {
29
+ font-size:1.1em;letter-spacing:-1px;margin:0 0 20px 15px;padding:0 0 0 3px;
30
+ }
31
+
32
+ /***** Left sidebar *****/
33
+
34
+ #avmenu {
35
+ clear:left;float:left;width:150px;margin:0 0 10px 0;padding:0;
36
+ }
37
+
38
+ #avmenu ul {
39
+ list-style:none;width:150px;margin:0 0 20px 0;padding:0;
40
+ }
41
+
42
+ #avmenu li {
43
+ margin-bottom:5px;
44
+ }
45
+
46
+ #avmenu li a, #avmenu li span {
47
+ font-weight:bold;height:20px;text-decoration:none;color:#505050;display:block;padding:6px 0 0 10px;background:#f4f4f4 url(images/menubg.gif) bottom left repeat-x;border-top:1px solid #d8d8d8;border-right:1px solid #d8d8d8;border-bottom:1px solid #d8d8d8;border-left:4px solid #cccccc;
48
+ }
49
+
50
+ #avmenu li a:hover, #avmenu li a.current, #avmenu li.webgen-menu-item-selected a, #avmenu li.webgen-menu-item-selected span {
51
+ background:#eaeaea url(images/menubg2.gif) bottom left repeat-x;color:#505050;border-top:1px solid #b0b0b0;border-right:1px solid #b0b0b0;border-bottom:1px solid #b0b0b0;border-left:4px solid #505050;
52
+ }
53
+
54
+ #avmenu ul ul {
55
+ margin:5px 0 5px 15px;font-size:0.9em;width:135px;
56
+ }
57
+
58
+ #avmenu ul ul a {
59
+ height:16px;margin:0;padding:4px 0 0 8px;
60
+ }
61
+
62
+ #avmenu h2 {
63
+ font-size:1.5em;font-weight:normal;
64
+ }
65
+
66
+ /***** Right sidebar *****/
67
+
68
+ #extras {
69
+ float:right;width:130px;margin:0 0 10px 0;padding:0;font-size:0.9em;
70
+ }
71
+
72
+ #extras p, #extras ul {
73
+ margin:0 0 1.5em 0;line-height:1.3em;padding:0;
74
+ }
75
+
76
+ #extras a {
77
+ font-weight:bold;
78
+ }
79
+
80
+ #extras li {
81
+ list-style:none;margin:0 0 6px 0;padding:0;
82
+ }
83
+
84
+ #extras h2 {
85
+ font-size:1.6em;font-weight:normal;margin:0 0 6px 0;;letter-spacing:-1px;
86
+ }
87
+
88
+ /***** Main content *****/
89
+
90
+ #content {
91
+ margin:10px 140px 10px 160px;padding:0;line-height:1.5em;text-align:left;
92
+ }
93
+
94
+ #contentwide {
95
+ margin:10px 0 10px 160px;padding:0;line-height:1.5em;text-align:left;
96
+ }
97
+
98
+ #contentfull {
99
+ margin:10px 10px 10px 10px;padding:2px 0 0 0;line-height:1.5em;text-align:left;
100
+ }
101
+
102
+ #content h2, #contentwide h2, #contentfull h2 {
103
+ font-size:1.8em;letter-spacing:-1px;font-weight:normal;margin:8px 0 10px 0;padding:0;
104
+ }
105
+
106
+ #content h3, #contentwide h3, #contentfull h3 {
107
+ font-size:1.5em;font-weight:normal;margin:6px 0 6px 0;padding:0;
108
+ }
109
+
110
+ #content img, #contentwide img, #contentfull img {
111
+ padding:1px;display:inline;background:#cccccc;color:#303030;border:4px solid #f0f0f0;
112
+ }
113
+
114
+ #content a, #contentwide a, #contentfull a {
115
+ font-weight:bold;
116
+ }
117
+
118
+ #content ul, #content ol,
119
+ #contentwide ul, #contentwide ol,
120
+ #contentfull ul, #contentfull ol {
121
+ margin:0 0 16px 20px;
122
+ padding:0;
123
+ }
124
+
125
+ #content ul ul, #content ol ol,
126
+ #contentwide ul ul, #contentwide ol ol,
127
+ #contentfull ul ul, #contentfull ol ol {
128
+ margin:2px 0 2px 20px;
129
+ }
130
+
131
+ #content li, #contentwide li, #contentfull li {
132
+ margin:0 0 2px 10px;
133
+ padding:0 0 0 4px;
134
+ }
135
+
136
+ /***** Footer *****/
137
+
138
+ #footer {
139
+ clear:both;margin:0 auto;padding:8px 0;border-top:2px solid #dadada;width:760px;text-align:center;color:#808080;background-color:#ffffff;font-size:0.9em;
140
+ }
141
+
142
+ #footer p {
143
+ padding:0;margin:0;
144
+ }
145
+
146
+ #footer a {
147
+ color:#808080;background-color:inherit;text-decoration:none;
148
+ }
149
+
150
+ #footer a:hover {
151
+ text-decoration:underline;
152
+ }
153
+
154
+ /***** Various tags *****/
155
+
156
+ a {
157
+ text-decoration:none;color:#505050;background-color:inherit;
158
+ }
159
+
160
+ a:hover {
161
+ text-decoration:underline;color:#286ea0;background-color:inherit;
162
+ }
163
+
164
+ a img {
165
+ border:0;
166
+ }
167
+
168
+ p {
169
+ margin:0 0 16px 0;
170
+ }
171
+
172
+ blockquote {
173
+ border-top:1px solid #d8d8d8;border-right:1px solid #d8d8d8;border-bottom:1px solid #d8d8d8;border-left:4px solid #cccccc;margin:16px;padding:7px 7px 7px 11px;background:#f4f4f4 url(images/menubg.gif) bottom left repeat-x;color:#505050;
174
+ }
175
+
176
+ blockquote p {
177
+ font-size:1.1em;line-height:1.3em;margin:0;
178
+ }
179
+
180
+ /***** Table styles *****/
181
+
182
+ table {
183
+ margin:0 0 16px 0;padding:0;line-height:1.3em;border-collapse:collapse;border:1px solid #d8d8d8;
184
+ }
185
+
186
+ caption {
187
+ text-align:left;font-size:1.5em;font-weight:normal;margin:0;padding:6px 0 8px 0;
188
+ }
189
+
190
+ th {
191
+ padding:7px;text-align:left;background:#eaeaea url(images/menubg2.gif) bottom left repeat-x;color:#505050;
192
+ }
193
+
194
+ td {
195
+ padding:7px;font-size:0.9em;text-align:left;background:#f4f4f4 url(images/menubg.gif) bottom left repeat-x;color:#303030;
196
+ }
197
+
198
+ /***** Form styles *****/
199
+
200
+ .button {
201
+ border-top:1px solid #d8d8d8;border-right:1px solid #d8d8d8;border-bottom:1px solid #d8d8d8;border-left:4px solid #cccccc;margin:0 0 15px 0;padding:7px 7px 7px 11px;background:#f4f4f4 url(images/menubg.gif) bottom left repeat-x;color:#505050;font-weight:bold;width:120px;
202
+ }
203
+
204
+ input, textarea {
205
+ border:1px solid #cccccc;font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:1em;margin:0;padding:4px;
206
+ }
207
+
208
+ label {
209
+ margin:2px;
210
+ }
211
+
212
+ input {
213
+ width:200px;
214
+ }
215
+
216
+ textarea {
217
+ width:400px;
218
+ }
219
+
220
+ /***** Search box *****/
221
+
222
+ #searchbox {
223
+ padding:0;margin:6px 0 16px 0;
224
+ }
225
+
226
+ #searchform {
227
+ background:#ffffff;border:1px solid #cccccc;color:#505050;font-size:0.9em;padding:4px;width:116px;
228
+ }
229
+
230
+ #searchbox label {
231
+ display:none;
232
+ }
233
+
234
+ /***** Various classes *****/
235
+
236
+ .left {
237
+ margin:10px 10px 5px 0;float:left;
238
+ }
239
+
240
+ .right {
241
+ margin:10px 0 5px 10px;float:right;
242
+ }
243
+
244
+ .announce {
245
+ margin:10px 0 10px 0;padding:10px 10px 5px 10px;width:105px;color:#505050;background:#f4f4f4 url(images/menubg.gif) bottom left repeat-x;border-top:1px solid #d8d8d8;border-right:1px solid #d8d8d8;border-bottom:1px solid #d8d8d8;border-left:4px solid #cccccc;line-height:1.3em;
246
+ }
247
+
248
+ .announce a {
249
+ font-weight:bold;
250
+ }
251
+
252
+ .announce p {
253
+ font-size:0.9em;
254
+ }
255
+
256
+ .announce h2 {
257
+ margin:0 0 10px 0;padding:0;
258
+ }
259
+
260
+ #avmenu .announce {
261
+ width:125px;
262
+ }
263
+
264
+ .textright {
265
+ text-align:right;margin:-10px 0 4px 0;
266
+ }
267
+
268
+ .center {
269
+ text-align:center;
270
+ }
271
+
272
+ .small {
273
+ font-size:0.8em;
274
+ }
275
+
276
+ .large {
277
+ font-size:1.3em;
278
+ }
279
+
280
+ .bold {
281
+ font-weight:bold;
282
+ }
283
+
284
+ .highlighted {
285
+ padding:3px;background-color:#f0f0f0;color:#303030;border:1px solid #b0b0b0;
286
+ }
287
+
288
+ .hide {
289
+ display:none;
290
+ }
@@ -0,0 +1,73 @@
1
+ --- content, html
2
+ <?xml version="1.0" encoding="UTF-8"?>
3
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="{lang:}">
5
+ <head>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <meta name="description" content="Reptile is a ruby library for monitoring mysql replicaiton." />
8
+ <meta name="keywords" content="ruby, mysql, replication, monitoring" />
9
+ <meta name="author" content="Nick Stielau / Original design: Andreas Viklund - http://andreasviklund.com/" />
10
+ <meta name="generator" content="webgen - http://webgen.rubyforge.org" />
11
+ <link rel="stylesheet" type="text/css" href="{relocatable: default.css}" media="screen,projection" />
12
+ <link rel="stylesheet" type="text/css" href="{resource: webgen-css}" />
13
+ <title>{title:} Reptile: MySQL Replication Monitor</title>
14
+ </head>
15
+
16
+ <body>
17
+ <div id="wrap">
18
+ <div id="header">
19
+ <h1><a href="{relocatable: /index.page}">Reptile</a></h1>
20
+ <p><strong>Cold blooded replication monitoring</strong></p>
21
+ </div>
22
+
23
+ <div id="avmenu">
24
+ <h2 class="hide">Site menu:</h2>
25
+ {menu: vertical}
26
+
27
+ <div class="announce">
28
+ <h2>Latest news:</h2>
29
+ <p><strong>08.10.2009:</strong><br />
30
+ Reptile moved to github</p>
31
+ <p class="textright"><a href="/news/reptile_moved_to_github.html">Read more &raquo;</a></p>
32
+ <p><strong>06.25.2009:</strong><br />
33
+ Reptile's released as a gem!</p>
34
+ <p class="textright"><a href="/news/reptiles_released_as_a_gem.html">Read more &raquo;</a></p>
35
+ <p><strong>02.09.2009:</strong><br />
36
+
37
+ Reptile's up on rubyforge!</p>
38
+ <p class="textright"><a href="/news/reptiles_on_rubyforge.html">Read more &raquo;</a></p>
39
+ </div>
40
+
41
+ </div>
42
+
43
+ <div id="extras">
44
+ <h2>Information:</h2>
45
+ <p>Its good for you.</p>
46
+ <h2>Links:</h2>
47
+ <ul>
48
+ <li><a href="http://dev.mysql.com/doc/refman/5.0/en/replication.html">MySQL 5.0 Replication</a></li>
49
+ <li><a href="http://www.oreilly.com/catalog/hpmysql/">Oreilly: "High Performance MySQL"</a></li>
50
+ <li><a href="http://jeremy.zawodny.com/mysql/managing-mysql-replication.html">Managing MySQL Replication</a></li>
51
+ </ul>
52
+
53
+ </div>
54
+
55
+ <div id="content">
56
+ {block:}
57
+ </div>
58
+
59
+ <div id="footer">
60
+ <p>Copyright &copy; 2009 Nick Stielau | Generated by <a href="http://webgen.rubyforge.org">webgen</a> | Design by <a href="http://andreasviklund.com">Andreas Viklund</a></p>
61
+ </div>
62
+ </div>
63
+ <script type="text/javascript">
64
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
65
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
66
+ </script>
67
+ <script type="text/javascript">
68
+ var pageTracker = _gat._getTracker("UA-3403241-4");
69
+ pageTracker._initData();
70
+ pageTracker._trackPageview();
71
+ </script>
72
+ </body>
73
+ </html>
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Download
3
+ inMenu: true
4
+ orderInfo: 30
5
+ ---
6
+ h2. Download
7
+
8
+ Get the latest at <a href="http://github.com/nstielau/reptile/tree/master">http://github.com/nstielau/reptile/tree/master</a>
9
+
@@ -0,0 +1,67 @@
1
+ ---
2
+ title: Features
3
+ inMenu: true
4
+ orderInfo: 20
5
+ ---
6
+ h2. Features
7
+
8
+ h3. Redundant replication checks:
9
+
10
+ <ul>
11
+ <li>checking MySQL 'SHOW SLAVE STATUS'</li>
12
+ <li>diffing table row counts</li>
13
+ <li>comparing '<a href="terms/heartbeat.html">heartbeat</a>' timestamps</li>
14
+ </ul>
15
+
16
+ h3. Easy Email Alerts
17
+
18
+ <ul>
19
+ <li>Send reports and alerts via email or SMS</li>
20
+ <li>Change alert thresholds, i.e. row count difference before an email alert, real-time latency before alert</li>
21
+ </ul>
22
+
23
+ h3. Easy to run.
24
+
25
+ <pre>
26
+ [nick@s34 ~]$ replication_status -h
27
+ Usage: replication_status [path_to_config_file]
28
+ -h, --help Displays this help info
29
+ -s, --status Displays the slave status
30
+ -d, --diff Checks the row count difference between master and slave
31
+ -r, --report Sends a report email
32
+ -b, --heartbeat Checks the heartbeat timestamp difference between master and slave
33
+ [nick@s34 ~]$ replication_status -s
34
+ * a_database slave is up and running
35
+ * b_database slave is up and running
36
+ * c_database slave is up and running
37
+ </pre>
38
+
39
+ h3. Easy to configure with a YML file
40
+
41
+ <pre>
42
+
43
+ config:
44
+ heartbeart_threshold: 10
45
+ delay_threshold_secs: 360
46
+ row_difference_threshold: 10
47
+
48
+ database_01:
49
+ master:
50
+ password: test_pass
51
+ username: read_only_user
52
+ adapter: mysql
53
+ database: db01
54
+ host: db1.somehost.com
55
+ port: 3306
56
+ socket: /tmp/mysql.sock
57
+
58
+ slave:
59
+ password: test_pass
60
+ username: read_only_user
61
+ adapter: mysql
62
+ database: db01
63
+ host: localhost
64
+ port: 3307
65
+ socket: /var/lib/mysql/db01.sock
66
+
67
+ </pre>
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Homepage
3
+ inMenu: true
4
+ orderInfo: 0
5
+ directoryName: Reptile
6
+ ---
7
+ h2. Reptile
8
+
9
+ Welcome to Reptile!
10
+
11
+ Reptile is an easy to use utility that will monitor your MySQL replication, so you can forget about it and focus on the good stuff. For a little more info, check out the <a href="features.html">features</a> or check out the <a href="http://reptile.rubyforge.org/doc/">RDoc</a>.
12
+
13
+ Reptile will hopefully work for you, but I would bet (*sigh*) that it is really just a starting place. Take a look at the code, and hopefully you can find something that will work for you.
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Reptile moved to github
3
+ inMenu: false
4
+ ---
5
+ h2. Moved to github.
6
+
7
+ Github makes it easy to share and distribute code, and that is the name of the game. Thus, Reptile's making the move. See you there.
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Reptile is on Rubyforge!
3
+ inMenu: false
4
+ ---
5
+ h2. We're on RubyForge!
6
+
7
+ Rubyforge rocks!
8
+
9
+ My first open source project, and I'm trying to do it right. Hang tight while I solidify the Reptile codebase. Any suggestions, requests, or even a code review would be appreciated.
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Reptile released as a gem!
3
+ inMenu: false
4
+ ---
5
+ h2. No shortage of exclamation points, we're gemified!
6
+
7
+ Well, an eternity and two interested parties later, we've (I have) got a gem on ruby forge. I dance hither and thither, playing with the newgem gem, the rubyforge gem, ruby 1.9. Yak shaving. Almost wished I was using CPAN. But its out there.
8
+
9
+ Open source ain't easy, but the best advice I've heard is "just get it out there," so that is what I am going for.
@@ -0,0 +1,23 @@
1
+ ---
2
+ title: Setup
3
+ inMenu: true
4
+ orderInfo: 40
5
+ ---
6
+
7
+ h2. Setup
8
+
9
+ h3. Replication
10
+
11
+ Clearly, before you setup monitoring for your replication, it would be nice to actually have a master/slave replication already in place to monitor. But who am I to tell you how to do things. Replication in MySQL is actually easy to set up, but a little fragile, which is why a monitor comes in handy. Here are some links to help you get started with replication.
12
+
13
+ <ul>
14
+ <li><a href="http://dev.mysql.com/doc/refman/5.0/en/replication.html">MySQL 5.0 Replication</a></li>
15
+ <li><a href="http://www.oreilly.com/catalog/hpmysql/">Oreilly: "High Performance MySQL"</a></li>
16
+ <li><a href="http://jeremy.zawodny.com/mysql/managing-mysql-replication.html">Managing MySQL Replication</a></li>
17
+ </ul>
18
+
19
+ h3. Setting up Monitoring
20
+
21
+ MySQL allows for fairly fine-grained permissions, and while you could always run everything as your root MySQL user, Reptile will at least facilitate using a better security policy. This means using users with specific permissions for specific tasks. In addition to setting up some new users, Reptile requires a new database/table in order to read and write "<a href="terms/heartbeat.html">Heartbeats</a>," which is the best look at the "real time" latency of your system. We'll also try to help with that.
22
+
23
+ But give me some time!
@@ -0,0 +1,19 @@
1
+ ---
2
+ title: Heartbeat
3
+ inMenu: false
4
+ ---
5
+
6
+ h2. What is a Heartbeat?
7
+
8
+ A heartbeat is a way to monitor the "pulse" of your replication, and give you a reliable look at the "real time" latency of your replication. Heartbeats work as follows
9
+
10
+ <ul>
11
+ <li>Write a heartbeat timestamp to the master</li>
12
+ <li>Read the most recent heartbeat timestamp that was replicated to the slave</li>
13
+ <li>Compare the replicated timestamp to the current time.</li>
14
+ <li>Ooola: The time it took to replicate a row from the master to the slave. The latency of the replication.</li>
15
+ </ul>
16
+
17
+ There is also a little timing overhead. It might take you a couple seconds to disconnect from the master, connect to the slave, and read the heartbeat, but that should be minimal.
18
+
19
+ Also, just because your heartbeats are replicating does not necessarily mean all your data is up to date, but it does mean replication is working. A lot of changes to the master, especially with lots of data (binary blobs or whatever) will take some time to transfer to the slave machine and then run.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reptile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Stielau
@@ -9,47 +9,45 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-13 00:00:00 -07:00
12
+ date: 2010-01-05 00:00:00 -08:00
13
13
  default_executable: replication_status
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: newgem
17
- type: :development
16
+ name: tlsmail
17
+ type: :runtime
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.4.1
23
+ version: "0"
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
- name: hoe
27
- type: :development
26
+ name: activerecord
27
+ type: :runtime
28
28
  version_requirement:
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.8.0
33
+ version: "0"
34
34
  version:
35
- description: ""
36
- email:
37
- - nick.stielau@gmail.com
35
+ description: Cold blooded mysql replication monitoring.
36
+ email: nick.stielau@gmail.com
38
37
  executables:
39
38
  - replication_status
40
39
  extensions: []
41
40
 
42
41
  extra_rdoc_files:
43
- - History.txt
44
- - Manifest.txt
45
- - PostInstall.txt
46
42
  - README.rdoc
47
43
  files:
44
+ - .gitignore
48
45
  - History.txt
49
46
  - Manifest.txt
50
47
  - PostInstall.txt
51
48
  - README.rdoc
52
49
  - Rakefile
50
+ - VERSION
53
51
  - bin/replication_status
54
52
  - lib/reptile.rb
55
53
  - lib/reptile/databases.rb
@@ -60,19 +58,37 @@ files:
60
58
  - lib/reptile/runner.rb
61
59
  - lib/reptile/status.rb
62
60
  - lib/reptile/users.rb
61
+ - replication.yml.sample
63
62
  - script/console
64
63
  - script/destroy
65
64
  - script/generate
66
65
  - test/test_helper.rb
67
66
  - test/test_reptile.rb
67
+ - webgen_site/metainfo.yaml
68
+ - webgen_site/src/about.page
69
+ - webgen_site/src/config.yaml
70
+ - webgen_site/src/default.css
71
+ - webgen_site/src/default.template
72
+ - webgen_site/src/download.page
73
+ - webgen_site/src/features.page
74
+ - webgen_site/src/images/bg.gif
75
+ - webgen_site/src/images/frog.jpg
76
+ - webgen_site/src/images/front.jpg
77
+ - webgen_site/src/images/menubg.gif
78
+ - webgen_site/src/images/menubg2.gif
79
+ - webgen_site/src/index.page
80
+ - webgen_site/src/news/reptile_moved_to_github.template
81
+ - webgen_site/src/news/reptiles_on_rubyforge.page
82
+ - webgen_site/src/news/reptiles_released_as_a_gem.page
83
+ - webgen_site/src/setup.page
84
+ - webgen_site/src/terms/heartbeat.page
68
85
  has_rdoc: true
69
86
  homepage: http://reptile.rubyforge.org/
70
87
  licenses: []
71
88
 
72
- post_install_message: PostInstall.txt
89
+ post_install_message:
73
90
  rdoc_options:
74
- - --main
75
- - README.rdoc
91
+ - --charset=UTF-8
76
92
  require_paths:
77
93
  - lib
78
94
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -89,11 +105,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
105
  version:
90
106
  requirements: []
91
107
 
92
- rubyforge_project: reptile
108
+ rubyforge_project:
93
109
  rubygems_version: 1.3.5
94
110
  signing_key:
95
- specification_version: 2
96
- summary: Cold-blooded MySQL replication monitoring.
111
+ specification_version: 3
112
+ summary: Cold blooded mysql replication monitoring.
97
113
  test_files:
98
114
  - test/test_helper.rb
99
115
  - test/test_reptile.rb