首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HornetQ复制失败,获得超时

HornetQ复制失败,获得超时
EN

Stack Overflow用户
提问于 2012-09-11 11:55:24
回答 1查看 1.2K关注 0票数 0

我正在尝试在两台不同的主机上运行新的HornetQ 2.3.0α复制。当我在我的本地机器上尝试它时,它确实或多或少地工作(用不同的端口分隔hornetq )。我稍后会更详细地解释。

我在最新的64位Xubuntu (本地测试)和CentOs (分布式)、OracleJDK6u33(但也尝试了其他版本)上使用普通的HornetQ 2.0α

现在,在本地测试时,我使用不同的端口进行备份(5446)。我启动现场,然后是备份服务器。备份和现场同步。我杀了/阻止了直播。备份将继续工作,并且对备份工作(现在在5445上运行)提出请求。现在,我想再次启动这个无法工作的活动,因为备份使用的是5445。因此,我的下一个测试是在不同的机器上启动实时/备份。

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

下面是备份的例外情况,我在下面附加了配置:

代码语言:javascript
复制
***********************************************************************************
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/独立/非群集)

实时配置文件

hornetq-configuration.xml

代码语言:javascript
复制
<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

代码语言:javascript
复制
<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

代码语言:javascript
复制
<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

代码语言:javascript
复制
<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。

我已经做了好几天了,已经尝试了各种组合,所以如果我错过了什么,请原谅。非常感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-17 01:46:26

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

无论如何,我们即将发布一个Beta,在这里我们改变了节点之间连接的方式。我们甚至删除了一个参数,并改变了一些东西。所以我绝对建议你在HOrnetQ用户论坛上和我们谈谈。也许可以在github的hornetq/master上试一试。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12369144

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档