Combination View Flat View Tree View
Threads [ Previous | Next ]
Fateh Alchhabi
JDBCStore session Persistent
March 24, 2012 12:30 AM
Answer

Fateh Alchhabi

Rank: Junior Member

Posts: 58

Join Date: December 1, 2010

Recent Posts

hi all
i have two liferay 6.5 tomcat clustered and
my hardware F5 Load Balancer type is: Round Robin , Prisctence is: Source Address

so my LB is none-sticky because its provide the session sticky only with the mode ssl stick and now no plan for using ssl Sticky

i try to Persistent my session through Database table and i did the following
in mysql database i add table to store the session

create table tomcat_sessions (
session_id varchar(100) not null primary key,
valid_session char(1) not null,
max_inactive int not null,
last_access bigint not null,
app_name varchar(255),
session_data mediumblob,
KEY kapp_name(app_name)
);

and in my /liferay-6.5/tomcat-6.0.26/conf/context.xml i add this

<Context distributable="true" reloadable="true">

<Manager className="org.apache.catalina.session.PersistentManager"
distributable="true">

<Store className="org.apache.catalina.session.JDBCStore"
connectionURL="jdbc:mysql://192.168.1.XX:3306/tomcat?user=XX&amp;password=XXX"
driverName="com.mysql.jdbc.Driver"
sessionTable="sessions"
sessionIdCol="session_id"
sessionDataCol="session_data"
sessionValidCol="valid_session"
sessionMaxInactiveCol="max_inactive"
sessionLastAccessedCol="last_access"
sessionAppCol='app_name'
/>
</Manager>

and the session is stored in Database perfectly

my problem is because my session ID on each node stored in database is unique ,,,,let me clear it hear
if i login to node1 with user "test" new session id is created and stored in the database and if sing in node2 in same user "test" new session ID catered and stored in the database
i need to union the SessionID so if nod1 crash the user "test" is still singed in when the load balancer redirected to the node2
Juan Gonzalez
RE: JDBCStore session Persistent
March 24, 2012 12:30 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2225

Join Date: October 28, 2008

Recent Posts

You have to enable session replication (<distributable/> in web.xml and configure Tomcat) so sessions are unique around the cluster.
Fateh Alchhabi
RE: JDBCStore session Persistent
March 24, 2012 12:32 AM
Answer

Fateh Alchhabi

Rank: Junior Member

Posts: 58

Join Date: December 1, 2010

Recent Posts

thanks for quick replay
i not forget it to add its existed in <distributable/> in web.xml
Hitoshi Ozawa
RE: JDBCStore session Persistent
March 24, 2012 2:41 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

An user may have several session ids so you'll need to setup something like virtual session id by developing a filter. This may actually slow down the system more then using sticky sessions.
Fateh Alchhabi
RE: JDBCStore session Persistent
March 25, 2012 6:20 AM
Answer

Fateh Alchhabi

Rank: Junior Member

Posts: 58

Join Date: December 1, 2010

Recent Posts

do u advice me to use Memcached ??? emoticon