elasticsearch-manager 0.1.0 → 0.1.1
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
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
N2FlYzM2ZDk2Njg4M2I5NTJkOGQ4M2ZjMGM3ZjA2MjFiMjk3MmY3ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGVjMGNiNjUxZjhjZGNmNThmYWZlZDZiOWVkMzYyY2M1MzI3YWZiOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yzk1YTMwYjBmYmRkZTVmYjU0ZmYwNjg1NzhhMTRiNDk3NjczMDdjMjVkNDNm
|
10
|
+
Mjk2NGYyOTM5YmNjOGZjMmNhNTkwNmQ0M2NlMzBhMjRjMzk0MGUxODUwZmVj
|
11
|
+
NDViNjU2N2ZjNDZlNGRlNzFmYTgzODNhYWUzNjY1MDE4MTg2MWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2Y1YTg4Mjg0NjhjN2ZhZjZiYzZiMmU2Zjk3MjhiNmNhM2VkZWIwOWE3NmUw
|
14
|
+
ODhiNDA0ZjI2NWEyZDhkNGFmZTAzODJiYTY0YzZjZWE2NzJlNjE3MGVkZjVj
|
15
|
+
Mjg0ZmRhODI5ZmU1NjU4N2NhMzFjZmVlNDk3MjNjYzA2YzYwNTA=
|
data/Gemfile.lock
CHANGED
data/bin/elasticsearch-manager
CHANGED
@@ -38,6 +38,11 @@ EOC
|
|
38
38
|
opts.on('-t TIMEOUT', '--timeout TIMEOUT', 'Timeout for waiting for cluster to stabilize during rolling-restart [default: 600]') do |p|
|
39
39
|
options[:port] = p
|
40
40
|
end
|
41
|
+
|
42
|
+
options[:verbose] = false
|
43
|
+
opts.on('-v', '--verbose', 'Print verbose messaging') do |v|
|
44
|
+
options[:verbose] = v
|
45
|
+
end
|
41
46
|
end
|
42
47
|
|
43
48
|
opt_parser.parse!
|
@@ -14,7 +14,7 @@ module Elasticsearch
|
|
14
14
|
manager = _manager(opts)
|
15
15
|
# Check that the cluster is stable?
|
16
16
|
unless manager.cluster_stable?
|
17
|
-
|
17
|
+
print_cluster_status(manager, 'The cluster is currently unstable! Not proceeding with rolling-restart')
|
18
18
|
return 2
|
19
19
|
end
|
20
20
|
puts "Discovering cluster members...\n"
|
@@ -35,6 +35,7 @@ module Elasticsearch
|
|
35
35
|
manager = _manager(opts)
|
36
36
|
status = manager.cluster_status
|
37
37
|
puts "The Elasticsearch cluster is currently: #{status.colorize(status.to_sym)}"
|
38
|
+
print_cluster_status(manager) if opts[:verbose]
|
38
39
|
return 0
|
39
40
|
end
|
40
41
|
|
@@ -43,19 +44,19 @@ module Elasticsearch
|
|
43
44
|
ESManager.new(opts[:hostname], opts[:port])
|
44
45
|
end
|
45
46
|
|
46
|
-
def self.
|
47
|
+
def self.print_cluster_status(manager, msg = nil)
|
47
48
|
health = manager.cluster_health
|
48
|
-
puts
|
49
|
+
puts msg unless msg.nil?
|
49
50
|
puts "\tCluster status: #{health.status.colorize(health.status.to_sym)}"
|
50
51
|
|
51
52
|
relocating = health.relocating_shards == 0 ? :green : :red
|
52
53
|
puts "\tRelocating shards: #{health.relocating_shards.to_s.colorize(relocating)}"
|
53
54
|
|
54
55
|
initializing = health.initializing_shards == 0 ? :green : :red
|
55
|
-
puts "\tInitializing shards: #{health.
|
56
|
+
puts "\tInitializing shards: #{health.initializing_shards.to_s.colorize(initializing)}"
|
56
57
|
|
57
58
|
unassigned = health.unassigned_shards == 0 ? :green : :red
|
58
|
-
puts "\tUnassigned shards: #{health.
|
59
|
+
puts "\tUnassigned shards: #{health.unassigned_shards.to_s.colorize(unassigned)}"
|
59
60
|
end
|
60
61
|
end
|
61
62
|
end
|
@@ -14,11 +14,11 @@ module Elasticsearch
|
|
14
14
|
def rolling_restart(timeout = 600, sleep_interval = 30)
|
15
15
|
highline = HighLine.new
|
16
16
|
@members.each do |m|
|
17
|
-
|
18
|
-
if m != @members[-1]
|
17
|
+
unless m == @leader
|
19
18
|
unless highline.agree('Continue with rolling restart of cluster? (y/n) ')
|
20
19
|
raise UserRequestedStop, "Stopping rolling restart at user request!".colorize(:red)
|
21
20
|
end
|
21
|
+
restart_node(m, timeout, sleep_interval)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
unless highline.agree("\nRestarting current cluster master, continue? (y/n) ")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Oldfield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|