博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Fabric FAQ
阅读量:2434 次
发布时间:2019-05-10

本文共 11018 字,大约阅读时间需要 36 分钟。

转自:http://www.mysql.com/products/enterprise/fabric/faq.html

1. What is MySQL Fabric?

A: MySQL Fabric is a framework for managing groups of MySQL Servers and using those servers to provide services. It is designed to be extensible so that over time many different services can be added. In the current version the services provided are High Availability (built on top of MySQL Replication) and scale-out (by sharding the data).

MySQL Fabric is implemented as a MySQL Fabric node/process (which performs management functions) and Fabric-aware connectors that are able to route queries and transactions directly to the most appropriate MySQL Server. The MySQL Fabric node stores state and routing information in its State Store (which is a MySQL database).

2. Is it necessary to use a MySQL-Fabric specific Storage Engine?

A: No. The MySQL Servers that are being managed by MySQL Fabric continue to use InnoDB (and in the future NDB/MySQL Cluster may also be supported).

3. How is High Availability achieved with MySQL Fabric?

A: MySQL Fabric manages one or more HA-Groups where each HA-Group contains one or more MySQL Servers. For High Availability, a HA Group contains a Primary and one or more Secondary MySQL Servers. The Primary is currently a MySQL Replication master that replicates to each of the secondaries (MySQL Replication slaves) within the group.

By default, the Fabric-aware connectors route writes to the Primary and load balance reads across the available secondaries.

Should the Primary fail, MySQL Fabric will promote one of the Secondaries to be the new Primary (automatically promoting the MySQL Server to be the replication Master and updating the routing performed by the Fabric-aware connectors).

4. How are MySQL Server failures detected?

A: The MySQL Fabric node has a built-in monitoring function that checks on the status of the master. In addition, the Fabric-aware connectors report to MySQL Fabric when the Primary becomes unavailable to them. The administrator can configure how many problems need to be reported (and over what time period) before the failover is initiated.

5. What happens when the primary (master) MySQL Server fails?

A: The MySQL Fabric node will orchestrate the promotion of one of the Secondaries to be the new Primary. This involves two main actions:

  • Promoting the Secondary to be the replication master (and any other surviving Secondaries will become slaves to the new master)
  • Updating the routing information such that Fabric-aware connectors will no longer send any queries or transactions to the failed Primary and instead send all writes to the new Primary.
6. Does my application need to do anything as part of the failover?

A: No. The failover is transparent to the application as the Fabric-aware connectors will automatically start routing transactions and queries based on the new server topology. The application does need to handle the failure of a number of transactions when the Primary has failed but before the new Primary is in place but this should be considered part of normal MySQL error handling.

7. Does MySQL Fabric work with semisynchronous replication?

A: In this version, MySQL Fabric sets up the HA Group to use asynchronous replication. If the user prefers to use semisynchronous replication then they can activate it manually after MySQL Fabric has created the replication relationships.

8. What do I do if I need immediately-consistent reads?

A: Because replication from the Primary (master) to the Secondaries (slaves) is not synchronous, you cannot guarantee that you will retrieve the most current data when reading from a secondary. To force a read to be sent to the Primary, the application may set the mode property for the connection to read/write rather than read.

9. How is scaling achieved with MySQL Fabric?

A: Horizontal scaling is achieved by partitioning (sharding) the data from a table across multiple MySQL Servers or HA Groups. In that way, each server or group will contain a subset of the rows from a specific table.

The user specifies what column from the table(s) should be used as the shard key as well as indicating whether to use a HASH or RANGE partitioning scheme for that key; if using RANGE based sharding then the user should also specify which ranges map to which shards. Currently the sharding key must be numeric.

When accessing the database, the application specifies the sharding key which the Fabric-aware connector will then map to a shard ID (using the mapping data it has retrieved and cached from MySQL Fabric) and route the query or transaction to the correct MySQL Server instance.

Within a HA group, the Fabric-aware connector is able to direct writes to the Primary and then spread the read queries across all available Secondaries (and optionally the Primary).

10. Does scaling apply to both reads and writes?

A: Yes. Both reads and writes scale linearly as more HA groups are added. Reads can also be scaled independently by adding more Secondary servers to a HA Group.

11. What if I have table data that needs to be in every shard?

A: A special group can be created called the Global Group which holds the Global Tables. Any table whose data should appear in its entirety in all HA Groups should be handled as a Global Table. For a Global Table, all writes are sent to the Global Group and then replicated to all of the HA Groups. An example might be the department table from an employee database - the contents of the department table being small enough to be stored in every server and where that data could be referenced by any record from one of the sharded employee tables.

Similarly, any schema changes would be sent to the Global Group where they can be replicated to all of the HA Groups.

12. Can MySQL Fabric introduce contention or deadlock?

A: No. A single transaction can only access data from a single shard (+ Global Table data) and all writes are sent to the Primary server within that shard's HA Group. In other words, all writes to a specific row will be handled by the same MySQL Server and so InnoDB's row-based locking will work as normal.

13. What happens when my data set or usage grows and a shard grows too big?

A: MySQL Fabric provides the ability to either:

  • Move a shard to a new HA group containing larger or more powerful servers
  • Split an existing shard into two shards where the new shard will be stored in a new HA Group. In the future, different levels of granularity may be supported for shard splitting.
14. Is there extra latency when using MySQL Fabric?

A: No. Because the routing is handled within the connector there is no need for any extra "hops" to route the request via a proxy process. This is the primary reason why MySQL Fabric does not use a proxy process. The second reason is that proxies can become a bottleneck or a single point of failure.

15. Does my application need to change when a shard is moved to a different MySQL Server or split into multiple shards?

A: No. Because the application deals in shard keys and shard keys do not change during shard moves or splits.

The shard key is simply the value of a column from one or more tables. The shard key does not change if a row is migrated from one shard or server to another. The shard key is mapped to a shard id (using either a HASH or RANGE based mapping scheme); the shard id represents the shard itself.

As an example, if an existing shard were split in two then some of the rows would map to one shard's shard id and the rest to the other's; any given row's shard key does not change as part of that split.

Very importantly, shard keys are known to the application while shard ids are not and so any changes to the topology of the collection of servers is completely transparent to the application.

16. Is the MySQL Fabric node itself fault tolerant? What happens when the MySQL Fabric node is not not available?

A: There is currently only a single instance of the MySQL Fabric node. If that process should fail then it can be restarted on that or another machine and the state and routing information read from the existing state store (a MySQL database) or a replicated copy of the state store.

While the MySQL Fabric node is unavailable, Fabric-aware connectors continue to route queries and transactions to the correct MySQL Servers based on their cached copies of the routing data. However, should a Primary fail, automated failover will not happen until the MySQL Fabric node is returned to service and so it's important to recover the process as quickly as possible.

17. What connectors support MySQL Fabric?

A: Currently PHP, Python & Java. In addition the Hibernate and Doctrine Object-Relational Mappings frameworks are also supported. New connectors will be added over time.

18. Are transactions ACID?

A: Yes. Because each transaction is local to a single MySQL Server, all of the ACID behavior of the InnoDB storage engine is experienced.

19. Is it possible to perform cross-shard unions or joins?

A: Not at present; all queries are limited to the data within a single shard + the Global Table data. If data from multiple shards is required then it is currently the application's responsibility to collect and aggregate the data.

20. Is the routing of queries and transactions transparent to my application?

A: Partially.

For HA, the application simply needs to specify whether the operations are read-only or involve writes (or consistent reads).

For sharding, the application must specify the sharding key (a column from one or more tables) but this is independent of the topology of the MySQL Servers and where the data is held and it is unaffected when data is moved from one server to another.

21. How many machines are needed in order to use MySQL Fabric?

A: For development, the MySQL Fabric node and all of the managed MySQL Servers can be hosted on a single machine.

For deployment, the minimal HA configuration would need 3 or more machines:

  • 2 to host MySQL Servers
  • 1 to host the MySQL Fabric process (that machine could also be running application code)
22. Do I need to run an agent for each MySQL Server?

A: No. The MySQL Fabric node is the only additional process and does not need to be co-located with any of the MySQL Servers that are being managed.

23. How does MySQL Fabric Compare with MySQL Cluster?

A: MySQL Cluster is a mature, well proven solution for providing very high levels of availability and scaling out of both reads and writes. Some of the main extra capabilities that  has over MySQL Fabric are:

  • Synchronous replication
  • Faster (automated) fail-over (resulting in higher availability)
  • Transparent sharding
  • Cross-shard joins and Foreign Keys
  • In-memory, real-time performance

MySQL Fabric on the other hand, allows the application to stick with the InnoDB storage engine which is better suited to many applications.

24. How is MySQL Fabric licensed?

A: MySQL Fabric is available for use under the GPL v2 Open Source license or it can be commercially licensed as part of MySQL Enterprise Edition or MySQL Cluster Carrier Grade Edition.

转载地址:http://upgmb.baihongyu.com/

你可能感兴趣的文章
想起一句话:”多加一层,就可以把问题解决了“
查看>>
PostgreSQL Page页结构解析(7)- B-Tree索引存储结构#3
查看>>
企业文化和价值观
查看>>
推荐书籍:金字塔原理
查看>>
基础存储知识
查看>>
PostgreSQL 源码解读(37)- 查询语句#22(查询优化-grouping_plan...
查看>>
PostgreSQL 源码解读(44)- 查询语句#29(等价类相关数据结构)
查看>>
PostgreSQL 源码解读(48)- 查询语句#33(query_planner函数#9)
查看>>
PostgreSQL 源码解读(45)- 查询语句#30(query_planner函数#6)
查看>>
PostgreSQL 源码解读(47)- 查询语句#32(query_planner函数#8)
查看>>
PostgreSQL 源码解读(17)- 查询语句#2(查询优化基础)
查看>>
Windows Vista内置趣味实用工具大搜罗(转)
查看>>
FreeBSD安装文件系统(转)
查看>>
最简单FreeBSD网关方案(转)
查看>>
Windows 98 多用户的管理(转)
查看>>
更改Windows XP 的日期和时间(转)
查看>>
windows2000中的“秘密武器”(三)(转)
查看>>
Linux程序应用开发环境和工具经验谈(转)
查看>>
Linux办公一条龙之电子表格Calc(转)
查看>>
在NETBSD上配置ADSL+IPF+IPNAT(转)
查看>>