Class: TTCluster::ConfigCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- TTCluster::ConfigCommand
- Defined in:
- lib/ttcluster/config_command.rb
Overview
‘config’ command implementation.
Instance Method Summary collapse
-
#initialize(runner, port) ⇒ ConfigCommand
constructor
Save runner and port for ‘config’ run.
-
#run ⇒ Object
Report ttcluster server config.
Constructor Details
#initialize(runner, port) ⇒ ConfigCommand
Save runner and port for ‘config’ run.
17 18 19 20 |
# File 'lib/ttcluster/config_command.rb', line 17 def initialize(runner, port) super(runner) @port = port end |
Instance Method Details
#run ⇒ Object
Report ttcluster server config.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ttcluster/config_command.rb', line 24 def run chdir_to_ttbase statuses = get_statuses(@port) puts "TTCluster config:" puts " ttbase dir => '#{ttbase}'" statuses.each do |port, status| config = load_config(port) msg = if config <<EOS server: #{config[SERVER_KEY][HOST_KEY]}:#{config[SERVER_KEY][PORT_KEY]} (sid=#{config[SERVER_KEY][SID_KEY]}) master: #{config[MASTER_KEY][HOST_KEY]}:#{config[MASTER_KEY][PORT_KEY]} (sid=#{config[MASTER_KEY][SID_KEY]}) EOS else MSG_NO_CONFIG_FILE_FOUND end puts " port(#{port}) => #{msg}" end end |