Class: Bungee::Backup
- Inherits:
-
Object
- Object
- Bungee::Backup
- Defined in:
- lib/bungee/backup.rb
Instance Attribute Summary collapse
-
#cluster ⇒ Object
readonly
Returns the value of attribute cluster.
-
#data_path ⇒ Object
readonly
Returns the value of attribute data_path.
-
#elasticsearch_url ⇒ Object
readonly
Returns the value of attribute elasticsearch_url.
-
#first_host ⇒ Object
readonly
Returns the value of attribute first_host.
-
#hosts ⇒ Object
readonly
Returns the value of attribute hosts.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Instance Method Summary collapse
- #backup! ⇒ Object
-
#initialize(options = {}) ⇒ Backup
constructor
A new instance of Backup.
Constructor Details
#initialize(options = {}) ⇒ Backup
Returns a new instance of Backup.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bungee/backup.rb', line 9 def initialize( = {}) @index = [:index] @elasticsearch_url = [:elasticsearch_url] || 'http://localhost:9200' @data_path = [:data_path] @backup_path = [:backup_path] @hosts = Rye::Set.new('default', :safe => false) boxes = [:hosts].map { |host| Rye::Box.new(host, :safe => false) } @first_host = boxes.first @hosts.add_boxes(boxes) end |
Instance Attribute Details
#cluster ⇒ Object (readonly)
Returns the value of attribute cluster.
7 8 9 |
# File 'lib/bungee/backup.rb', line 7 def cluster @cluster end |
#data_path ⇒ Object (readonly)
Returns the value of attribute data_path.
7 8 9 |
# File 'lib/bungee/backup.rb', line 7 def data_path @data_path end |
#elasticsearch_url ⇒ Object (readonly)
Returns the value of attribute elasticsearch_url.
7 8 9 |
# File 'lib/bungee/backup.rb', line 7 def elasticsearch_url @elasticsearch_url end |
#first_host ⇒ Object (readonly)
Returns the value of attribute first_host.
7 8 9 |
# File 'lib/bungee/backup.rb', line 7 def first_host @first_host end |
#hosts ⇒ Object (readonly)
Returns the value of attribute hosts.
7 8 9 |
# File 'lib/bungee/backup.rb', line 7 def hosts @hosts end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
7 8 9 |
# File 'lib/bungee/backup.rb', line 7 def index @index end |
Instance Method Details
#backup! ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/bungee/backup.rb', line 21 def backup! flush_index disable_translog_flushing rsync_index_locally enable_translog_flushing merge_shards_to_backup_path end |