0

我正在尝试使用 Glassfish 3.1.2.2 创建集群,创建集群,然后创建实例并启动它们,一切正常,然后我启用 AJP 端口以使用 mod_jk 从 Apache 制作负载均衡器,步骤如下(来自 Glassfish 方面) :

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

    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 我不知道现在发生了什么。

4

1 回答 1

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”(直到现在还不确定,但使用了另一个侦听器的同一个池)。

然后启动实例,如果启动成功,请尝试使用“netstat -an | grep”检查他们的端口是否正在侦听,例如:“netstat -an | grep 9090”等等。

于 2013-04-30T07:27:19.910 回答