mysql-mmm多主集群解决方案,适合研究学习下,非常不错。Table of Contentsverview2 Typical use-cases1222. 1 Two node setup2.2 Two masters +one/ many slaves3 Requirements3.1 Requirements- monitoring host3.2 Requirements-nodes44553.3 Additional requirements for MMM tools4 mmm_agentd -the agent65 mmm mond -the monitor75.2 Role73 Status file5.4 Checks5.5 Network check5.6 Flap5.7 Modes....,5.7.1 Active Inode5.7.2 Manual mode5. 7. 3 Wait node95.7.4 Passive mode95.9 Rolc transition5.9.1 Standard role95.9.2 Activc master rolc5.10 Kill host functionality......106 mmm_control-controlling the monitor6.1he1116.2 ping116.3 show116.4 checks [host lall [check lall6.5 set online host,,126.6 set offline host126.7 mode126.8 set active..........∴..136.9 set manual136.10 set_passive∴.136.11 move role role host136.12ve role --force role host··136.13 set ipip host137 Configuration.147.1 Config fileg147.2 Configuration syntax147. 2.1 Comment147.2.2 Variables.,,,,.,147. 2.3 Specifying multiple values147. 2. 4 Sections...147. 2.4.1 Unique sections147.2.4.2 Named sections7.2.4.3 Default sections....157.2.5 Include157.3 Configuration variables7.3.1 Global variables7.3.2 monitor section...,167.3.3 host sect177.3. role sections207.3.5 check sections217.3.6 socket section7.3.7 copy_method sections22ogging238.1 Logging config files238.2 Log4perl sample configuration..23Index25Chapter 1: Overview1Oⅴ erviewMMM (Master-Master Replication Manager for MySQL) is a set, of flexible scripts to perform monitoring/failover and management of My SQL Master-Master replication configurations(with only one node writable at any time). The toolset also has the ability to readbalance standard master/ slave configurations with any number of slaves, so you can use it tomove virtual IP addresses around a group of servers depending on whether they are behindin replication. In addition to that, it also has scripts for data backups, resynchronizationbetween nodes etcThe main functionality is provided through the following Chree scriptmmm_mond monitoring daemon which docs all monitoring work and makes all decisionsabout roles moving and so onmmm_agentdagent daemon which runs on each MySQL server and provides monitoring nodewith simple set of remote servicesmmm controlsimple script dedicated to management of the mmm-mond processes bycom-mandsChapter 2: Typical use-cases2 Typical use-casesTypical use cases of MMM will be described in the following two sections2.1 Two node setupMonitorMaster 1Master 2ReplicationApplicationMySQLMMMIn two node master-master setup, MMM uses five IPs: single permanent IP for each nodethat is ncvcr changed, 2 rcadcr IPs(rcad-only) and 1 writer IP(updates). Last thrcc IPsare migrating between the nodes depending on node availabilityNormally(no replication failures, no replication delay etc) active master has 2 IPs(readerand writer), standby master-1 IP(reader). In case of a failure, both -writer and readerroles migrate to the working nodeChapter 2: Typical use-cases2.2 Two masters+ one/many slavesMonitorMaster 1Master 2SlavesReplicationpplicationMMMChapter 3: Requirements3 RequirementsFor an MMM setup with n MySQL servers, you'll needn+ 1 hostsOne host for each My SQL server, one host for the MMM monitor2*(n+1)IPsOnc IP for cach host(scc abovc); onc IP for the writer rolc; n IPs for onc rcadcrrole per hostmonitor userA MySQL uSer with privileges REPLICATION CLIENT for MMM monitoragent userA MySQL user with privileges SUPER, REPLICATION CLIENT, PROCESS forMMM agentreplication userA My SQL uSer with privileges REPLICATION SLAVE used for replication.tools userA MySQL user with privileges SUPER, REPLICATION CLIENT, RELOAD for MMMtools3.1 Requirements- monitoring hostperl with threads supportfping (if you want to run mmm_mond as non-root userPerl moduleAlgorithm DiffgDBI and DBD: mysqlFile:: BasenameFile: statFile: TempDDg: DispaberMail:: SendNet: PgProc. DaemonThread: QueueTime:: HiResChapter 3: Requirements3.2 Requirements- nodesOne should set read-only-I in the configuration of all MysQL servers, MMM will changeChat to read-only=0 On the host with the active-Imlaster-role●6iproutesend-arp(ssolaris● Perl modulesAlgorithm: DiffDBI and dBD: mysqlFile:: BasenameFile:: statLog: DispatchMail: sendNet: ARP(linux)Proc. DaemonTime: HiRes3.3 Additional requirements for MMm toolsIf you want to use the MMM tools(mmm_backup, mmm_restore, mmm_clone) you have touse LvM for the partition on which your My SQL databases and logs reside. Note: You'llneed free physical extends for the snapshots undo space(see Estimating Undo Space neededfor LVM Snapshot)You'll also need the following perl modules●Path: Classe Data: DumperChapter 4: mmm agentd- the agent64 mmm_agentd- the agentTODO short description