2014-03-16 03:35
浏览 100

PHP / PDO MariaDB Galera集群

I am in the final stages of configuring a service that is accessible from four global locations (with plans to add more later). I will be running the servers on an Ubuntu 12.04 box with MariaDB. My initial thought was to create servers that run independently of each other with 4 distinct databases and live with the constraint that users would only be able to login to the server where they were initially registered.

However, I have just run into this article that has got me thinking... .

From my reading of things if I set up a Galera cluster with master-master replication as suggested in the article I can move have the luxury of one large database that is consistently available across all four servers. I have gathered (and am hoping) that with the cluster setup correctly and functioning well I need do pretty much nothing in my PHP code (the four MariaDB instances will have the same user to access the database) - not even alter the PDO connection string.

However, this sounds almost too good to be true. My questions are:

  • are there other issues involved here that make for complications?
  • Do the PHP PDO connection strings need to be altered in anway?
  • Does the fact that my application is already structured to ensure that there is absolutely zero chance of two servers attempting to simultaneously write the same row help?
  • And finally, reading from the MariaDB docs, that this will not work with the TokuDB storage engine?
  • Is there a way to specifically stop the replication of a selected table? Could I in fact exploit the "only InnoDB/XtraDB" constraint and use another storage engine on the table I do not want to have replicated?

图片转代码服务由CSDN问答提供 功能建议

我正处于配置可从四个全球位置访问的服务的最后阶段(计划稍后添加更多内容) )。 我将使用MariaDB在Ubuntu 12.04盒子上运行服务器。 我最初的想法是使用4个不同的数据库创建彼此独立运行的服务器,并遵守用户只能登录到最初注册的服务器的约束。


如果我设置了一个带有主人的Galera集群,那么从我的阅读中得知 - 我可以移动的文章中建议的主复制具有一个大型数据库的奢侈,该数据库在所有四个服务器上始终可用。 我已经收集(并且希望)通过集群设置正确且运行良好我需要在我的PHP代码中做很多事情(四个MariaDB实例将拥有相同的用户来访问数据库) - 甚至不改变PDO连接字符串 。

然而,这听起来好得令人难以置信。 我的问题是:

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题