@@ -565,47 +565,6 @@ module Jetpants
565
565
end
566
566
end
567
567
568
- desc 'pause_pool_replication' , 'pause replication on all slaves in a given pool'
569
- method_option :pool
570
- def pause_pool_replication
571
- pool = Jetpants . topology . pool ( options [ :pool ] || ask ( 'Please enter the pool name: ' ) ) . downcase
572
- error "Unable to find pool" unless pool
573
-
574
- master = pool . master
575
- error "Unable to find master for pool" unless master
576
-
577
- slaves = master . slaves
578
- error "Master does not have any replicating slaves to pause" unless slaves and not slaves . empty?
579
-
580
- inform "Pausing replication on #{ slaves . size } slaves"
581
- slaves . concurrent_each do |slave |
582
- slave . disable_monitoring rescue inform "Warning! Unable to disable monitoring for slave: #{ slave } "
583
- slave . pause_replication rescue inform "Warning! Unable to pause replication for slave: #{ slave } "
584
- end
585
- end
586
-
587
- desc 'resume_pool_replication' , 'resume replication on all slaves according to collins for a given pool'
588
- method_option :pool
589
- def resume_pool_replication
590
- pool = Jetpants . topology . pool ( options [ :pool ] || ask ( 'Please enter the pool name: ' ) ) . downcase
591
- error "Unable to find pool" unless pool
592
-
593
- master = pool . master
594
- error "Unable to find master for pool" unless master
595
-
596
- slaves = pool . slaves_according_to_collins
597
- error "Unable to find any slaves (via collins) for pool" unless slaves and not slaves . empty?
598
-
599
- inform "Resuming replication on #{ slaves . size } slaves"
600
- slaves . concurrent_each ( &:resume_replication )
601
-
602
- inform "Preparing to enable monitoring after slaves catch up to master"
603
- slaves . concurrent_each do |slave |
604
- slave . catch_up_to_master
605
- slave . enable_monitoring
606
- end
607
- end
608
-
609
568
no_tasks do
610
569
def is_ip? address
611
570
address =~ /(\d {1,3}\. \d {1,3}\. \d {1,3}\. \d {1,3})/
0 commit comments