掲示板

JDBCStore session Persistent

thumbnail
12年前 に Fateh Alchhabi によって更新されました。

JDBCStore session Persistent

Junior Member 投稿: 58 参加年月日: 10/12/01 最新の投稿
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
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: JDBCStore session Persistent

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
You have to enable session replication (<distributable/> in web.xml and configure Tomcat) so sessions are unique around the cluster.
thumbnail
12年前 に Fateh Alchhabi によって更新されました。

RE: JDBCStore session Persistent

Junior Member 投稿: 58 参加年月日: 10/12/01 最新の投稿
thanks for quick replay
i not forget it to add its existed in <distributable/> in web.xml
thumbnail
12年前 に Hitoshi Ozawa によって更新されました。

RE: JDBCStore session Persistent

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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.
thumbnail
12年前 に Fateh Alchhabi によって更新されました。

RE: JDBCStore session Persistent

Junior Member 投稿: 58 参加年月日: 10/12/01 最新の投稿
do u advice me to use Memcached ??? emoticon