`
bayaci
  • 浏览: 265659 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

创建高可用性能的mysql集群

阅读更多

Today's enterprise depends on the availability of mail and web services. Failure is never far away, whether it be a hardware failure or a human error. We have to try to make an infrastructure as highly available as possible.

When building highly available clusters, people often choose one extra physical machine per service, creating an A-B, fail-over schema. With static websites, there is no problem making the application highly available; you can just store the data in two places. However, the moment you add a database to your environment, things start to become more difficult. The easy way out is to move the database to a different machine and move that server into a SEP field.

今天的企业靠提供电子邮件和网上服务。离故障很远,无论是硬件故障或人为错误。我们要设法创建高可用性能的基础架构。
当创建高可用性能集群,人们常常选择一个额外的物理机每服务中,创造了一-二,故障切换模式。静态网站,是没有问题,使应用高度可用;你可以只存储数据在两台机器上。不过,你放入一个数据库的环境,事情开始变得更加困难。

That's not how we do it. In the old days when sites became too heavily loaded, we used MySQL replication to create multiple read-only copies of the database, which LVS load balanced. This, however, meant that we had to modify the application itself so that it could only write to the master node.

这不是我们如何去做。在以前网站变得太沉重负载时候,我们使用mysql的复制创建多个只读副本数据库,其中lvs的负载平衡。但是,这意味着我们不得不修改自己的应用,所以它只能写给主节点。

Later, many people tried to create a replication environment that implemented high availability. All of them struggled with the problem that they couldn't exactly define where a node failed, so it was possible to lose records. Also, recovering from a failover seemed to be a difficult task.

后来,许多人试图建立一个复制环境,实施高可用性。他们都挣扎问题,他们不能确定到底哪里一个节点失败,因此有可能失去记录。此外,从收回故障似乎是一个艰巨的任务。
In late 2004 and early 2005, MySQL announced MySQL Cluster--the NDB storage engine from MySQL that plugs into the MySQL environment. With this cluster environment, I built a highly redundant environment. This article discusses how to do it yourself.
在2004年末和2005年初,公布的mysql mysql的集群-ndb存储引擎从m ysql插入m ysql的环境。这个集群环境下,我建立了一个高度冗余环境。文章论述了如何去做吧。
Hold on before you decide to implement MySQL cluster, as it certainly doesn't suit all jobs yet. The MySQL NDB engine currently runs its database completely in memory. This means that you have to be able to fit your database in memory. If you have a 1GB dataset and you want to have your data spread over two nodes, you need 1GB of memory per node. If you have four nodes, you can deal with 512MB per node. The first thing that becomes clear is that you have to look at your dataset. Giant data-warehousing databases won't fit into the MySQL NDB engine yet. Today, you might need to look at commercial alternatives such as Continuent, the former Emic Networks.
在你决定实施的mysql集群之前,要清楚这个不能满足所有的任务。 mysql的ndb引擎目前运行在内存的数据库当中。这意味着你必须要能够适合你的数据库中的内存。如果你有一个1gb的数据集,你想拥有你的数据遍布两个节点,你需要1gb内存每节点。如果你有四个节点,你可以应付每512mb的节点。第一件事变得清楚的是,你要看看你的数据。大型数据仓储数据库,将不适合成为mysql的ndb引擎。今天,你可能需要看看商业等替代延伸,前主位网络。
Secondly, this article is about building a truly available MySQL cluster, which means it focuses on high availability, not on high throughput. If your database is suffering from too-high loads, you still might want to look back at replication in combination with LVS.
其次,这篇文章是对建设一个真正可用的mysql集群,即它着重于高可用性,而不是对高吞吐量。如果你的数据库是从事高度负载,你还是可能想回头在复制结合lvs的。

The MySQL NDB storage engine consists of different parts:

  • ndb_mgmd is the NDB management daemon. This daemon manages the cluster. It should start first in order to monitor the state of the other parts. The management daemon can arbitrate who becomes master and which nodes have to be disconnected from the cluster. It is also capable of (re)starting different nodes and starting backups. The other nodes will ask the management node for their configuration details, but from then on, they don't really need the management node anymore. You can easily stop and start the management node while not disturbing the cluster, as long as no other fault happens during this restart. The management node listens on port tcp/1186 (tcp/2200 in older versions).
  • ndb_mgm is the management client. It sends commands to ndb_mgmd.
  • ndbd is the actual network database engine. You need at least the number of nodes equal to the amount of replicas you want. To spread data over multiple nodes, increase the number of nodes.
  • mysqld is the standard SQL node that connects to the ndbd for NDB engine type storage. It still can use MyISAM or InnoDB tables.

mysql的ndb存储引擎构成的不同部分:

ndb_mgmd是ndb管理守护。这个守护管理集群。它应该首先启动,以顺序监控其他部分。管理守护可以仲裁的主节点和其他节点都必须从断开其他集群环境。它同时也能够(重新)开始不同节点并开始备份。其他节点会要求管理节点的配置细节,但从此,不是真的不要管理其他节点了。在重启其间只要没有其他故障发生,你可以轻易停止,并启动管理节点,而不是烦恼的集群。管理节点监听端口tcp/1186 ( tcp/2200在较旧版本) 。
ndb_mgm是管理客户端。它发出命令到ndb_mgmd 。
ndbd是实际的网络数据库引擎。你至少需要想要复制的个数的节点。数据覆盖在多个节点,增加节点数目。
mysqld是ndbd为ndb引擎类型存储的标准sql节点连接。它仍然可以使用或myisam innodb的图表。

Standard MySQL clients connect to the SQL node and won't notice the difference between a MyISAM or InnoDB query, so there is no need to change the API.

标准的mysql客户连接到sql节点,不会通知区别myisam 或innodb表,所以没有必要改变API。

In order to achieve high availability, you need at least three nodes: one management node, and two different replica nodes for ndbd.

<!--CS_PAGE_INDEX-->

为了实现高可用性,你需要至少三个节点:一个管理节点,以及两种不同的复制节点ndbd 。
<!--CS_PAGE_BREAK-->


下面就是老版本的配置细节,我就不继续说明了。

原文地址:http://www.oreillynet.com/lpt/a/6474

分享到:
评论

相关推荐

    MySQL管理之道 性能调优、高可用与监控.part2.rar

    以最新的mysql版本为基础,以构建高性能mysql服务器为核心,从故障诊断、表设计、sql优化、性能参数调优、mydumper逻辑、xtrabackup热备份与恢复、mysql高可用集群搭建与管理、mysql服务器性能和服务监控等方面多...

    高可用MySQL_构建健壮的数据中心.pdf

    本书是"Mysql High Availability"的中文翻译版,主要讲解真实环境下如何使用mysql的复制,集群和监控特性,揭示mysql可靠性和高可用性的方方面面.本书由Mysql开发团队亲自执笔,定位于解决Mysql数据库的常见应用瓶颈,在...

    集群好书《高性能Linux服务器构建实战》 试读章节下载

    由国内著名技术社区联合推荐的2012年IT技术力作:《高性能Linux服务器构建实战:运维监控、性能调优与集群应用》,即将上架发行,此书从Web应用、数据备份与恢复、...14.5 部署MySQL集群要考虑的问题 14.6 本章小结

    MySQL集群

    MySQL集群是一个无共享的、分布式节点架构的存储方案,其目的是提供容错性和高性能.是MySQL适合于分布式计算环境的高可用、高性能版本,它采用了NDB Cluster存储引擎 MySQL集群主要包括三个组成部分:管理节点、数据...

    2017最新老男孩MySQL高级专业DBA实战课程全套【清晰不加密】,看完教程月入40万没毛病

    25-常见MySQL集群高可用架构讲座03.mp4 26-常见MySQL集群高可用架构讲座04.mp4 27-常见MySQL集群高可用架构讲座05.mp4 28-门户分布式数据库架构案例分享01.mp4 29-门户分布式数据库架构案例分享02.mp4 30-门户分布式...

    MySQL5.1性能调优与架构设计.mobi

    ●架构设计篇则主要以设计一个高可用可扩展的分布式企业级数据库集群环境为目标,分析介绍了通过MySQL实现这一目标的多种架构方式。主要包括可扩展和高可用两部分内容,可扩展部分包括设计原则、Replication的利用、...

    基于mysql+mycat搭建稳定高可用集群负载均衡主备复制读写分离操作

    数据库性能优化普遍采用集群方式,oracle集群软硬件投入昂贵,今天花了一天时间搭建基于mysql的集群环境。 主要思路 简单说,实现mysql主备复制–&gt;利用mycat实现负载均衡。 比较了常用的读写分离方式,推荐mycat,...

    MySQL是一款开源的关系型数据库管理系统,能够解决许多数据存储和管理方面的问题

    高可用性:MySQL支持主从复制和集群配置等多种高可用性方案,以确保数据库始终处于可用状态。性能优化:MySQL能够通过索引和其他优化技术来提高数据库查询和操作的性能。跨平台支持:MySQL可以运行在各种操作系统上...

    数据库存储设计.doc

    大型网站架构设计方案 ——数据库存储设计 方案一:Mysql Cluster (Mysql集群) 数据库系统介绍 高性能、高可用性、冗余和可扩展性,数据在集群内部的对等数据节点之间相互复制。 数据复制采用同步机制,每个数据...

    MySQL20个高性能架构设计原则(值得收藏)

    随着技术发展,开源数据库方面很多高可用组件(主从复制、半同步、MGR、MHA、Galera Cluster),对应场景,只有适合的,没有万能的,需要理解每个高可用优缺点。 03. 表设计 表设计方面目前一致坚持和提倡的

    don:RadonDB是开源的云原生MySQL数据库,用于构建全局的,可扩展的云服务

    概观RadonDB是一个开源的,云原生MySQL... 它旨在创建供开发人员使用的开源数据库:该数据库具有财务高可用性,大容量数据库,自动平面拆分表,可伸缩性和强一致性等功能,该指南着手详细说明内部-don过程的工作方式

    dbproxy]基于阿里cobar增强的opencloudb

    • 支持Mysql集群,可以作为Proxy使用 • 自动故障切换,高可用性 • 支持全局表,数据自动分片到多个节点,用于高效表关联查询 • 支持独有的基于E-R 关系的分片策略,实现了高效的表关联查询 • 多平台支持,部署...

    运维角度浅谈MySQL数据库优化(李振良)

    一个成熟的数据库架构并不是一开始设计就具备高可用、高伸缩等特性的,它是随着用户量的增加,基础架构才逐渐完善。这篇博文主要谈MySQL数据库发展周期中所面临的问题及优化方案,暂且抛开前端应用不说,大致分为...

    Redis云管理平台CacheCloud.zip

    5. 伸缩性 本产品支持Redis最新的Redis-Sentinel、Redis-Cluster集群机构,既满足Redis高可用性、又能满足Redis的可扩展性,具有较强的容量和性能伸缩能力。6. 经济成本 机器利用率低,各个项目组的Redis较为分散...

    数据库设计文档(样例).doc

    数据存放在一个地方总存在风险,况且人为的逻辑错误也有可能破坏 数据,因而,可以采用高性能、完善的备份系统,将数据拷贝下来,存放到价廉的存储 介质上,这是数据安全的基本保证。企业最常使用的备份介质包括:...

    【白雪红叶】JAVA学习技术栈梳理思维导图.xmind

    可用性设计 可靠性设计 一致性设计 负载均衡设计 过载保护设计 协议设计 二进制协议 文本协议 接入层架构设计 DNS轮询 动静态分离 静态化 反向代理 LVS F5 CDN 逻辑层架构设计 连接池 串行化技术...

    JAVA上百实例源码以及开源项目源代码

     Java非对称加密源程序代码实例,本例中使用RSA加密技术,定义加密算法可用 DES,DESede,Blowfish等。  设定字符串为“张三,你好,我是李四”  产生张三的密钥对(keyPairZhang)  张三生成公钥(publicKeyZhang...

    JAVA上百实例源码以及开源项目

     Java非对称加密源程序代码实例,本例中使用RSA加密技术,定义加密算法可用 DES,DESede,Blowfish等。  设定字符串为“张三,你好,我是李四”  产生张三的密钥对(keyPairZhang)  张三生成公钥(publicKeyZhang...

Global site tag (gtag.js) - Google Analytics