3

背景

我运行(阅读:继承)一个设置非常类似于共享托管服务提供商的网络。基础设施上运行着 300-400 个站点。多年来,数据库拓扑变得非常分散,因为它是从 webserver->database 的 1 对 1 关系。

问题

  • 这些应用程序是由实施了 wordpress/joomla/drupal 等的第三方设计公司设计的 10 个应用程序中的 9 个。
  • 数据库有点随意地分布在 6 个数据库服务器上。它们不会在任何地方复制。
  • 应用程序没有单独的数据库句柄的概念来将 INSERT 分离到主服务器和 SELECT 到从服务器。
  • 使用单主内置 mysql 复制会产生巨大的瓶颈。插入量会很快降低主数据库。

问题

我的问题变成了,如何使我的数据库拓扑尽可能平坦,同时为未来的可扩展性留出空间?

将来我想在我的网络中添加更多的地理位置,这些地理位置可以跨“backnet”复制相同的数据库。

过去,我研究过多主复制,但看到了很多与 auto_increment 列冲突等问题有关的问题。

我对企业解决方案持开放态度。类似于用于 Oracle 复制的 Shareplex 产品。

无论解决方案是什么,期望应用程序更改以适应这种新设计是不合理的。因此,像 auto_increment 列之类的东西需要保持不变并在整个集群中形成凝胶。

目标

我的目标是为每个可以将所有应用程序指向的集群都有一个内部负载平衡的主机名。一世

这也将为我提供我目前没有的容错能力。目前,无法从轮换中删除数据库。

像 Cassandra 和 Hadoop 这样的应用程序看起来与我想要实现的目标惊人地相似,但 NoSQL 不是这些应用程序的选项。

非常感谢任何提示/指针/教程/文档/产品推荐。谢谢你。

4

1 回答 1

2

过去,我研究过多主复制,但看到了很多与 auto_increment 列冲突等问题有关的问题。

我们在工作中在生产中使用多主机。auto-inc 难题不久前用auto_increment_incrementandauto_increment_offset修复了,它允许每个服务器拥有自己的增量 ID 模式。只要应用程序不是盲目地假设所有 ID 都是连续的,它应该可以正常工作。

多主机的真正问题是 MySQL仍然偶尔会损坏二进制日志。这主要是不可靠连接的问题,因此如果所有实例都是本地的,则不会有问题。

Another problem with multi-master is that it simply doesn't scale with writes, as you've already experienced or assumed, given a point in your answer. All of the writes on one master have to be replicated by the others. Even if you spread out read load correctly, you will eventually hit an I/O bottleneck that can only be resolved by either more hardware, an application redesign, or sharding (read: application redesign). It's slightly better now that MySQL has row-based replication available.

If you need geographic diversity, multi-master could work.

Also look into DRBD a disk-block-level replication system that's now been built into modern Linux kernels. It's been used by others to replicate MySQL and PostgreSQL before, though I don't have any personal experience with it.

I can't tell from your question if you're looking for high availability, or simply are looking for (manual or automatic) fail-over. If you just need fail-over and can have a bit of downtime, then traditional master/slave replication might be enough for you. The trouble is turning a slave that became a master back into a slave.

于 2011-03-23T20:43:37.697 回答