|
1 | 1 | # puppet-orchestrator-for-mysql
|
2 |
| -Puppet Module used with Orchestrator |
| 2 | + |
| 3 | +This module is to install the MySQL tool called Orchestrator via puppet. Orchestrator is used for managing replication topologies. See https://github.com/github/orchestrator for instructions on appopriate configuration and setup. |
| 4 | + |
| 5 | +# Usage |
| 6 | + |
| 7 | +``` |
| 8 | + $config_override = { |
| 9 | + 'Debug' => true, |
| 10 | + 'ReadOnly' => false, |
| 11 | + 'MySQLOrchestratorHost' => 'orchestrator.example.com', |
| 12 | + 'MySQLOrchestratorPort' => 3306, |
| 13 | + 'MySQLOrchestratorDatabase' => 'orchestrator', |
| 14 | + 'RemoveTextFromHostnameDisplay' => '.example.com:3306', |
| 15 | + 'SlaveLagQuery' => 'select lag from test.heartbeat_table', |
| 16 | + 'DiscoverByShowSlaveHosts' => false, |
| 17 | + 'DetectClusterAliasQuery' => 'select cluster_alias from test.cluster_info_table where 1=1', |
| 18 | + 'DetectClusterDomainQuery' => 'select cluster_domain from test.cluster_info_table where 1=1', |
| 19 | + 'DataCenterPattern' => '.*-(.*)-.*[.].*[.]example[.]com', |
| 20 | + 'PhysicalEnvironmentPattern' => '.*-.*-(.*)[.].*[.]example[.]com', |
| 21 | + 'PseudoGTIDPattern' => '`heartbeat` (ts, server_id, file, position, relay_master_log_file, exec_master_log_pos) VALUES', |
| 22 | + 'PseudoGTIDPatternIsFixedSubstring' => true, |
| 23 | + 'PseudoGTIDMonotonicHint' => 'heartbeat', |
| 24 | + 'DetectPseudoGTIDQuery' => 'select count(*)>0 as pseudo_gtid_exists from test.heartbeat_table where ts > NOW() - INTERVAL 2 DAY;', |
| 25 | + 'ProblemIgnoreHostnameFilters' => [ |
| 26 | + 'test-server-mysql', |
| 27 | + ], |
| 28 | + 'PromotionIgnoreHostnameFilters' => [ |
| 29 | + 'test-server-mysql', |
| 30 | + ], |
| 31 | + 'AuditLogFile' => '', |
| 32 | + 'AuthenticationMethod' => 'token', |
| 33 | + 'FailureDetectionPeriodBlockMinutes' => 60, |
| 34 | + 'RecoveryPollSeconds' => 5, |
| 35 | + 'RecoveryPeriodBlockSeconds' => 600, |
| 36 | + 'RecoveryIgnoreHostnameFilters' => [], |
| 37 | + 'RecoverMasterClusterFilters' => [ |
| 38 | + 'mysqla', |
| 39 | + 'mysqlb', |
| 40 | + ], |
| 41 | + 'RecoverIntermediateMasterClusterFilters' => [ |
| 42 | + 'mysqlb', |
| 43 | + 'mysqlc', |
| 44 | + ], |
| 45 | + 'OnFailureDetectionProcesses' => [ |
| 46 | + "sudo -i recovery-handler -t 'detection' -f '{failureType}' -h '{failedHost}' -C '{failureCluster}' -n '{countSlaves}'" |
| 47 | + ], |
| 48 | + 'PreFailoverProcesses' => [ |
| 49 | + "sudo -i recovery-handler -t 'pre-failover' -f '{failureType}' -h '{failedHost}' -C '{failureCluster}' -n '{countSlaves}'" |
| 50 | + ], |
| 51 | + 'PostFailoverProcesses' => [ |
| 52 | + "sudo -i recovery-handler -t 'post-failover' -f '{failureType}' -h '{failedHost}' -H '{successorHost}' -C '{failureCluster}' -n '{countSlaves}'" |
| 53 | + ], |
| 54 | + 'PostUnsuccessfulFailoverProcesses' => [], |
| 55 | + 'PostMasterFailoverProcesses' => [ |
| 56 | + "sudo setuidgid orc_user ssh {failedHost} 'sudo -i do_something_on_failed_host > /dev/null 2> /dev/null'", |
| 57 | + "sudo setuidgid orc_user ssh {successorHost} 'sudo -i do_something_on_new_host > /dev/null 2> /dev/null'", |
| 58 | + ], |
| 59 | + 'PostIntermediateMasterFailoverProcesses' => [ |
| 60 | + ], |
| 61 | + 'CoMasterRecoveryMustPromoteOtherCoMaster' => true, |
| 62 | + 'DetachLostSlavesAfterMasterFailover' => true, |
| 63 | + 'ApplyMySQLPromotionAfterMasterFailover' => false, |
| 64 | + 'MasterFailoverLostInstancesDowntimeMinutes' => 60, |
| 65 | + 'PostponeSlaveRecoveryOnLagMinutes' => 10, |
| 66 | + 'GraphitePollSeconds' => 60, |
| 67 | + 'GraphiteAddr' => 'graphite.example.com:2113', |
| 68 | + 'GraphitePath' => 'hosts.{hostname}.orchestrator', |
| 69 | + 'GraphiteConvertHostnameDotsToUnderscores' => true, |
| 70 | + } |
| 71 | +
|
| 72 | + class { '::orchestrator': |
| 73 | + config_override => $config_override, |
| 74 | + package_ensure => 'latest', |
| 75 | + package_manage => true, |
| 76 | + } |
| 77 | +``` |
| 78 | +# Assumptions |
| 79 | + |
| 80 | +* Puppetlab's stdlib is used by this module. |
| 81 | + |
| 82 | +* The orchestrator deb/rpm package is available to puppet if `orchestrator::params::package_manage` is `true`. |
0 commit comments