Comments (9)
Hi @babujoym,
If the Redis server is down, session handler throw the exception. So you're getting the 500 - Internal server error for all the requests.
Reason:
This manager is designed for the distributed environment.
First level (request reached to tomcat server) all the request session values are updated from redis to request session context (redis stored values are the updated session values). So redis-server is down, requests will not be forwarded to the next level.
Thanks!
from tomcat-cluster-redis-session-manager.
If nginx has done session preservation, can redis be crossed ,but the application run properly, so that session sharing does not affect the whole application? Because ,sometimes session sharing is used to ensure serial upgrades, and front-end WEB applications are not affected.
from tomcat-cluster-redis-session-manager.
Yes I can see that the manager is designed for distributed environment and yes it doesn't make much sense to get data from normal local session as the requests can come to any of the distributed tomcats and fail.
What do you think about as a backup provide tomcat session replication, but i heard it takes a long time and not efficeant.
from tomcat-cluster-redis-session-manager.
Yep, tomcat session replication is not performant/efficient and cloud (VPC) environment (ex: AWS, GCP) they will not allow to share the data through network.
Secondly tomcat session replication internally uses File store or JDBC store. Reading data from File/Database will take time compare to redis (in-memory data store).
Issues I've faced with tomcat session replication:
- We've to enable sticky session (JSESSIONID) in your load balancer configuration. In this case, one of your tomcat node is down, LB takes time to forward the request to next tomcat node. Sometimes end users ll end up with blank page because of request timeout in internet fluctuation.
- Sometimes file store throw Files not responding/Files not open issue.
from tomcat-cluster-redis-session-manager.
Closing this issue. Please feel free to re-open this or create new issues in future.
Thanks!
from tomcat-cluster-redis-session-manager.
In the current way, if redis is crossed, applications can not be accessed. Once this happens, if we can not resume redis cluster in a short time, we can only cancel session sharing first, and i verify it is feasible. So it is still possible to support some configuration. When the LB support sticky session ,When redis cluster is across, applications can continue to run.
from tomcat-cluster-redis-session-manager.
Yep, we can..
Redis-cluster has minimum of 3 nodes in the cluster group. If all 3 nodes are down then you will not get session related data from the redis cache. Also if all 3 nodes are down, then something you're missing in configuration/env.
I think if we implement that with feature flag, that will reduce the redis data read. I will look into the same and revert the updates soon.
Thanks!
from tomcat-cluster-redis-session-manager.
Hi @posondlq,
I've modified the changes and updated a pre-release (version: 3.0)
Please add 'lb.sticky-session.enabled' property in 'redis-data-cache.properties' configuration and enable this feature.
If enabled,
- Must be enabled sticky session in your load balancer configuration. Else this manager may not return the updated session values.
- Session values are stored in local jvm and redis.
- If redis is down/not responding, requests uses jvm stored session values to process user requests. Redis comes back the values will be synced.
I've tested in standalone redis env and don't have cluster env ready. If you've cluster enabled test env and time, please check..
Thanks!
from tomcat-cluster-redis-session-manager.
Thanks That's great.. Its a good addition
from tomcat-cluster-redis-session-manager.
Related Issues (20)
- Support system variables in 3.0.1 version HOT 2
- redis-data-cache.properties redis.hosts is not working HOT 1
- is there any reason to keep jedis 3.0 instead of jedis 3.3 ? HOT 3
- Unable to connect to redis over SSL
- Maven repo? HOT 2
- The 'lb.sticky-session.enabled=true' attribute does not work HOT 11
- linux环境开启tomcat 会一直创建sessionId
- use tomcat7.0.108 error
- Add prefix to redis keys HOT 1
- Error de-serializing the session object when using 2 TomEE servers HOT 1
- findSession Error occurred while de-serializing the session object.. HOT 1
- JedisClusterMaxAttemptsException:No more cluster attempts left
- Maven repository is asking for authentication - It returns HTTP:401 (Unauthorized)
- I want know how to use the redis sentinel function? HOT 1
- All requests are dumping a new sessionId key in redis.
- Why does each of my requests create a sessionId.Do I need any special configuration
- Why can't the session I create be shared?
- How to pass username jedis?
- Method getJedisNodes Do not Support IPv6
- Spring SSE not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tomcat-cluster-redis-session-manager.