HornetQ复制失败,超时

时间:2012-09-11 11:55:24

标签: replication hornetq

我正在尝试在两个不同的主机上运行新的HornetQ 2.3.0.alpha 复制。当我在我的本地机器上尝试它时,它或多或少地工作(与不同端口分开的hornetq)。我将在稍后详细解释。

我在最新的64位Xubuntu(本地测试)和CentOs(分布式),Oracle JDK 6u33(还尝试了其他版本)上使用普通的香草HornetQ 2.3.0.alpha

现在,当测试localy时,我使用不同的端口进行备份(5446)。我开始直播,然后是备份服务器。备份与live同步。我杀了/停止了直播。备份将继续工作,并请求备份工作(现在在5445上运行)。现在我想再次启动,这不起作用,因为备份使用5445.因此我的下一个测试是在不同的机器上启动实时/备份。

在分离的主机上,实时服务器按预期启动。当我开始备份时,它在复制一些数据时会挂起。之后他得到了暂停。它们之间没有防火墙或其他任何东西,我已经检查了两次,并与我的本地管理员。从备份主机到实时主机的Telnet工作正常。

以下是我在备份时遇到的异常,我在下面添加了我的配置:

***********************************************************************************
java  -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Dhornetq.config.dir=../config/stand-alone/non-clustered -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=../config/stand-alone/non-clustered/logging.properties -Djava.library.path=. -classpath ../lib/netty.jar:../lib/jnpserver.jar:../lib/jnp-client.jar:../lib/jboss-mc.jar:../lib/jboss-jms-api.jar:../lib/hornetq-twitter-integration.jar:../lib/hornetq-spring-integration.jar:../lib/hornetq-service-sar.jar:../lib/hornetq-rest.jar:../lib/hornetq-journal.jar:../lib/hornetq-jms.jar:../lib/hornetq-jms-client.jar:../lib/hornetq-jboss-as-integration.jar:../lib/hornetq-core.jar:../lib/hornetq-core-client.jar:../lib/hornetq-commons.jar:../lib/hornetq-bootstrap.jar:../config/stand-alone/non-clustered:../schemas/ org.hornetq.integration.bootstrap.HornetQBootstrapServer hornetq-beans.xml
***********************************************************************************
Unable to read the logging configuration from '../config/stand-alone/non-clustered/logging.properties' (java.net.MalformedURLException: no protocol: ../config/stand-alone/non-clustered/logging.properties)
11:50:37,611 INFO  [org.hornetq.integration.bootstrap] HQ101001: Starting HornetQ Server
11:50:38,932 INFO  [org.hornetq.core.server] HQ111001: backup server is starting with configuration HornetQ Configuration (clustered=true,backup=true,sharedStore=false,journalDirectory=../data/journal,bindingsDirectory=../data/bindings,largeMessagesDirectory=../data/large-messages,pagingDirectory=../data/paging)
11:50:38,950 WARN  [org.hornetq.core.server] HQ112216: Moving data directory ../data/bindings to ../data/bindings22
11:50:38,952 WARN  [org.hornetq.core.server] HQ112216: Moving data directory ../data/journal to ../data/journal22
11:50:38,953 WARN  [org.hornetq.core.server] HQ112216: Moving data directory ../data/paging to ../data/paging22
11:50:38,953 WARN  [org.hornetq.core.server] HQ112216: Moving data directory ../data/large-messages to ../data/large-messages22
11:51:39,106 ERROR [org.hornetq.core.server] HQ114002: Failure in initialisation: java.lang.RuntimeException: Could not estabilish the connection
    at org.hornetq.core.server.impl.HornetQServerImpl$SharedNothingBackupActivation.run(HornetQServerImpl.java:2152) [hornetq-core.jar:]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]

java.lang.RuntimeException: Could not estabilish the connection
    at org.hornetq.core.server.impl.HornetQServerImpl$SharedNothingBackupActivation.run(HornetQServerImpl.java:2152)
    at java.lang.Thread.run(Thread.java:662)

配置文件

我使用默认配置文件作为基础(config / stand-alone / non-clustered)

实时配置文件

hornetq-configuration.xml文件

<configuration xmlns="urn:hornetq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

   <paging-directory>${data.dir:../data}/paging</paging-directory>
   <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
   <journal-directory>${data.dir:../data}/journal</journal-directory>
   <journal-min-files>10</journal-min-files>
   <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>

   <connectors>
      <connector name="netty">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
         <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
      </connector>
      <connector name="remote-connector">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
         <param key="host"  value="192.168.40.155"/>
         <param key="port" value="5445"/>
      </connector>
   </connectors>

   <acceptors>
      <acceptor name="netty">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
         <param key="host"  value="0.0.0.0"/>
         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
      </acceptor>
   </acceptors>

   <security-settings>
      <security-setting match="#">
         <permission type="createNonDurableQueue" roles="guest"/>
         <permission type="deleteNonDurableQueue" roles="guest"/>
         <permission type="consume" roles="guest"/>
         <permission type="send" roles="guest"/>
      </security-setting>
   </security-settings>

   <address-settings>
      <!--default for catch all-->
      <address-setting match="#">
         <dead-letter-address>jms.queue.DLQ</dead-letter-address>
         <expiry-address>jms.queue.ExpiryQueue</expiry-address>
         <redelivery-delay>0</redelivery-delay>
         <max-size-bytes>10485760</max-size-bytes>
         <message-counter-history-day-limit>10</message-counter-history-day-limit>
         <address-full-policy>BLOCK</address-full-policy>
      </address-setting>
   </address-settings>

   <shared-store>false</shared-store>
   <clustered>true</clustered>
   <failover-on-shutdown>false</failover-on-shutdown>
   <cluster-user>cluster-user</cluster-user>
   <cluster-password>cluster123</cluster-password>

   <cluster-connections>
      <cluster-connection name="test-cluster">
         <address>jms</address>
         <connector-ref>netty</connector-ref>
         <retry-interval>2000</retry-interval>
         <use-duplicate-detection>true</use-duplicate-detection>
         <forward-when-no-consumers>true</forward-when-no-consumers>
         <max-hops>1</max-hops>
         <static-connectors allow-direct-connections-only="true">
            <connector-ref>remote-connector</connector-ref>
         </static-connectors>
      </cluster-connection>
   </cluster-connections>

   <backup>false</backup>

</configuration>

将hornetq-jms.xml文件

<configuration xmlns="urn:hornetq"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

   <connection-factory name="NettyConnectionFactory">
      <xa>false</xa>
      <ha>true</ha>
      <reconnect-attempts>-1</reconnect-attempts>
      <retry-interval>1000</retry-interval>

      <connectors>
         <connector-ref connector-name="netty"/>
      </connectors>
      <entries>
         <entry name="/ConnectionFactory"/>
      </entries>
   </connection-factory>

   <queue name="DLQ">
      <entry name="/queue/DLQ"/>
   </queue>

   <queue name="ExpiryQueue">
      <entry name="/queue/ExpiryQueue"/>
   </queue>

   <queue name="testing">
      <entry name="/queue/testing" />
      <durable>true</durable>
   </queue>

</configuration>

备份配置文件

hornetq-configuration.xml文件

<configuration xmlns="urn:hornetq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

   <paging-directory>${data.dir:../data}/paging</paging-directory>
   <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
   <journal-directory>${data.dir:../data}/journal</journal-directory>
   <journal-min-files>10</journal-min-files>
   <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>

   <connectors>
      <connector name="netty">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
         <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
      </connector>
      <connector name="remote-connector">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
         <param key="host"  value="192.168.40.180"/>
         <param key="port" value="5445"/>
      </connector>
   </connectors>

   <acceptors>
      <acceptor name="netty">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
         <param key="host"  value="0.0.0.0"/>
         <param key="port"  value="5445"/>
      </acceptor>
   </acceptors>

   <security-settings>
      <security-setting match="#">
         <permission type="createNonDurableQueue" roles="guest"/>
         <permission type="deleteNonDurableQueue" roles="guest"/>
         <permission type="consume" roles="guest"/>
         <permission type="send" roles="guest"/>
      </security-setting>
   </security-settings>

   <address-settings>
      <!--default for catch all-->
      <address-setting match="#">
         <dead-letter-address>jms.queue.DLQ</dead-letter-address>
         <expiry-address>jms.queue.ExpiryQueue</expiry-address>
         <redelivery-delay>0</redelivery-delay>
         <max-size-bytes>10485760</max-size-bytes>
         <message-counter-history-day-limit>10</message-counter-history-day-limit>
         <address-full-policy>BLOCK</address-full-policy>
      </address-setting>
   </address-settings>

   <shared-store>false</shared-store>
   <clustered>true</clustered>
   <failover-on-shutdown>false</failover-on-shutdown>
   <cluster-user>cluster-user</cluster-user>
   <cluster-password>cluster123</cluster-password>
   <live-connector-ref connector-name="remote-connector"/>


   <cluster-connections>
      <cluster-connection name="test-cluster">
         <address>jms</address>
         <connector-ref>netty</connector-ref>
         <retry-interval>2000</retry-interval>
         <use-duplicate-detection>true</use-duplicate-detection>
         <forward-when-no-consumers>true</forward-when-no-consumers>
         <max-hops>1</max-hops>
         <static-connectors allow-direct-connections-only="true">
            <connector-ref>remote-connector</connector-ref>
         </static-connectors>
      </cluster-connection>
   </cluster-connections>

   <backup>true</backup>

</configuration>

将hornetq-jms.xml文件

<configuration xmlns="urn:hornetq"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

   <connection-factory name="NettyConnectionFactory">
      <xa>false</xa>
      <ha>true</ha>
      <reconnect-attempts>-1</reconnect-attempts>
      <retry-interval>1000</retry-interval>

      <connectors>
         <connector-ref connector-name="netty"/>
      </connectors>
      <entries>
         <entry name="/ConnectionFactory"/>
      </entries>
   </connection-factory>

   <queue name="DLQ">
      <entry name="/queue/DLQ"/>
   </queue>

   <queue name="ExpiryQueue">
      <entry name="/queue/ExpiryQueue"/>
   </queue>

   <queue name="testing">
      <entry name="/queue/testing" />
      <durable>true</durable>
   </queue>

</configuration>

当我在本地创建沙箱时,它使用相同的配置,但对于备份,更改hornetq-beans.xml以将端口从1099/1098移动到1199/1198。

我现在正在研究这几天,并尝试了各种组合,所以请原谅我如果我错过了什么。非常感谢!

1 个答案:

答案 0 :(得分:1)

HornetQ 2.3正在积极开发中。我建议你在用户论坛而不是所有开发人员工作的SOF上提问。

无论如何,我们即将发布一个测试版,我们改变了节点之间的连接方式。我们甚至删除了一个参数并改变了一些内容。所以我肯定会建议你在HOrnetQ用户的论坛上与我们交谈..也许在github上尝试一下hornetq / master。