使用Oracle的主/从

时间:2013-06-14 11:16:22

标签: activemq

我们在Oracle DB中使用了所谓的 JDBC Master Slave 架构。我们有2个节点,每个节点都有一个Broker启动。我们启动Broker1(在node1上),它成为MASTER获取表的锁定。然后我们在node2上启动Broker2,这个以SLAVE开始。我们可以在Slave代理的日志中看到它试图每隔10秒获取一次锁,但它失败了:

2013-06-12 19:32:38,714 | INFO  | Default failed to acquire lease.  Sleeping for 10000 milli(s) before trying again... | org.apache.activemq.store.jdbc.LeaseDatabaseLocker | main
2013-06-12 19:32:48,720 | INFO  | Default Lease held by Default till Wed Jun 12 19:32:57 UTC 2013 | org.apache.activemq.store.jdbc.LeaseDatabaseLocker | main

一切正常,然后在SLAVE的日志中,我们看到它突然变成了MASTER:

2013-06-13 00:38:11,262 | INFO  | Default Lease held by Default till Thu Jun 13 00:38:17 UTC 2013 | org.apache.activemq.store.jdbc.LeaseDatabaseLocker | main
2013-06-13 00:38:11,262 | INFO  | Default failed to acquire lease.  Sleeping for 10000 milli(s) before trying again... | org.apache.activemq.store.jdbc.LeaseDatabaseLocker | main
...
2013-06-13 00:38:21,314 | INFO  | Default, becoming the master on dataSource: org.apache.commons.dbcp.BasicDataSource@9c6a99d | org.apache.activemq.store.jdbc.LeaseDatabaseLocker | main
2013-06-13 00:38:21,576 | INFO  | Apache ActiveMQ 5.8.0 (Default, ID:corerec3-49774-1371083901328-0:1) is starting | org.apache.activemq.broker.BrokerService | main
2013-06-13 00:38:21,692 | WARN  | Failed to start jmx connector: Cannot bind to URL [rmi://localhost:1616/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]. Will restart management to re-create jmx connector, trying to remedy this issue. | org.apache.activemq.broker.jmx.ManagementContext | JMX connector
2013-06-13 00:38:21,700 | INFO  | Listening for connections at: tcp://corerec3:61617?transport.closeAsync=false | org.apache.activemq.transport.TransportServerThreadSupport | main
2013-06-13 00:38:21,700 | INFO  | Connector openwire Started | org.apache.activemq.broker.TransportConnector | main
2013-06-13 00:38:21,701 | INFO  | Apache ActiveMQ 5.8.0 (Default, ID:corerec3-49774-1371083901328-0:1) started | org.apache.activemq.broker.BrokerService | main
2013-06-13 00:38:21,701 | INFO  | For help or more information please see: http://activemq.apache.org | org.apache.activemq.broker.BrokerService | main
2013-06-13 00:38:21,701 | ERROR | Memory Usage for the Broker (512 mb) is more than the maximum available for the JVM: 245 mb | org.apache.activemq.broker.BrokerService | main
2013-06-13 00:38:22,157 | INFO  | Web console type: embedded | org.apache.activemq.web.WebConsoleStarter | main
2013-06-13 00:38:22,292 | INFO  | ActiveMQ WebConsole initialized. | org.apache.activemq.web.WebConsoleStarter | main
2013-06-13 00:38:22,353 | INFO  | Initializing Spring FrameworkServlet 'dispatcher' | /admin | main

虽然MASTER的日志显示与通常输出的内容没有任何变化......

所以,似乎某种方式SLAVE获得锁定(由于嗯...例如主机和数据库之间的连接丢失),但如果我们不重新启动代理,我们就会开始丢失消息......

问题是在生产者日志中我们可以看到它成功地将消息发送到 QueueX ,但是我们没有看到消费者从队列中取出它们...... 如果我们转到数据库并查询_ACTIVEMQ_MSGS_表,我们会看到消息是未处理的。 它看起来好像代理(生产者已连接到)具有锁并将消息插入到数据库中,并且客户正在消耗的代理没有锁,也无法查询表...

我不知道这一切是否有多大意义,但我当然希望有人可以对这一点有所了解......

我不想使用配置详细信息来填充帖子,但如果您需要特定的详细信息,例如故障转移配置,IP,端口等,我会发布它...

0 个答案:

没有答案