0

I want to create a high availability with Oracle Weblogic. First, I create a cluster called MyCluster and add two servers (Server1 and Server2) to MyCluster. I use Nginx as a load balancer.

I follow the tutorial from https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/12c/12-ManageSessions--4478/session.htm#t1 to replicate session in memory.

Here is my nginx config:

upstream myweb {
    server server1:38080 weight=1;
    server server2:38080 weight=1;
    server server3:38080 weight=1;
}

server {
    listen       80;
    server_name  nginxHost;

    access_log  /var/log/nginx/nginxHost.access.log  main;
    error_log   /var/log/nginx/nginxHost.error.log warn;

    location / {
        proxy_pass http://myweb/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}

When I test session replication, I have a problem. If Server1 is running and Server2 is shutdown now, I connect my application which is on Server1. I power on Server2 and wait it complete startup. Then I shutdown Server1 and refresh browser. The session disappear.

Finally, I find I have to refresh browser after Server2 is running. Is there any way to replicate session when servers start?

Eric
  • 13
  • 4
  • This use case is not covered by memory session replication. You should use file or jdbc replication to achieve it. Session replication is done each time your code is calling session.setAttribute (or removeAttribute) thats why you need to resend your request to "force" replication from one server to another. – Emmanuel Collin Jul 15 '19 at 09:27
  • Thanks. I decided to use jdbc replication. – Eric Jul 17 '19 at 01:53

0 Answers0