Multi-Host Connections (一)

第9章多主机连接
目录
9.1配置服务器故障转移
9.2使用X协议时配置客户端故障转移
9.3使用Connector/J配置负载平衡
9.4使用Connector/J配置主/从复制
9.5高级负载均衡和故障转移配置

以下各节讨论涉及多主机连接的多个主题,即服务器负载均衡,故障转移和复制。
开发人员应该了解以下有关通过Connector / J进行管理的多主机连接的信息:
    每个多主机连接都是底层物理连接的包装。
    Each multi-host connection is a wrapper of the underlying physical connections.
    每个底层物理连接都有自己的会话。鉴于MySQL体系结构,会话无法被跟踪,共享或复制。
   Each of the underlying physical connections has its own session. Sessions cannot be tracked, shared, or copied, given the MySQL architecture.        
   物理连接之间的每个切换意味着会话之间的切换。
   Every switch between physical connections means a switch between sessions.
   在事务边界内,物理连接之间不存在切换。除了事务边界之外,不保证切换不会发生。
   Within a transaction boundary, there are no switches between physical connections. Beyond a transaction boundary, there is no guarantee that a switch does not occur.


    注意
    如果应用程序在事务边界之外重用会话范围数据(例如变量,SSP),则可能发生故障,因为物理连接(也是会话之间的切换)可能发生切换。因此,应用程序应该重新准备会话数据,并且在发生异常时重新启动最后一个事务,或者如果它不想处理异常处理,它应该为每个新事务重新准备会话数据。

猜你喜欢

转载自my.oschina.net/masterworker/blog/1811659