|
你好,我的jeecg3.7.3版本采用tomcat9+redis+nginx 进行集群,session共享没有问题,但是集群后提示没有任何权限,(admin)登录,
tomcat版本为9.0.2 reids3.2 nginx1.3,集群采用的插件为tomcat-cluster-redis-session-manager2.2版本.
配置为 nginx.conf
主要配置:
#gzip on;
upstream ynszly_tomcat{
server 127.0.0.1:8080 weight=1 max_fails=2 fail_timeout=30s;
server 127.0.0.1:18080 weight=1 max_fails=2 fail_timeout=30s;
server 127.0.0.1:28080 weight=1 max_fails=2 fail_timeout=30s;
}
server {
listen 80;
server_name 127.0.0.1;
charset utf-8;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
#root html;
proxy_pass http://ynszly_tomcat;
#index index.html index.htm;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 1;
proxy_read_timeout 1;
proxy_send_timeout 1;
}
tomcat context.xml 部分配置
<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Valve className="tomcat.request.session.redis.SessionHandlerValve" />
<Manager className="tomcat.request.session.redis.SessionManager" />
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
测试了下 sessionid在三个tomcat之间是不变的,redis也存储了sessionid,但是admin登录提示没有任何权限,也不能登出,请帮忙处理,谢谢!
|
-
|