【问题标题】:Connecting Php application with MySQL Fabric (using php aware connector)将 PHP 应用程序与 MySQL Fabric 连接(使用 php 感知连接器)
【发布时间】:2015-09-17 15:17:47
【问题描述】:

我已经使用 MySQL Fabric 实现了 MySQL Sharding,步骤如下:

步骤:
1. 为 MySQL Fabric 安装最新的(mysql-utilities-1.5.2 实用程序)并为 php-aware-connector 启用 mysqlnd_ms
2. 设置和管理 MySQL Fabric
3.创建组(全局,分片组)并将服务器添加到组中
4.定义数据库模式和表,范围全部用于分片数据库/表
5.根据要求启用GTID所有服务器
5. 使用命令(mysqlfabric sharding lookup_servers database_name.table_name 100000)验证和测试,它会根据我的需要ping正确的服务器

问题:我无法将 PHP 应用程序与 MySQL Fabric 连接,但如果我与 python 应用程序(其连接器)一起使用,MySQL Fabric 的相同设置工作正常。

将 php 应用程序连接到 MySQL Fabric 时出现此错误:

Warning:  mysqlnd_ms_fabric_select_shard(): (mysqlnd_ms) Didn't receive usable servers from MySQL Fabric in /var/www/html/shard.php on line 49

Warning:  mysqli::query(): (mysqlnd_ms) Couldn't find the appropriate master connection. 0 masters to choose from. Something is wrong in /var/www/html/shard.php on line 53

Warning:  mysqli::query(): (mysqlnd_ms) No connection selected by the last filter in /var/www/html/shard.php on line 53

[2000] (mysqlnd_ms) No connection selected by the last filter

【问题讨论】:

  • 用PHP连接时遇到什么错误?

标签: php mysql sharding mysql-fabric


【解决方案1】:

显然 MySQL Router 现在是将 PHP 连接到 Fabric 的方法:

http://mysqlhighavailability.com/mysql-router-on-labs-the-newest-member-of-the-mysql-family/

他们没有在每个连接器中提供单独的结构功能,而是将其分解为一个外部组件,可以透明地与任何现有连接器一起使用。

【讨论】:

    猜你喜欢
    • 2017-10-29
    • 2017-04-20
    • 2017-06-15
    • 1970-01-01
    • 2018-08-16
    • 1970-01-01
    • 2013-04-18
    • 2012-09-19
    • 1970-01-01
    相关资源
    最近更新 更多