mysql 使用场景_MySQLMHA典型使用场景

1 管理节点部署位置1.1. Dedicated Manager server and multiple MySQL (master,slaves) servers 使用专用的管理服务

1 管理节点部署位置

1.1. Dedicated Manager server and multiple MySQL (master,slaves) servers

使用专用的管理服务器管理多组MySQL主从服务器

Since MHA Manager uses very little CPU/Memory resources, you can manage lots of (master, slaves) pairs from single MHA Manager. It is even possible to manage 100+ pairs from single manager server.

1.2. Running MHA Manager on one of MySQL slaves

在一个从库上部署管理节点

If you have only one (master, slaves) pair, you may not like allocating dedicated hardware for MHA Manager because it adds relatively high costs. In such cases, running MHA Manager on one of slaves makes sense. Note that current version of MHA Manager connects to MySQL slave server via SSH even though the MySQL server is located on the same host as MHA Manager, so you need to enable SSH public key authentication from the same host.

2 不同主从配置下的主从切换场景

2.1 Single master, multiple slaves(单主多从)

M(RW) M(RW), promoted from S1 | | +------+------+ --(master crash)--> +-----+-----+ S1(R) S2(R) S3(R) S2(R) S3(R)This is the most common replication settings. MHA works very well here.

2.2 Single master, multiple slaves (one on remote datacenter) 单主多从,一个从位于远程数据中心

M(RW) M(RW), promoted from S1 | | +------+---------+ --(master crash)--> +-----+------+ S1(R) S2(R) Sr(R,no_master=1) S2(R) Sr(R,no_master=1)In many cases you want to deploy at least one slave server on a remote datacenter. When the master crashes, you may not want to promote the remote slave to the new master, but let one of other slaves running on the local datacenter become the new master. MHA supports such requirements. Setting no_master=1 in the configuration file makes the slave never becomes new master.

2.3 Single master, multiple slaves, one candidate master(单主多从,一个候选主)

M(RW)-----S0(R,candidate_master=1) M(RW), promoted from S0 | | +----+----+ --(master crash)--> +----+----+ S1(R) S2(R) S1(R) S2(R)In some cases you may want to promote a specific server to the new master if the current master crashes. In such cases, setting candidate_master=1 in the configuration file will help.

2.4 Multiple masters, multiple slaves(多主多从)

M(RW)M2(R,candidate_master=1) M(RW), promoted from M2 | | +----+----+ --(master crash)--> +----+----+ S(R) S2(R) S1(R) S2(R)In some cases you may want to use multi-master configurations, and you may want to make the read-only master the new master if the current master crashes. MHA Manager supports multi-master configurations as long as all non-primary masters (M2 in this figure) are read-only.

2.5 Three tier replication(三层复制架构)

M(RW) M(RW), promoted from S1 | | +------+---------+ --(master crash)--> +-----+------+ S1(R) S2(R) Sr(R) S2(R) Sr(R) | | + + Sr2 Sr2In some cases you may want to use three-tier replication like this. MHA can still be used for master failover. In the configuration file, manage the master and all second-tier slaves (in this figure, add M,S1,S2 and Sr in the MHA config file, but do not add Sr2). If the current master (M) fails, MHA automatically promotes one of the second-tier slaves(S1,S2,Sr, and you can also set priorities) to the new master, and recover the rest second-tier slaves. The third tier slave(Sr2) is not managed by MHA, but as long as Sr (Sr2's master) is alive, Sr2 can continue replication without changing anything.

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:php中文网

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/526457.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mysql构建数据立方体_OLAP数据建模工具Workbench的初步使用(数据立方体的建立)

OLAP数据建模工具Workbench的初步使用(数据立方体的建立)概要:1.workbench工具简介2.workbench简单操作(附demo)3.workbench初步使用总结1.workbench工具简介OLAP,(Online Analytical Processing,联机分析处理)。从事相关工作的小伙伴,具体的…

mysql访问60s出现timeout_websocket 每60s报WsHttpUpgradeHandler.timeoutAsync

在后台连接了一个websocket连接,每60s就报如下错误,有知道这是什么情况的吗?2020-09-10 14:22:40 [Catalina-utility-1] ERROR org.apache.coyote.http11.Http11NioProtocol -Error processing async timeoutsjava.util.concurrent.Execution…

java 类 方法继承_java – 在方法重写中返回继承的类而不是超类

我有一个看起来像这样的类结构:class Parent {public Parent(int property) { /* use property */}}class Son extends Parent {public Son(int parentProperty, String sonProperty) {super(parentProperty);/* use son property */}}我想为这两个类创建构建器,以便…

python环绕文字_如何用css实现文字三面环绕图片?

html部分:DIV with content or Image in the Middle of the text Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam rhoncus nibh ipsum, nec tincidunt mauris suscipit non. Nullam euismod est in dui vehicula ornare quis non nulla. Sed ul…

java写入数组_如何在Java中将数组写入outputStream

我想通过Socket发送多个随机值.我认为数组是发送它们的最佳方式.但是我不知道如何将数组写入Socket outputStream?import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.Socket;import java.io.*;import j…

java循环1000000000_求十亿内所有质数的和,怎么做最快?

注:对知乎的公式编辑功能实在无力吐槽,用typora写的文章直接粘过来公式无法显示,只好又手工加上了全部公式,不过可能还是会有遗漏。大家可以点击这个链接 查看我的博客原文。以下是正文:第一次关注到这个问题是在做pro…

java推送Comet_使用Comet4j实现消息推送

public class NewMsgCollector extends ConnectListener implements ServletContextListener {private static final String CHANNEL "hello";public void contextInitialized(ServletContextEvent contextEvent) {//注册应用的channelCometContext context CometC…

java飞行记录器是什么_运行java飞行记录器JFR(java flight recorder)

JFR上面讲到的工具都是作为快速的查看诊断工具的。如果要深入分析问题,可以选择使用内置的Java飞行记录器:Java Mission Control。转储JFR需要三步:1. 创建一个包含了你自己配置的JFR模板文件。运行jmc, 然后Window->Flight Recording Template Manag…

java申请安卓权限_java4android (包和访问权限)

什么是Java当中的软件包?为什么要使用软件包?如何给一个类打包?//将类放置到一个包中,需要使用package“包名”//打包 编译的方法 javac -d . Test.java//出现错误:编码GBK的不可映射字符 javac -encoding UTF-8 -d . …

java圆形泳池问题_Java实现 LeetCode 778 水位上升的泳池中游泳(二分+DFS)

778. 水位上升的泳池中游泳在一个 N x N 的坐标方格 grid 中,每一个方格的值 grid[i][j] 表示在位置 (i,j) 的平台高度。现在开始下雨了。当时间为 t 时,此时雨水导致水池中任意位置的水位为 t 。你可以从一个平台游向四周相邻的任意一个平台&#xff0c…

python可以构建sem模型_python-分组的熊猫DataFrames:如何将scipy.stats.sem应用于它们?...

我知道我可以通过执行以下操作来应用numpy方法:dataList是DataFrames的列表(相同的列/行).testDF (concat(dataList, axis1, keysrange(len(dataList))).swaplevel(0, 1, axis1).sortlevel(axis1).groupby(level0, axis1))testDF.aggregate(numpy.mean)testDF.aggr…

java类中获取全局变量_java 通过反射获取类的全局变量、方法、构造方法

package com.str;public class ZiFuChuan {public static String ss "全局变量!!!!!!";String s2 null;public int aa 1 ;int aa2;double dou 1.1;Double d new Double(1.1);public static void main(String[] args) {}public ZiFuChuan(){}public ZiFuChuan(St…

java phantomjs 截图_phantomjs 截图

phantomjs 截图,多个setTimeout是为了让页面尽量加载完整/**截图test.js**/var page require(webpage).create();page.viewportSize { width: 1024, height: 600 };page.open(http://www.2345.com/, function(status) {var bb page.evaluate(function(){// window…

JAVA如何隐藏异常堆栈_java – 如何在控制台上停止打印异常堆栈跟踪?

这是我做的这样的战争作为工作。添加一个过滤器并劫持所有的请求和响应。检查异常并检查类型。/*** Hijacks all the http request and response here.* Catch the SocketException and do not print* If other exceptions print to console* date : 9-18-2013** author Suresh…

阿里最新php面试题及答案,面经网-阿里php面试题(四)

阿里php面试题(四)1.表单中 get与post提交方法的区别?答:get是发送请求HTTP协议通过url参数传递进行接收,而post是实体数据,可以通过表单提交大量信息.2.session与cookie的区别?答:session:储存用户访问的全局唯一变量,存储在服务器上的php指定的目录中的(session_…

php 条形码生成器,PHP条形码图像生成器

这是一个用于生成barocdes的简单PHP脚本://For displaying barcodes//Arguments are:// code Number you want outputted as a barcode//You can use this script in two ways:// From a webpage/PHP script // Directly in your web browser http://www.example.co…

php怎么把日期加时间,将小时分钟添加到日期时间 - php

任何人都可以帮助我解决长时间困扰的问题,我正在尝试添加时间,例如格式为h:ia的小时和分钟,格式为01:00(一个小时),00:30(30分钟), 02:00(两个小时)等。在php中。因为我有几个小时,例如(00:30,01:00,01:30,…

php keep user login,php5.4安装dedecms登录后台空白解决办法(session_register函数已废弃)...

本地安装dedecms5.7登录后台空白,找了原因,原来是session_register函数已经被php5.4废弃的原因。-------------------------------------------------------------解决方法:找开include/userlogin.class.php文件,查找以下内容&…

java欧冠抽签,欧冠抽签吐槽:最大的“礼包”被C罗拿走!梅西出局概率超50%?...

欧冠16强抽签揭晓,结果:多特VS巴黎,皇马VS曼城,亚特兰大VS瓦伦西亚,马竞VS利物浦,切尔西VS拜仁,里昂VS尤文图斯,热刺VS莱比锡,那不勒斯VS巴萨。怎么评价这样的抽签呢&…

java ajax报错500,(Struts2+JSON+Ajax) XMLHttpRequest ==500如何解决

(Struts2JSONAjax) XMLHttpRequest 500怎么解决?本帖最后由 zjlisok 于 2013-01-29 02:00:05 编辑XMLHttpRequest.status500奇怪了,搞了半天还没有解决。朋友们请帮我一把,谢谢!废话不说,先上代码JS代码:va…