banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Vấn đề với Replication Session trên Tomcat 7  XML
  [Question]   Vấn đề với Replication Session trên Tomcat 7 05/07/2012 18:04:42 (+0700) | #1 | 266245
[Avatar]
ngtrongtri
Member

[Minus]    0    [Plus]
Joined: 27/03/2012 22:54:13
Messages: 114
Offline
[Profile] [PM]
Chào mọi người. Hiện tại mình đang có vấn đề về Replication session giữa 2 server Liferay trên Tomcat 7.
Mô hình của mình như sau:
Mình có 1 server Apache và 2 server chạy Tomcat 7.
Hiện tại mình đã cấu hình load balancer giữa 2 server Tomcat 7.
Bây giờ mình muốn thực hiện Replication session. Mình đã tìm hiểu và làm theo hướng dẫn của 2 trang sau đây:
[url]http://www.liferay.com/community/wiki/-/wiki/Main/High+Availability+Guide#section-High+Availability+Guide-Tomcat+Clustering
[/url]
http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html
Tuy nhiên mình gặp lỗi sau
Code:
INFO: Register manager localhost# to cluster element Engine with name Catalina
Jul 5, 2012 11:42:07 AM org.apache.catalina.ha.session.DeltaManager startInternal
INFO: Starting clustering manager at localhost#
Jul 5, 2012 11:42:07 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
INFO: Manager [localhost#], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1, 1}:4000,{127, 0, 1, 1},4000, alive=297037, securePort=-1, UDP Port=-1, id={-61 -8 -103 -28 103 22 78 20 -92 -126 89 -9 -90 -38 48 4 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds.
Jul 5, 2012 11:43:07 AM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions
SEVERE: Manager [localhost#]: No session state send at 7/5/12 11:42 AM received, timing out after 60,050 ms.
Jul 5, 2012 11:43:07 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
WARNING: Manager [localhost#]: Drop message SESSION-GET-ALL inside GET_ALL_SESSIONS sync phase start date 7/5/12 11:42 AM message date 1/1/70 12:00 AM


Mình làm các bước sau:
Cấu hình file server.xml
Thêm <distributable/> trong web.xml
Config <Context distributable="true"> trong context.xml

File server.xml mình thêm đoạn như sau:
Code:
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
                 channelSendOptions="8">

          <Manager className="org.apache.catalina.ha.session.DeltaManager"
                   expireSessionsOnShutdown="false"
                   notifyListenersOnReplication="true"/>

          <Channel className="org.apache.catalina.tribes.group.GroupChannel">
            <Membership className="org.apache.catalina.tribes.membership.McastService"
                        address="228.0.0.4"
                        port="45564"
                        frequency="500"
                        dropTime="3000"/>
            <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                      address="auto"
                      port="4000"
                      autoBind="100"
                      selectorTimeout="5000"
                      maxThreads="6"/>

            <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
              <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
            </Sender>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
          </Channel>

          <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                 filter=""/>
          <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

          <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>

          <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
          <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
        </Cluster>


Mình cấu hình giống nhau trên 2 server.
Mong nhận được sự góp ý của mọi người. Cảm ơn.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 06/07/2012 08:28:12 (+0700) | #2 | 266278
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]
Nhìn không thấy có gì sai. Chỉ có 1 điểm từ tài liệu của tomcat:

Make sure your web.xml has the <distributable/> element
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 06/07/2012 08:49:19 (+0700) | #3 | 266285
[Avatar]
ngtrongtri
Member

[Minus]    0    [Plus]
Joined: 27/03/2012 22:54:13
Messages: 114
Offline
[Profile] [PM]
Em bổ thêm <distributable/> vào trong web.xml như sau:
-$TOMCAT_HOME/conf/web.xml
Code:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
  xmlnssmiliesi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  version="3.0">
.....
  	<distributable/>
...
</web-app>

-%TOMCAT_HOME/webapp/ROOT/WEB-INF/web.xml
Code:
<?xml version="1.0"?>

<web-app id="Liferay_Portal" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlnssmiliesi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	<distributable/>
	<context-param>


Em xin bổ sung thêm log khi startup Liferay:
Log Server tomcat 1:
Code:
Jul 6, 2012 2:43:23 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
Jul 6, 2012 2:43:23 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 6, 2012 2:43:23 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 6, 2012 2:43:23 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 657 ms
Jul 6, 2012 2:43:23 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 6, 2012 2:43:23 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Jul 6, 2012 2:43:23 AM org.apache.catalina.ha.tcp.SimpleTcpCluster startInternal
INFO: Cluster is about to start
Jul 6, 2012 2:43:23 AM org.apache.catalina.tribes.transport.ReceiverBase bind
INFO: Receiver Server Socket bound to:/127.0.1.1:4000
Jul 6, 2012 2:43:23 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 500
Jul 6, 2012 2:43:23 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4
Jul 6, 2012 2:43:24 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:4
Jul 6, 2012 2:43:24 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8
Jul 6, 2012 2:43:25 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:8
Jul 6, 2012 2:43:25 AM org.apache.catalina.ha.deploy.FarmWarDeployer start
SEVERE: FarmWarDeployer can only work as host cluster subelement!
Jul 6, 2012 2:43:25 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /usr/local/liferay/tomcat-7.0.23/conf/Catalina/localhost/ROOT.xml
Jul 6, 2012 2:43:26 AM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared
INFO: Verification complete. Member already disappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1, 1}:4001,{127, 0, 1, 1},4001, alive=374564, securePort=-1, UDP Port=-1, id={34 -105 -121 68 28 -120 65 -23 -80 -99 64 24 -88 59 -108 120 }, payload={}, command={66 65 66 89 45 65 76 69 88 ...(9)}, domain={}, ]]
Loading jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl-6.1.0.jar!/system.properties
02:43:27,993 INFO  [EasyConf:122] Refreshed the configuration of all components
02:43:28,384 INFO  [ConfigurationLoader:56] Properties for jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl-6.1.0.jar!/portal loaded from [file:/usr/local/liferay/portal-setup-wizard.properties, file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/portal-ext.properties, jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl-6.1.0.jar!/portal.properties]
Loading jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl-6.1.0.jar!/portal.properties
Loading file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/portal-ext.properties
Loading file:/usr/local/liferay/portal-setup-wizard.properties
Jul 6, 2012 2:43:29 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded
INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1, 1}:4000,{127, 0, 1, 1},4000, alive=1012, securePort=-1, UDP Port=-1, id={-78 105 57 -115 -40 -50 73 113 -68 -81 -123 -119 -103 48 -6 -34 }, payload={}, command={}, domain={}, ]
Jul 6, 2012 2:43:29 AM org.apache.catalina.tribes.io.BufferPool getBufferPool
INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/slf4j-jdk14-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/util-java.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
02:43:34,170 INFO  [DialectDetector:80] Determine dialect for MySQL 5
02:43:34,215 INFO  [DialectDetector:145] Found dialect org.hibernate.dialect.MySQLDialect
2012-07-06 02:43:36,033 INFO - Terracotta 3.5.4, as of 20111212-111224 (Revision 19290 by cruise@rh5vmo100 from 3.5.4)
2012-07-06 02:43:36,642 INFO - Successfully loaded base configuration from server at '192.168.2.202:9510'.
2012-07-06 02:43:36,713 INFO - Successfully loaded base configuration from file at '/usr/local/liferay/tomcat-7.0.23/temp/tc-config5614854707789839514.xml'.
2012-07-06 02:43:36,735 INFO - Log file: '/home/administrator/terracotta/client-logs/terracotta-client.log'.
2012-07-06 02:43:38,792 INFO - Connection successfully established to server at 192.168.2.202:9510
Jul 6, 2012 2:44:51 AM org.apache.catalina.ha.session.DeltaManager startInternal
INFO: Register manager localhost# to cluster element Engine with name Catalina
Jul 6, 2012 2:44:51 AM org.apache.catalina.ha.session.DeltaManager startInternal
INFO: Starting clustering manager at localhost#
Jul 6, 2012 2:44:51 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
INFO: Manager [localhost#], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1, 1}:4000,{127, 0, 1, 1},4000, alive=83322, securePort=-1, UDP Port=-1, id={-78 105 57 -115 -40 -50 73 113 -68 -81 -123 -119 -103 48 -6 -34 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds.
Jul 6, 2012 2:45:51 AM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions
SEVERE: Manager [localhost#]: No session state send at 7/6/12 2:44 AM received, timing out after 60,032 ms.
Jul 6, 2012 2:45:51 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
WARNING: Manager [localhost#]: Drop message SESSION-GET-ALL inside GET_ALL_SESSIONS sync phase start date 7/6/12 2:44 AM message date 1/1/70 12:00 AM
Starting Liferay Portal Community Edition 6.1.0 CE (Paton / Build 6100 / January 6, 2012)
02:45:55,373 INFO  [BaseDB:409] Database does not support case sensitive queries
02:45:59,450 INFO  [PluginPackageUtil:1096] Reading plugin package for the root context
02:46:01,861 INFO  [AutoDeployDir:105] Auto deploy scanner started for /usr/local/liferay-portal-6.1.0-ce-ga1/deploy
Jul 6, 2012 2:46:20 AM org.apache.catalina.ha.session.JvmRouteBinderValve startInternal
INFO: JvmRouteBinderValve started
Jul 6, 2012 2:46:20 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 6, 2012 2:46:20 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 6, 2012 2:46:20 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 176855 ms

Log Server Tomcat 2:
Code:
INFO: Starting service Catalina
Jul 6, 2012 2:51:37 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Jul 6, 2012 2:51:37 AM org.apache.catalina.ha.tcp.SimpleTcpCluster startInternal
INFO: Cluster is about to start
Jul 6, 2012 2:51:37 AM org.apache.catalina.tribes.transport.ReceiverBase bind
INFO: Receiver Server Socket bound to:/127.0.1.1:4000
Jul 6, 2012 2:51:37 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
INFO: Setting cluster mcast soTimeout to 500
Jul 6, 2012 2:51:37 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4
Jul 6, 2012 2:51:38 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded
INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1, 1}:4000,{127, 0, 1, 1},4000, alive=4523, securePort=-1, UDP Port=-1, id={11 19 80 109 111 40 68 61 -84 -45 80 -36 26 -17 -64 -52 }, payload={}, command={}, domain={}, ]
Jul 6, 2012 2:51:38 AM org.apache.catalina.tribes.io.BufferPool getBufferPool
INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl
Jul 6, 2012 2:51:38 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:4
Jul 6, 2012 2:51:38 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8
Jul 6, 2012 2:51:39 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
INFO: Done sleeping, membership established, start level:8
Jul 6, 2012 2:51:39 AM org.apache.catalina.ha.deploy.FarmWarDeployer start
SEVERE: FarmWarDeployer can only work as host cluster subelement!
Jul 6, 2012 2:51:39 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /usr/local/liferay/tomcat-7.0.23/conf/Catalina/localhost/ROOT.xml
Loading jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
02:51:41,892 INFO  [EasyConf:122] Refreshed the configuration of all components
02:51:42,458 INFO  [ConfigurationLoader:56] Properties for jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal loaded from [file:/usr/local/liferay/portal-setup-wizard.properties, file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/portal-ext.properties, jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties]
Loading jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
Loading file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/portal-ext.properties
Loading file:/usr/local/liferay/portal-setup-wizard.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/slf4j-jdk14-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/util-java.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
02:51:50,143 INFO  [DialectDetector:80] Determine dialect for MySQL 5
02:51:50,297 INFO  [DialectDetector:145] Found dialect org.hibernate.dialect.MySQLDialect
2012-07-06 02:51:52,241 INFO - Terracotta 3.5.4, as of 20111212-111224 (Revision 19290 by cruise@rh5vmo100 from 3.5.4)
2012-07-06 02:51:52,889 INFO - Successfully loaded base configuration from server at '192.168.2.202:9510'.
2012-07-06 02:51:53,191 INFO - Successfully loaded base configuration from file at '/usr/local/liferay/tomcat-7.0.23/temp/tc-config8638592190520250372.xml'.
2012-07-06 02:51:53,237 INFO - Log file: '/home/administrator/terracotta/client-logs/terracotta-client.log'.
2012-07-06 02:51:55,573 INFO - Connection successfully established to server at 192.168.2.202:9510
Jul 6, 2012 2:53:11 AM org.apache.catalina.ha.session.DeltaManager startInternal
INFO: Register manager localhost# to cluster element Engine with name Catalina
Jul 6, 2012 2:53:11 AM org.apache.catalina.ha.session.DeltaManager startInternal
INFO: Starting clustering manager at localhost#
Jul 6, 2012 2:53:11 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
INFO: Manager [localhost#], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 1, 1}:4000,{127, 0, 1, 1},4000, alive=97518, securePort=-1, UDP Port=-1, id={11 19 80 109 111 40 68 61 -84 -45 80 -36 26 -17 -64 -52 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds.
Jul 6, 2012 2:54:11 AM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions
SEVERE: Manager [localhost#]: No session state send at 7/6/12 2:53 AM received, timing out after 60,027 ms.
Jul 6, 2012 2:54:11 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
WARNING: Manager [localhost#]: Drop message SESSION-GET-ALL inside GET_ALL_SESSIONS sync phase start date 7/6/12 2:53 AM message date 1/1/70 12:00 AM
Starting Liferay Portal Community Edition 6.1.0 CE (Paton / Build 6100 / January 6, 2012)
02:54:20,197 INFO  [BaseDB:409] Database does not support case sensitive queries
02:54:25,834 INFO  [PluginPackageUtil:1096] Reading plugin package for the root context
02:54:30,173 INFO  [AutoDeployDir:105] Auto deploy scanner started for /usr/local/liferay-portal-6.1.0-ce-ga1/deploy
Jul 6, 2012 2:54:48 AM org.apache.catalina.ha.session.JvmRouteBinderValve startInternal
INFO: JvmRouteBinderValve started
Jul 6, 2012 2:54:48 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 6, 2012 2:54:48 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8209"]
Jul 6, 2012 2:54:48 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 190381 ms


Em nghĩ ở đây nó không truyền session qua mạng được.
Có cái lạ là khi cả 2 cùng startup lên thì em đăng nhập vào liferay không được, phải tắt 1 trong 2 con mới đăng nhập được.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 06/07/2012 09:48:39 (+0700) | #4 | 266293
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]
To run session replication in your Tomcat 7.0 container, the following steps should be completed:

All your session attributes must implement java.io.Serializable
Uncomment the Cluster element in server.xml
If you have defined custom cluster valves, make sure you have the ReplicationValve defined as well under the Cluster element in server.xml
If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on it's own by autodetecting available ports in the range 4000-4100
Make sure your web.xml has the <distributable/> element
If you are using mod_jk, make sure that jvmRoute attribute is set at your Engine <Engine name="Catalina" jvmRoute="node01" > and that the jvmRoute attribute value matches your worker name in workers.properties
Make sure that all nodes have the same time and sync with NTP service!
Make sure that your loadbalancer is configured for sticky session mode.
 


Bồ cần thoả mãn hết tất cả những thứ ở trên và chú trọng những phần màu đỏ.
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 06/07/2012 10:24:39 (+0700) | #5 | 266295
[Avatar]
ngtrongtri
Member

[Minus]    0    [Plus]
Joined: 27/03/2012 22:54:13
Messages: 114
Offline
[Profile] [PM]
Cảm ơn anh, nhưng em chưa hiểu cái yêu cầu đầu tiên cho lắm.
Anh có thể giải thích giúp em "All your session attributes must implement java.io.Serializable" là gì và mình nên làm những gì không ạ ?
Cảm ơn anh 1 lần nữa.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 06/07/2012 11:02:43 (+0700) | #6 | 266298
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]

ngtrongtri wrote:
Cảm ơn anh, nhưng em chưa hiểu cái yêu cầu đầu tiên cho lắm.
Anh có thể giải thích giúp em "All your session attributes must implement java.io.Serializable" là gì và mình nên làm những gì không ạ ?
Cảm ơn anh 1 lần nữa. 


Đây là phần thuộc về coding. Java application nào đó được deployed trên Tomcat phải có những class quản lý session được implement java.io.Serializable thì cluster trên tomcat mới hoạt động được. Hy vọng là liferay đã làm chuyện này rồi.

Bồ nên đọc thật kỹ:
http://www.liferay.com/community/wiki/-/wiki/Main/High+Availability+Guide#section-High+Availability+Guide-Tomcat+Clustering

có rất nhiều chi tiết cần kiểm tra cẩn thận. Nên soát lại từng dòng 1 coi thử có sót cái gì không.
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 06/07/2012 14:02:20 (+0700) | #7 | 266309
[Avatar]
ngtrongtri
Member

[Minus]    0    [Plus]
Joined: 27/03/2012 22:54:13
Messages: 114
Offline
[Profile] [PM]
Cảm ơn anh rất nhiều. Em sẽ tìm hiểu kỹ lại.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 07/07/2012 13:59:04 (+0700) | #8 | 266362
[Avatar]
ngtrongtri
Member

[Minus]    0    [Plus]
Joined: 27/03/2012 22:54:13
Messages: 114
Offline
[Profile] [PM]
Anh comale cho em hỏi thêm tí.
Em đã config thành công replication session rồi, nguyên nhân là do ip broadcast là 127.0.0.1
Trong hướng dẫn của Tomcat có đoạn như sau
make sure you don't broadcast 127.0.0.1, this is a common error
Em sửa như sau:
Em đã change trong /etc/hosts thành
192.168.2.60 localhost
192.168.2.60 ubuntu

thay thế cho
127.0.0.1 localhost
127.0.1.1 ubuntu


Chạy riêng Replication session của liferay thôi thì ok, nhưng trong liferay em có cấu hình Terracotta nữa nên khi chính lại ip broadcast từ 127 sang 192 thì bị lỗi.
Em ifconfig thì thấy địa chỉ inet addr vẫn là 127.0.0.1. Em nghĩ nguyên nhân là ở đây
Code:
lo        Link encap:Local Loopback  
         inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Bây giờ làm thế nào để em thay đổi inet addr của Local Loopback ?
hoặc có một giải pháp nào khác ?
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 08/07/2012 16:03:51 (+0700) | #9 | 266415
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]
Không nên thay đổi localhost thành IP không phải là 127.0.0.1 vì nó sẽ làm hỏng nhiều dịch vụ trên máy chủ.

Vấn đề em cần làm là chỉnh mỗi dịch vụ (tomcat, terracota...v..v...) để chúng listen trên các IP cụ thể thay vì dùng "localhost".
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Vấn đề với Replication Session trên Tomcat 7 09/07/2012 10:01:53 (+0700) | #10 | 266446
[Avatar]
ngtrongtri
Member

[Minus]    0    [Plus]
Joined: 27/03/2012 22:54:13
Messages: 114
Offline
[Profile] [PM]
Cảm ơn anh, em đã làm được smilie
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|