apprentice 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/apprentice/checks/galera.rb +9 -1
- data/lib/apprentice/server.rb +0 -14
- data/lib/apprentice/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5152f8fabc39fa41e7582c9bbf869103a9961dd9
|
4
|
+
data.tar.gz: 348c014c2b49f8f57f28566674a9ea5b3b4a8333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00f42b4557f9e01afc6196acbdad7d6ba21a5864e80f6a20e31f79ebbd19d488599168e28aa08a9f9f647f1d77d1583245a1c3c175d9360dd5bdb7f2fd8bf89e
|
7
|
+
data.tar.gz: 285fd021b9acb529fceae9d5626078040505660ba1503891bfd9a7244efc021cd55115ac9429e51bab397132818e06249c5ec78e783cf1dda7cb8038b680b533
|
data/README.md
CHANGED
@@ -48,7 +48,14 @@ By itself, Apprentice doesn't do aynthing all that useful. However, it accommoda
|
|
48
48
|
|
49
49
|
## Goodies
|
50
50
|
|
51
|
-
|
51
|
+
### Init-script
|
52
|
+
I've included an init.d script, `ruby-apprentice.init` which you may use in order to start Apprentice at boot time. The init-script needs a file named `ruby-apprentice` inside the directory `/etc/defaults/`. An example file is included with the repository, aptly named `ruby-apprentice.default`.
|
53
|
+
|
54
|
+
$ mv ruby-apprentice.init /etc/init.d/ruby-apprentice
|
55
|
+
$ chmod +x /etc/init.d/ruby-apprentice
|
56
|
+
$ mv ruby-apprentice.defaults /etc/defaults/
|
57
|
+
|
58
|
+
Now you just need to add the relevant information for starting Apprentice. The defaults file is pretty self explanatory.
|
52
59
|
|
53
60
|
## TODO
|
54
61
|
|
@@ -1,12 +1,20 @@
|
|
1
1
|
module Galera
|
2
2
|
def get_galera_status
|
3
3
|
begin
|
4
|
-
|
4
|
+
client = Mysql2::Client.new(
|
5
|
+
host: @server,
|
6
|
+
port: @sql_port,
|
7
|
+
username: @user,
|
8
|
+
password: @password,
|
9
|
+
as: :array
|
10
|
+
)
|
11
|
+
result = client.query "SHOW STATUS LIKE 'wsrep_%';"
|
5
12
|
if result.count > 0
|
6
13
|
result.each do |r|
|
7
14
|
@status.merge!(Hash[*r])
|
8
15
|
end
|
9
16
|
end
|
17
|
+
client.close
|
10
18
|
rescue Exception => message
|
11
19
|
puts message
|
12
20
|
end
|
data/lib/apprentice/server.rb
CHANGED
@@ -15,20 +15,6 @@ module Server
|
|
15
15
|
@password = options.password
|
16
16
|
@donor_allowed = options.donor_allowed
|
17
17
|
@status = {}
|
18
|
-
|
19
|
-
begin
|
20
|
-
@client = Mysql2::Client.new(
|
21
|
-
host: @server,
|
22
|
-
port: @sql_port,
|
23
|
-
username: @user,
|
24
|
-
password: @password,
|
25
|
-
as: :array,
|
26
|
-
reconnect: true
|
27
|
-
)
|
28
|
-
rescue Exception => message
|
29
|
-
puts message
|
30
|
-
EM.stop_server
|
31
|
-
end
|
32
18
|
end
|
33
19
|
|
34
20
|
def receive_data(data)
|
data/lib/apprentice/version.rb
CHANGED