Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disconf-web在多个实例的情况下,用户session会失效 #17

Closed
MaGonglei opened this issue Jul 28, 2015 · 6 comments
Closed

disconf-web在多个实例的情况下,用户session会失效 #17

MaGonglei opened this issue Jul 28, 2015 · 6 comments

Comments

@MaGonglei
Copy link
Contributor

比如一个 http://127.0.0.1 同时路由到2个tomcat的disconf实例,在disconf-web成功登录后,再刷新 api/account/session 马上就失效了(单实例无影响)

nginx配置类似于

upstream disconf {
      server 127.0.0.1:8080;
          server 127.0.0.1:8081;
 }

server {
    listen   80;
    location / {
        root /data/tomcat/webapps/disconf-war/html;

        if ($query_string) {
            expires max;
        }
    }

    location ~ ^/(api|export) {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_pass http://disconf;
    }
}
@knightliao
Copy link
Owner

所以才要用 redis来做 统一会话 啊。估计你没配好 redis

@MaGonglei
Copy link
Contributor Author

貌似是因为我们的redis并没有设置密码

redis.group1.client1.name=BeidouRedis1
redis.group1.client1.host=127.0.0.1
redis.group1.client1.port=6379
redis.group1.client1.timeout=5000
redis.group1.client1.password=

这个是直接不设置还是?

@knightliao
Copy link
Owner

   if (StringUtils.isEmpty(redisAuthKey)) {
        logger.info("use no auth mode for " + redisServerHost);
        jedisPool = new JedisPool(getPoolConfig(), redisServerHost, redisServerPort, timeout);
    } else {
        jedisPool = new JedisPool(getPoolConfig(), redisServerHost, redisServerPort, timeout, redisAuthKey);
    }

目前应该是直接无密码连接的,奇怪

@knightliao
Copy link
Owner

对了,你们是什么公司在用呢?

@MaGonglei
Copy link
Contributor Author

九鼎控股下面(九鼎投资是目前国内第一PE 新三板市值最大公司)的人人行科技有限公司 第一个产品:借贷宝 http://www.jiedaibao.com/pcIndex.html

上面的那个代码我昨天追了下,是走到不用密码的分支里面的。对spring不太熟悉,后面我再详细追一下,目前用单个实例也够用。

@seven7ma
Copy link

请问您问题怎么解决的,我遇到了一样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants