https://code.google.com/p/mysql-master-ha/wiki/TableOfContents?tm=6

http://www.cnblogs.com/gomysql/category/566506.html 实例参考

Installation

MHA consists of MHA Manager and MHA Node packages. MHA Manager runs on a manager server, and MHA Node runs on each MySQL server. MHA Node programs do not run always, but are invoked from MHA manager programs when needed (at configuration check, failover, etc). Both MHA Manager and MHA Node are written in Perl.

Downloading MHA Node and MHA Manager

MHA Node and MHA Manager can be downloaded from "Downloads" section. These are stable packages.

If you want to try development source trees, check out GitHub source trees. MHA Manager is hosted here, and MHA Node is hosted here.

Installing MHA Node

MHA Node has scripts and dependent perl modules that do the following.

  • save_binary_logs: Saving and copying dead master's binary logs
  • apply_diff_relay_logs: Identifying differential relay log events and applying all necessary log events
  • purge_relay_logs: Purging relay log files

You need to install MHA Node to all MySQL servers (both master and slave). You also need to install MHA Node on a management server because MHA Manager modules internally depend on MHA Node modules. MHA Manager internally connects to managed MySQL servers via SSH and executes MHA Node scripts. MHA Node does not depend on any external Perl modules except DBD::mysql so you should be able to install easily.

On RHEL/CentOS distribution, you can install MHA Node rpm package as below.

  ## If you have not installed DBD::mysql, install it like below, or install from source.
  # yum install perl-DBD-MySQL   ## Get MHA Node rpm package from "Downloads" section.
  # rpm -ivh mha4mysql-node-X.Y-0.noarch.rpm

On Ubuntu/Debian distribution, you can install MHA Node deb package as below.

  ## If you have not installed DBD::mysql, install it like below, or install from source.
  # apt-get install libdbd-mysql-perl   ## Get MHA Node deb package from "Downloads" section.
  # dpkg -i mha4mysql-node_X.Y_all.deb

You can also install MHA Node from source.

  ## Install DBD::mysql if not installed
  $ tar -zxf mha4mysql-node-X.Y.tar.gz
  $ perl Makefile.PL
  $ make
  $ sudo make install

Installing MHA Manager

MHA Manager has administrative command line programs such as masterha_manager, masterha_master_switch, etc, and dependent Perl modules. MHA Manager depends on the following Perl modules. You need to install them before installing MHA Manager. Do not forget to install MHA Node.

  • MHA Node package
  • DBD::mysql
  • Config::Tiny
  • Log::Dispatch
  • Parallel::ForkManager
  • Time::HiRes (included from Perl v5.7.3)

On RHEL/CentOS distribution, you can install MHA Manager rpm package as below.

  ## Install dependent Perl modules
  # yum install perl-DBD-MySQL
  # yum install perl-Config-Tiny
  # yum install perl-Log-Dispatch
  # yum install perl-Parallel-ForkManager   ## Install MHA Node, since MHA Manager uses some modules provided by MHA Node.
  # rpm -ivh mha4mysql-node-X.Y-0.noarch.rpm   ## Finally you can install MHA Manager
  # rpm -ivh mha4mysql-manager-X.Y-0.noarch.rpm

On Ubuntu/Debian distribution, you can install MHA Manager deb package as below.

  ## Install dependent Perl modules
  # apt-get install libdbd-mysql-perl
  # apt-get install libconfig-tiny-perl
  # apt-get install liblog-dispatch-perl
  # apt-get install libparallel-forkmanager-perl   ## Install MHA Node, since MHA Manager uses some modules provided by MHA Node.
  # dpkg -i mha4mysql-node_X.Y_all.deb   ## Finally you can install MHA Manager
  # dpkg -i mha4mysql-manager_X.Y_all.deb

You can also install MHA Manager from source.

  ## Install dependent Perl modules
  # MHA Node (See above)
  # Config::Tiny
  ## perl -MCPAN -e "install Config::Tiny"
  # Log::Dispatch
  ## perl -MCPAN -e "install Log::Dispatch"
  # Parallel::ForkManager
  ## perl -MCPAN -e "install Parallel::ForkManager"
  ## Installing MHA Manager
  $ tar -zxf mha4mysql-manager-X.Y.tar.gz
  $ perl Makefile.PL
  $ make
  $ sudo make install

mysql-master-ha的更多相关文章

  1. Windows下搭建MySQL Master Slave[转]

    Windows下搭建MySQL Master Slave 一.背景 服务器上放了很多MySQL数据库,为了安全,现在需要做Master/Slave方案,因为操作系统是Window的,所以没有办法使用k ...

  2. mysql-master-ha 实现mysql master的高可用。

    常用的mysql 高可用有下面几种方案: 名称 原理 特点 mysqlmha Perl脚本对mysql master做心跳,master down了以后,选举new master   ,是要改代理层的 ...

  3. [Spark内核] 第29课:Master HA彻底解密

    本课主题 Master HA 解析 Master HA 解析源码分享 [引言部份:你希望读者看完这篇博客后有那些启发.学到什么样的知识点] 更新中...... Master HA 解析 生产环境下一般 ...

  4. 【Spark-core学习之三】 Spark集群搭建 & spark-shell & Master HA

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk1.8 scala-2.10.4(依赖jdk1.8) spark ...

  5. MySQL Master High Available 源码篇

    https://m.aliyun.com/yunqi/users/1287368569594542/articles https://yq.aliyun.com/articles/59233 MySQ ...

  6. Master HA彻底解密

    本课主题 Master HA 解析 Master HA 解析源码分享 Master HA 解析 生产环境下一般采用 ZooKeeper 做 HA,且建义为 3台 Master, ZooKeeper 会 ...

  7. Windows下搭建MySQL Master Slave

    一.背景 服务器上放了很多MySQL数据库,为了安全,现在需要做Master/Slave方案,因为操作系统是Window的,所以没有办法使用keepalived这个HA工具,但是我们可以接受人工进行切 ...

  8. 【原】ubuntu下Mysql的HA(corosync+pacemaker+drbd)

    一.前提准备: 1.OS:ubuntu 12.04 2.cat /etc/hosts: 127.0.0.1 localhost 192.168.153.154 ha1 192.168.153.155 ...

  9. MySQL master/slave 模式

    1 .复制 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的 数据复制到其它主机(slaves)上,并重 ...

  10. HBase Master HA高可用

    HMaster没有单点问题,HBase中可以启动多个HMaster,通过Zookeeper的Master Election机制保证总有一个Master运行. 所以这里要配置HBase高可用的话,只需要 ...

随机推荐

  1. Build AssetBundle, missing shader.

    Build AssetBundle, missing shader. 0   My uniy version is 4.1.2f1. Every asset file packing to a sin ...

  2. Magento产品批量导入方法?

    从事外贸的我们在工作中,经常需要添加成千上万个的产品,如果一个一个的去上传,要花费很多时间,有是很让人头痛,那么应该如何实现产品批量上传?如果使用的是Magento系统的话,那么你现在有福利了,因为M ...

  3. LeetCode Convert Sorted Array to Binary Search Tree(数据结构)

    题意: 将一个有序的数组建成一棵平衡的BST树. 思路: 因为数组已经有序,每次可以从中点开始建根,再递归下去分别处理左/右子树. /** * Definition for a binary tree ...

  4. CentOS下启动Tomcat

     http://tianlihu.iteye.com/blog/2010028 1. Tomcat的部署包存放的路径 /var/lib/tomcat6/webapps/ 2. Tomcat的配置文件路 ...

  5. HTTP 2.0 与 tomcat

    tomcat 支持http2.0吗? 首先,HTTP2.0协议一级公布,只是推广和各个中间件软件的适配需要时间. stackoverflow里“Tomcat support for HTTP/2.0? ...

  6. Ubuntu 改变workspace布局

    今天花了点时间找ubuntu的workspace布局.发现一个软件,tweak, 非常好用,可以随意调整布局. Ref: http://ubuntuhandbook.org/index.php/201 ...

  7. Set-常用API及详解

    SetAPI: 类别 方法 增 add.addAll 删 remove.removeAll 长 size 遍 iterator 判 isEmpty hashCode 使用与集合大同小异,主要的区别就在 ...

  8. 使用Matlab对灰度图像编程实现2D的傅里叶变换

    1.      先载入一幅灰度图像,如下: (非灰度图) 2. 利用函数fft2,对其进行快速傅立叶变换, 并利用函数fftshift 将变换后的图像原点移动到频率矩形的中心. 3. 利用abs()函 ...

  9. Android滑动选择的日期选择框

    效果图如下. 实现也很简单,使用的是Android的DatePicker控件.AlertDialog实现. 首先是布局文件:date_picker_dialog.xml <?xml versio ...

  10. 获取元素高度及定位js

    <script type="text/javascript">                                   $(window).scroll(f ...