- 論壇徽章:
- 0
|
hi,各路大神
公司有個(gè)后臺(tái)系統(tǒng),用的集群環(huán)境,前端用的是nginx,后端是3臺(tái)apache+resin的環(huán)境,F(xiàn)在時(shí)不是出現(xiàn)以下問題。
1,一開始我設(shè)置了503跳轉(zhuǎn),就是出現(xiàn)503跳轉(zhuǎn)到下一臺(tái)執(zhí)行,但是用戶在使用過程中發(fā)現(xiàn)數(shù)據(jù)有重復(fù)插入的現(xiàn)象,就是在多臺(tái)后端機(jī)器上執(zhí)行了,查了日志其中一臺(tái)執(zhí)行返回503,但是數(shù)據(jù)是正常插入了,然后nginx又跑到了第二臺(tái)成功執(zhí)行插入。
2,后來我把nginx的proxy_next_upstream給注釋了,用戶在使用過程中時(shí)不是報(bào)503,但是數(shù)據(jù)也是正常插入的。
現(xiàn)在找不出來503的原因,求大神幫忙指點(diǎn)一二,謝謝了。
以下是nginx的配置文件:- upstream sales.net.com {
- ip_hash;
- server 192.168.1.120:80 max_fails=0 fail_timeout=2s;
- server 192.168.1.180:80 max_fails=0 fail_timeout=2s;
- server 192.168.1.118:80 max_fails=0 fail_timeout=2s;
- }
- server {
- listen 80;
- server_name sales.net.com;
- index index.html;
- access_log /opt/xyz/nginx/logs/sales.net.com.access.log manager;
- error_log /opt/xyz/nginx/logs/sales.net.com.error.log info;
- location / {
- # proxy_next_upstream http_503;
- proxy_pass http://sales.net.com;
- proxy_redirect off;
- proxy_ignore_client_abort on;
- proxy_store off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 20m;
- client_body_buffer_size 128k;
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- proxy_buffer_size 32k;
- proxy_buffers 8 32k;
- proxy_busy_buffers_size 64k;
- proxy_temp_file_write_size 64k;
- proxy_intercept_errors on;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
復(fù)制代碼 |
|