配置没有多播的Glassfish 4群集

时间:2014-07-22 11:48:02

标签: java glassfish cluster-computing

我在DigitalOcean上配置Glassfish 4 Cluster,它不允许多播。我想部署一个内部有一个WAR的EAR应用程序,我希望所有实例都在群集共享会话信息上。 web.xml包含标记。

设置: 我有一台Glassfish 4服务器作为DAS:服务器。

我在DAS的不同主机上有其他2台Glassfish 4服务器作为实例:node01,node02

我在群集上配置了GMS_DISCOVERY_URI_LIST以指向实例:

clusters.cluster.myCluster.property.GMS_DISCOVERY_URI_LIST=tcp://server:9090,tcp://node01:9090,tcp://node02:9090

和群集上的GMS_LISTENER_PORT:

clusters.cluster.myCluster.property.GMS_LISTENER_PORT=9090

在Cluster启动时,实例的日志显示GMS正常(这就是我的想法):

GMS1092: GMS View Change Received for group: ntkCluster : Members in view for ADD_EVENT(before change analysis) are :
1: MemberId: instance01, MemberType: CORE, Address: 10.0.0.2:9090:228.9.143.254:10292:myluster:instance01
2: MemberId: instance02, MemberType: CORE, Address: 10.0.0.3:9090:228.9.143.254:10292:myluster:instance02
3: MemberId: server, MemberType: SPECTATOR, Address: 10.0.0.1:9090:228.9.143.254:10292:myCluster:server

但它也显示了一些关于JMS失败的消息。关键是我的应用程序不使用JMS,我没有配置任何JMS:

[2014-07-22T12:33:16.431+0200] [glassfish 4.0] [INFO] [addresslist.setjmsservice.provider] [javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1406025196431] [levelValue: 800] [[
  JMS010: ADDRESSLIST in setJmsServiceProvider: mq://node01:27676/,mq://node02:27676/]]

[2014-07-22T12:33:16.438+0200] [glassfish 4.0] [INFO] [jms.connection.url] [javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1406025196438] [levelValue: 800] [[
  JMS08: JMS Service Connection URL is : mq://node01:27676/,mq://node02:27676/]]

[2014-07-22T12:33:16.444+0200] [glassfish 4.0] [SEVERE] [rardeployment.start_failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1406025196444] [levelValue: 1000] [[
  RAR6035 : Resource adapter start failed.
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
    at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.setClusterRABeanProperties(ActiveJmsResourceAdapter.java:1298)
    at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.loadRAConfiguration(ActiveJmsResourceAdapter.java:387)
    at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:115)
    at com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
    at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:141)
    at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:108)
    at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:210)
    at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:346)
    at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:405)
    at com.sun.enterprise.connectors.jms.system.JmsProviderLifecycle.initializeBroker(JmsProviderLifecycle.java:127)
    at com.sun.enterprise.connectors.jms.system.JmsProviderLifecycle.postConstruct(JmsProviderLifecycle.java:107)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:281)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:328)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:163)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:673)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:660)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneJob.run(CurrentTaskFuture.java:490)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.go(CurrentTaskFuture.java:362)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.access$100(CurrentTaskFuture.java:279)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.go(CurrentTaskFuture.java:113)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.proceedTo(AsyncRunLevelContext.java:296)
    at org.glassfish.hk2.runlevel.internal.RunLevelControllerImpl.proceedTo(RunLevelControllerImpl.java:66)
    at com.sun.enterprise.v3.server.AppServerStartup.proceedTo(AppServerStartup.java:532)
    at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:346)
    at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:226)
    at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:217)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
    at com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.start(EmbeddedOSGiGlassFishImpl.java:75)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:71)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
    at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Caused by: java.lang.NullPointerException
    at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.isDBEnabled(ActiveJmsResourceAdapter.java:1312)
    at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.setClusterRABeanProperties(ActiveJmsResourceAdapter.java:1282)
    ... 40 more
]]
[2014-07-22T12:33:16.691+0200] [glassfish 4.0] [SEVERE] [failed.to.load.deferred.ra] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=214 _ThreadName=Recovery Helper Thread] [timeMillis: 1406025196691] [levelValue: 1000] [[
  RAR8061: failed to load resource-adapter-config or RA [ jmsra ], com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to start resource adapter : null]]

[2014-07-22T12:33:16.691+0200] [glassfish 4.0] [SEVERE] [unable.to.lookup.pool] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=214 _ThreadName=Recovery Helper Thread] [timeMillis: 1406025196691] [levelValue: 1000] [[
  RAR8060: Unable to lookup pool [ jms/__defaultConnectionFactory-Connection-Pool ], javax.naming.NamingException: Lookup failed for '__SYSTEM/pools/jms/__defaultConnectionFactory-Connection-Pool' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: jms]]]

[2014-07-22T12:33:16.692+0200] [glassfish 4.0] [SEVERE] [rardeployment.jndi_lookup_failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=214 _ThreadName=Recovery Helper Thread] [timeMillis: 1406025196692] [levelValue: 1000] [[
  RAR6017 : Failed to get connection pool object jms/__defaultConnectionFactory via JNDI lookup : com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Lookup failed for '__SYSTEM/pools/jms/__defaultConnectionFactory-Connection-Pool' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}]]
[2014-07-22T12:33:16.973+0200] [glassfish 4.0] [SEVERE] [error.loading.connector.resources.during.recovery] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.recovery] [tid: _ThreadID=214 _ThreadName=Recovery Helper Thread] [timeMillis: 1406025196973] [levelValue: 1000] [[
  RAR7110: Error while loading connector resources during recovery : jms/__defaultConnectionFactory]]

[2014-07-22T12:33:16.982+0200] [glassfish 4.0] [SEVERE] [error.loading.connector.resources.during.recovery] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.recovery] [tid: _ThreadID=214 _ThreadName=Recovery Helper Thread] [timeMillis: 1406025196982] [levelValue: 1000] [[
  RAR7110: Error while loading connector resources during recovery : jms/__defaultConnectionFactory]]

[2014-07-22T12:33:16.984+0200] [glassfish 4.0] [WARNING] [datasource.xadatasource_error] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.recovery] [tid: _ThreadID=214 _ThreadName=Recovery Helper Thread] [timeMillis: 1406025196984] [levelValue: 900] [[
  RAR5005:Error in accessing XA resource with JNDI name [jms/__defaultConnectionFactory-Connection-Pool] for recovery]]

所以问题是:

我是否需要配置JMS和代理以通过群集实例共享会话?

或者群集配置问题是什么?

是否无法在没有多播的情况下共享会话?

提前致谢。

0 个答案:

没有答案