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?