In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Attachment download address: https://down.51cto.com/data/2464809
1. Call the configuration script in the orchestrator configuration file PostFailoverProcesses
{"Debug": true, "EnableSyslog": false, "ListenAddress": ": 3000", "MySQLTopologyUser": "orchestrator", "MySQLTopologyPassword": "123456", "MySQLTopologyCredentialsConfigFile": "", "MySQLTopologySSLPrivateKeyFile": "," MySQLTopologySSLCertFile ":", "MySQLTopologySSLCAFile": "", "MySQLTopologySSLSkipVerify": true, "MySQLTopologyUseMutualTLS": false, "BackendDB": "sqlite", "SQLite3DataFile": "/ usr/local/orchestrator/orchestrator.sqlite3", "MySQLConnectTimeoutSeconds": 1 "DefaultInstancePort": 3306, "DiscoverByShowSlaveHosts": true, "InstancePollSeconds": 5, "DiscoveryIgnoreReplicaHostnameFilters": ["a_host_i_want_to_ignore [.] example [.] com", ". * [.] ignore_all_hosts_from_this_domain [.] example [.] com"], "UnseenInstanceForgetHours": 240," SnapshotTopologiesIntervalHours ": 0," InstanceBulkOperationsWaitTimeoutSeconds ": 10," HostnameResolveMethod ":" default "," MySQLHostnameResolveMethod ":" @ @ hostname " "SkipBinlogServerUnresolveCheck": true, "ExpiryHostnameResolvesMinutes": 60, "RejectHostnameResolvePattern": "," ReasonableReplicationLagSeconds ": 10," ProblemIgnoreHostnameFilters ": []," VerifyReplicationFilters ": false," ReasonableMaintenanceReplicationLagSeconds ": 20," CandidateInstanceExpireMinutes ": 60," AuditLogFile ":" AuditLogFile "," AuditToSyslog ": false," RemoveTextFromHostnameDisplay ":" .mydomain.com: 3306 "," ReadOnly ": false," AuthenticationMethod ":", "HTTPAuthUser": "", "HTTPAuthPassword": "" "AuthUserHeader": "," PowerAuthUsers ": [" * "]," ClusterNameToAlias ": {" 127.0.0.1 ":" test suite "}," SlaveLagQuery ":"," DetectClusterAliasQuery ":" SELECT SUBSTRING_INDEX (@ @ hostname,'.', 1) "," DetectClusterDomainQuery ":", "DetectInstanceAliasQuery": "," DetectPromotionRuleQuery ":" "DataCenterPattern": "[.] ([^.] +) [.] mydomain [.] com", "PhysicalEnvironmentPattern": "[.] ([^.] + [.] [^.] +) [.] mydomain [.] com," PromotionIgnoreHostnameFilters ": []," DetectSemiSyncEnforcedQuery ":", "ServeAgentsHttp": false, "AgentsServerPort": ": 3001", "AgentsUseSSL": false, "AgentsUseMutualTLS": false, "AgentSSLSkipVerify": false "AgentSSLPrivateKeyFile": "," AgentSSLCertFile ":", "AgentSSLCAFile": "," AgentSSLValidOUs ": []," UseSSL ": false," UseMutualTLS ": false," SSLSkipVerify ": false," SSLPrivateKeyFile ":"," SSLCertFile ":", "SSLCAFile": "," SSLValidOUs ": []," URLPrefix ":", "StatusEndpoint": "/ api/status", "StatusSimpleHealth": true, "StatusOUVerify": false "AgentPollMinutes": 60, "UnseenAgentForgetHours": 6, "StaleSeedFailMinutes": 60, "SeedAcceptableBytesDiff": 8192, "PseudoGTIDPattern": "", "PseudoGTIDPatternIsFixedSubstring": false, "PseudoGTIDMonotonicHint": "asc:", "DetectPseudoGTIDQuery": "," BinlogEventsChunkSize ": 10000," SkipBinlogEventsContaining ": []," ReduceReplicationAnalysisCount ": true," FailureDetectionPeriodBlockMinutes ": 1," RecoveryPeriodBlockSeconds ": 0," RecoveryIgnoreHostnameFilters ": []," RecoverMasterClusterFilters ": [" * "] "RecoverIntermediateMasterClusterFilters": ["*"], "OnFailureDetectionProcesses": ["echo 'Detected {failureType} on {failureCluster}. Affected replicas: {countSlaves}'> / tmp/recovery.log "]," PreFailoverProcesses ": [" echo 'Will recover from {failureType} on {failureCluster}' > > / tmp/recovery.log "]," PostFailoverProcesses ": [" echo'(for all types) Recovered from {failureType} on {failureCluster}. Failed: {failedHost}: {failedPort}; Successor: {successorHost}: {successorPort} > / tmp/recovery.log "," / usr/local/bin/orch_hook.sh {failureType} {failedHost} {successorHost} > > / tmp/orch.log "]," PostUnsuccessfulFailoverProcesses ": []," PostMasterFailoverProcesses ": [" echo 'Recovered from {failureType} on {failureCluster}. Failed: {failedHost}: {failedPort}; Promoted: {successorHost}: {successorPort}'> / tmp/recovery.log "]," PostIntermediateMasterFailoverProcesses ": [" echo 'Recovered from {failureType} on {failureCluster}. Failed: {failedHost}: {failedPort}; Successor: {successorPort}'> / tmp/recovery.log "]," CoMasterRecoveryMustPromoteOtherCoMaster ": true," DetachLostSlavesAfterMasterFailover ": true," ApplyMySQLPromotionAfterMasterFailover ": true," PreventCrossDataCenterMasterFailover ": false," PreventCro***egionMasterFailover ": false," MasterFailoverDetachSlaveMasterHost ": false," MasterFailoverLostInstancesDowntimeMinutes ": 0," PostponeSlaveRecoveryOnLagMinutes ": 0," OSCIgnoreHostnameFilters ": []," GraphiteAddr ":"," GraphitePath ":"," GraphiteConvertHostnameDotsToUnderscores ": true}
2. Orch_hook.sh pay attention to modify vip and Nic information. MYSQL_PWD does not need to configure the correct password, because I am using version 5.7 GTID replication, which is used for pseudo_gtid.
#! / bin/bashisitdead=$1cluster=$2oldmaster=$3newmaster=$4mysqluser= "orchestrator" export MYSQL_PWD= "xxxpassxxx" logfile= "/ var/log/orch_hook.log" # list of clusternamesclusternames= (rep blea lajos) # clustername= (interface IP user Inter_IP) rep= (enp0s8 "192.168.56.121" root "192.168.56.125") if [[$isitdead= = "DeadMaster"]] Then array= (enp0s8 "192.168.56.121" root "192.168.56.125") interface=$ {array [0]} IP=$ {array [1]} user=$ {array [2]} if [!-z ${IP}] Then echo $(date) echo "Revocering from: $isitdead" echo "New master is: $newmaster" echo "/ usr/local/bin/orch_vip.sh-d 1-n $newmaster-I ${interface}-I ${IP}-u ${user}-o $oldmaster" | tee $logfile / usr/local/bin/orch_vip.sh -d 1-n $newmaster-I ${interface}-I ${IP}-u ${user}-o $oldmaster mysql-h$newmaster-u$mysqluser
< /usr/local/bin/orch_event.sql else echo "Cluster does not exist!" | tee $logfile fielif [[ $isitdead == "DeadIntermediateMasterWithSingleSlaveFailingToConnect" ]]; then array=( enp0s8 "192.168.56.121" root "192.168.56.125") interface=${array[0]} IP=${array[3]} user=${array[2]} slavehost=`echo $5 | cut -d":" -f1` echo $(date) echo "Revocering from: $isitdead" echo "New intermediate master is: $slavehost" echo "/usr/local/bin/orch_vip.sh -d 1 -n $slavehost -i ${interface} -I ${IP} -u ${user} -o $oldmaster" | tee $logfile /usr/local/bin/orch_vip.sh -d 1 -n $slavehost -i ${interface} -I ${IP} -u ${user} -o $oldmasterelif [[ $isitdead == "DeadIntermediateMaster" ]]; then array=( enp0s8 "192.168.56.121" root "192.168.56.125") interface=${array[0]} IP=${array[3]} user=${array[2]} slavehost=`echo $5 | sed -E "s/:[0-9]+//g" | sed -E "s/,/ /g"` showslave=`mysql -h$newmaster -u$mysqluser -sN -e "SHOW SLAVE HOSTS;" | awk '{print $2}'` newintermediatemaster=`echo $slavehost $showslave | tr ' ' '\n' | sort | uniq -d` echo $(date) echo "Revocering from: $isitdead" echo "New intermediate master is: $newintermediatemaster" echo "/usr/local/bin/orch_vip.sh -d 1 -n $newintermediatemaster -i ${interface} -I ${IP} -u ${user} -o $oldmaster" | tee $logfile /usr/local/bin/orch_vip.sh -d 1 -n $newintermediatemaster -i ${interface} -I ${IP} -u ${user} -o $oldmasterfi 3、orch_vip.sh 脚本 #!/bin/bashemailaddress="email@example.com"sendmail=0function usage { cat /dev/null ; fi else echo "Can't add $vip on $new_master!" if [ $sendmail -eq 1 ]; then mail -s "Can't add $vip on $new_master!" "$emailaddress" < /dev/null &>/ dev/null; fi exit 1 fi else echo $rc echo "Can't remove the $vip from orig_master!" If [$sendmail-eq 1]; then mail-s "Can't remove the $vip from orig_master!"$emailaddress"
< /dev/null &>/ dev/null; fi exit 1 fielif [[$isitdead = = 1]]; then echo "Master is dead, failover" # make sure the vip is not available if vip_status; then if vip_stop; then if [$sendmail-eq 1]; then mail-s "$vip is removed from orig_master."$emailaddress"
< /dev/null &>/ dev/null; fi else if [$sendmail-eq 1]; then mail-s "Couldn't remove $vip from orig_master."$emailaddress"
< /dev/null &>/ dev/null; fi exit 1 fi fi if vip_start; then echo "$vip is moved to $new_master." If [$sendmail-eq 1]; then mail-s "$vip is moved to $new_master."$emailaddress"
< /dev/null &>/ dev/null; fi else echo "Can't add $vip on $new_master!" If [$sendmail-eq 1]; then mail-s "Can't add $vip on $new_master!"$emailaddress"
< /dev/null &>/ dev/null; fi exit 1 fielse echo "Wrong argument, the master is dead or live?" fi
4. I didn't use orch_event.sql
Create database if not exists meta;use meta Create table if not exists pseudo_gtid_status (anchor int unsigned not null, originating_mysql_host varchar 128charset ascii not null, originating_mysql_port int unsigned not null, originating_server_id int unsigned not null, time_generated timestamp not null default current_timestamp, pseudo_gtid_uri varchar (255charset ascii not null), pseudo_gtid_hint varchar (255charset ascii not null) PRIMARY KEY (anchor)) Drop event if exists create_pseudo_gtid_event;delimiter $$create event if not exists create_pseudo_gtid_event on schedule every 5 second starts current_timestamp on completion preserve enable do begin DECLARE lock_result INT; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; set @ connection_id: = connection_id (); set @ now: = now (); set @ rand: = floor (rand () * (1)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.