CentOS 上 WebLogic 集群的负载均衡方案
一 架构选型与算法
二 方案一 WebLogic Proxy Plug-in 配置示例(Apache httpd)
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Listen 9088
<IfModule mod_weblogic.c>
WebLogicCluster 192.168.3.37:8000,192.168.3.37:8001
MatchExpression *.*
WLTempDir "/usr/local/httpd/reqtmp"
DebugConfigInfo ON
KeepAliveEnabled ON
KeepAliveSecs 15
</IfModule>
Include conf/weblogic.conf
重启 Apache 后通过 http://三 方案二 外部负载均衡器配置示例(Nginx/HAProxy)
http {
upstream weblogic_cluster {
server 192.168.1.101:7001;
server 192.168.1.102:7001;
}
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://weblogic_cluster;
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_set_header X-Forwarded-Proto $scheme;
}
}
}
global
log /dev/log local0
log /dev/log local1 notice
maxconn 4096
defaults
log global
mode http
option httplog
retries 3
timeout connect 10s
timeout client 1m
timeout server 1m
frontend http-in
bind *:80
default_backend weblogic_servers
backend weblogic_servers
balance roundrobin
server s1 192.168.1.101:7001 check
server s2 192.168.1.102:7001 check
四 验证与运维要点