使用Infinispan Cache部署项目的新版本时,Wildfly 10 Clustering不起作用

时间:2016-09-02 13:22:42

标签: amazon-web-services cluster-computing wildfly infinispan wildfly-10

我在AWS上使用Wildfly 10有一个集群环境。它由两个节点组成。当两个节点中的2个完全相同的战争时,环境工作完美。但是当项目发生某些变化时,我想关闭其中一个节点并尝试部署新版本。之后我想改变其他节点内容。但是我收到以下错误;

15:37:51,190 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 72) MSC000001: Failed to start service jboss.infinispan.aero.default: org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
        at org.wildfly.clustering.service.AsynchronousServiceBuilder$1.run(AsynchronousServiceBuilder.java:107)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
        at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:172)
        at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:870)
        at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:639)
        at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:628)
        at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:531)
        at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:222)
        at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:849)
        at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:621)
        at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:572)
        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:440)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.lambda$getCache$6(DefaultCacheContainer.java:119)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:120)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:114)
        at org.wildfly.clustering.infinispan.spi.service.CacheBuilder.start(CacheBuilder.java:80)
        at org.wildfly.clustering.service.AsynchronousServiceBuilder$1.run(AsynchronousServiceBuilder.java:102)
        ... 4 more
Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1
        at org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete(StateTransferManagerImpl.java:224)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
        ... 18 more

15:37:51,253 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,261 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("component" => "backup-for")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,262 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("component" => "backups")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,264 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("component" => "eviction")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,268 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("component" => "expiration")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,269 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("component" => "locking")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,270 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("component" => "partition-handling")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,270 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("component" => "state-transfer")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}
15:37:51,271 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "aero"),
    ("replicated-cache" => "default"),
    ("store" => "none")
]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.infinispan.aero.default" => "org.jboss.msc.service.StartException in service jboss.infinispan.aero.default: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.waitForInitialStateTransferToComplete() throws java.lang.Exception on object of type StateTransferManagerImpl
    Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache default on node1"}}

我在standalone-ha.xml上的infinispan缓存定义是;

<subsystem xmlns="urn:jboss:domain:infinispan:4.0">  
  <cache-container name="aero" default-cache="default">  
    <transport lock-timeout="60000"/>  
    <replicated-cache name="default" mode="SYNC">  
      <transaction mode="BATCH"/>  
    </replicated-cache>  
  </cache-container>  
...  

我在Java上的缓存定义是;

public class ApplicationCache {

    @Resource(lookup = "java:jboss/infinispan/cache/aero/default")
    private Cache<String, String> cache; 

    .....
}

我的问题是什么?我该如何解决?

感谢您的帮助。

编辑我的jgroups配置;

<subsystem xmlns="urn:jboss:domain:jgroups:4.0">
<channels default="ee">
    <channel name="ee" stack="s3ping"/>
<channels>
<stacks>          
    <stack name="s3ping">
       <transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>
           <protocol type="S3_PING">
               <property name="access_key">
                   <%= @s3_access_key %>
               </property>
               <property name="secret_access_key">
                   <%= @s3_secret_access_key %>
               </property>
               <property name="prefix">
                   <%= @s3_bucket %>
               </property>
               <property name="timeout">
                   60000
               </property>
           </protocol>
           <protocol type="MERGE2"/>
           <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>              
           <protocol type="FD"/>
           <protocol type="VERIFY_SUSPECT"/>
           <protocol type="BARRIER"/>
           <protocol type="pbcast.NAKACK"/>
           <protocol type="UNICAST2"/>
           <protocol type="pbcast.STABLE"/>
           <protocol type="pbcast.GMS"/>
           <protocol type="UFC"/>
           <protocol type="MFC"/>
           <protocol type="FRAG2"/>
       </stack>
</stacks>
</subsystem>

编辑2 其他节点堆栈跟踪;

Node 2 stack trace

我不得不将其添加为图像因为SO限制了我的字符大小。

1 个答案:

答案 0 :(得分:0)

WildFly为每个部署创建一个模块。为了将新版本的应用程序视为与先前版本相同的模块,您需要确保部署的运行时名称不包含版本号 - 因为这用于生成部署的模块名称。 有两种方法可以做到这一点: 1.只需从存档名称中删除该版本 - 这将允许您使用基于文件扫描程序的部署而不会出现问题。 2.通过控制台/ CLI部署应用程序,并指定一致的运行时名称。请参阅:https://docs.jboss.org/author/display/WFLY10/Application+deployment

必须注意在部署版本之间保留缓存对象的序列化形式。如果无法保留序列化表单,则应创建一个与新部署版本一起使用的隔离集群,以使分布式缓存中的数据保持隔离状态。