2013-04-30 64 views
0

我正在嘗試使用Glassfish 3.1.2.2創建羣集,然後創建羣集,然後啓動實例並啓動它們,並且每件事都可以,然後啓用AJP端口以使Apache負載平衡器用下面的步驟(從Glassfish的一側)的mod_jk:從Glassfish實例在啓用AJP後無法啓動

  • 我jar文件(共享記錄-1.1.1.jar,公地建模-2.0.1.jar,Tomcat的ajp.jar) tomcat並把它們放在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之前做到了,是沒有問題的工作很好,但與廣發3.1.2.2我不知道怎麼回事現在。

回答

0

我只是想知道我爲什麼要工作幾天,然後當我寫一個問題時,我發現一個解決方案很有趣。 無論如何,我發現我的解決方案,但尚未測試,但至少我看到端口處於「LISTEN」狀態:

問題出自「-Dcom.sun.enterprise.web.connector.enableJK = $ {AJP_PORT}」好像不是正確的方式了,它在Glassfish的2.1,但在Glassfish的3.1.2,你需要:

  1. 從羣集配置 - >網絡配置 - >網絡監聽器(點擊這個)
  2. 創建「新...」聽衆。
  3. 填寫新的監聽信息:
    • 名稱它想:JK-連接器,端口有:$ {AJP_PORT},檢查 「JK監聽」 來啓用它,爲協議選擇「使用現有的協議「,然後選擇」http-listener-1「協議,對於線程池選擇」http-thread-pool「(直到現在還不確定,但使用了另一個偵聽器的同一個池)。

然後啓動情況下,如果成功開始嘗試檢查自己的端口,使用監聽 「的netstat -an | grep的」,例如: 「netstat的-an | grep的9090」 等。