启用AJP后,Glassfish实例无法启动

时间:2013-04-30 06:27:30

标签: cluster-computing glassfish-3 load-balancing ajp

我正在尝试使用Glassfish 3.1.2.2创建一个集群,我创建集群,然后实例并启动它们并且一切正常,然后我启用了AJP端口,使用mod_jk通过以下步骤从Apache生成loadbalancer(来自Glassfish方面):

  • 我从tomcat获得了jar文件(commons-logging-1.1.1.jar,commons-modeler-2.0.1.jar,tomcat-ajp.jar)并将它们放在Glassfish的lib文件夹中(不是域名)。 / LI>
  • 然后我为每个实例添加了系统属性(带有特殊值):

    AJP_INSTANCE_NAME和AJP_PORT

  • 最后在群集配置的JVM选项中启用端口:

    -Dcom.sun.enterprise.web.connector.enableJK = $ {AJP_PORT} -DjvmRoute = $ {AJP_INSTANCE_NAME}

并尝试使用以下命令启动实例:

./asadmin start-local-instance --sync=full --node=node1 ins1

使用以下日志失败: 来自控制台

Removing all cached state for instance ins1.
Waiting for ins1 to start ...................................................................................................Error starting instance ins1.
The server exited prematurely with exit code 0.
Before it died, it produced the following output:

Launching GlassFish on Felix platform
[#|2013-04-29T16:46:55.932+0300|INFO|oracle-glassfish3.1.2|com.sun.enterprise.server.logging.GFFileHandler|_ThreadID=1;_ThreadName=main;|Running GlassFish Version: Oracle GlassFish Server 3.1.2.2 (build 5)|#]

[#|2013-04-29T16:46:59.585+0300|INFO|oracle-glassfish3.1.2|org.glassfish.ha.store.spi.BackingStoreFactoryRegistry|_ThreadID=10;_ThreadName=main;|Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry|#]

[#|2013-04-29T16:47:08.881+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=10;_ThreadName=main;|JTS5014: Recoverable JTS instance, serverId = [100]|#]

[#|2013-04-29T16:47:16.645+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=11;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 1259ms - bound to [0.0.0.0:28181]|#]

[#|2013-04-29T16:47:16.646+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=12;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 1872ms - bound to [0.0.0.0:28080]|#]

[#|2013-04-29T16:47:16.833+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=13;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 219ms - bound to [0.0.0.0:24848]|#]

[#|2013-04-29T16:47:17.308+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=14;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 175ms - bound to [0.0.0.0:27676]|#]

[#|2013-04-29T16:47:24.329+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:28080]|#]

[#|2013-04-29T16:47:24.587+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:28181]|#]

[#|2013-04-29T16:47:24.812+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:24848]|#]

[#|2013-04-29T16:47:24.998+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0170: Apache mod_jk/jk2 attached to virtual-server [server]  listening on port [9,090]|#]

[#|2013-04-29T16:47:25.058+0300|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=10;_ThreadName=main;|Startup service failed to start : com.sun.enterprise.v3.services.impl.WebContainerStarter|#]

[#|2013-04-29T16:47:26.791+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=15;_ThreadName=Thread-19;|Server shutdown initiated|#]

[#|2013-04-29T16:47:26.879+0300|INFO|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=15;_ThreadName=Thread-19;|Already stopped, so just returning|#]



Command start-local-instance failed.

编辑:在我禁用GMS进行测试之前,我先放置了第一个日志,我禁用了它,但仍然在登录控制台时显示失败的消息。


我有Solaris x86操作系统,JDK是1.6u37 我在这里做了什么我之前在2.1.1中做过并且没有任何问题,但是使用GF 3.1.2.2我现在不知道最近会发生什么。

1 个答案:

答案 0 :(得分:0)

我只是想知道为什么我会在几天内工作,然后当我写一个问题时,我找到了一个解决方案,很有趣。 无论如何我找到了我的解决方案但尚未测试,但至少我看到处于“LISTEN”状态的端口:

问题来自“-Dcom.sun.enterprise.web.connector.enableJK = $ {AJP_PORT}”似乎不再是正确的方式,它在Glassfish 2.1中,但在Glassfish 3.1.2中你需要:

  1. 从您的群集配置 - >网络配置 - >网络听众(点击此处)
  2. 创建“新...”听众。
  3. 填写新的听众信息:
    • 名称就像:jk-connector,端口:$ {AJP_PORT},选中“ JK Listener ”启用它,对于协议选择“使用现有协议”然后选择“http-listener-1”协议,对于线程池选择“http-thread-pool”(不确定这个到现在为止,但是使用了另一个听众的同一个池。)
  4. 然后启动实例,如果启动成功,请尝试使用“netstat -an | grep”检查其端口是否正在侦听,例如:“netstat -an | grep 9090”等等。