用于 HA 和 LB 的 SQL Server 复制
我目前正在尝试使用 SQL Server 复制服务构建高可用性和负载平衡的 Web 应用程序 技术。自动故障转移内置于应用程序逻辑中。基本上,有两组运行相同的应用程序服务器,每组都有自己的 SQL Server 实例。它们被设置为在发生故障时使用另一个实例。数据通过事务复制在两个 SQL Server 实例之间持续复制。 (存在几秒钟的延迟,没关系。)
我以分发代理在分发服务器(= 发布服务器)上运行的方式设置了两台服务器。我的想法是,只要服务器 A(发布者)正在工作,它就会“收集”交易并在可用时将其转发到服务器 B(订阅者)。服务器 B 也是如此。默认选项(订阅者上的分发者)将在订阅者离线时“丢失”更改。我这样说对吗?更新第一个问题:交易(等待交付)存储在分发数据库中,因此无论如何它们都是“安全的”。这引出了另一个问题:如果分发代理位于订阅者上,它如何知道要交付的新交易?通过频繁的轮询?
这两个数据库具有相同的架构(身份种子和增量除外)。每个读写表都是交叉复制的。当我向表中插入一行时,为什么看不到循环?当我在文档或博客中读到有关双向复制的内容时,他们所指的是这种情况还是可更新的事务复制?
您对这种情况总体有何看法?这是我第一次进行复制,我担心风险。因此,非常欢迎任何评论。
I'm currently trying to build a high-availability and load-balanced web application with SQL Server Replication Services technologies. Automatic fail-over is built into the application logic. Basically, there are two groups of application servers running the same, each with its own SQL Server instance. They are set to use the other instance in case of failure. Data is continously replicated between the two SQL Server instances via transactional replication. (A few seconds lag exists, that's okay.)
I set up both servers in a way that Distribution agents run on the Distributor (= Publisher). My idea is, that as long as Server A (publisher) is working, it 'collects' the transactions and forwards them to Server B (subscriber) as soon as it's available. The same for Server B. The default option (distributor on the subscriber) would 'lose' changes while the subscriber is offline. Am I right with that? UPDATE to this first question: transactions (waiting to be delivered) are stored in the distribution database, so they are "safe" anyway. This leads be to another question: if the Distributor Agent is on the subscriber, how will it know about new transactions to be delivered? Via frequent polling?
The two databases have the same schema (except identity seed and increment). Each read-write table is cross-replicated. Why don't I see a loop, when I insert a row into a table? When I read about bi-directional replication in documents or blogs, is this scenario what they mean or rather updateable transactional replication?
What do you think about this scenario in general? This is my first time with replication, and I fear the risks. Therefore any comments are very welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论