|
附图跟 nginx 配置- upstream mysvr {
- #开启粘滞会话
- ip_hash;
- #weigth参数表示权值,权值越高被分配到的几率越大
- server 172.16.17.120:8080;
- server 172.16.17.120:10002;
- server 172.16.17.89:8080;
- #server 172.16.17.89:10002 weight=5;
- #server 172.16.17.89:8080 weight=5;
- }
- server {
- listen 80;
- server_name 172.16.17.120 localhost;
- charset utf-8;
- #对 "/" 启用负载均衡
- location / {
- proxy_pass http://mysvr/;
- proxy_redirect 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 10m;
- client_body_buffer_size 128k;
- proxy_connect_timeout 90;
- proxy_send_timeout 90;
- proxy_read_timeout 90;
- proxy_buffer_size 4k;
- proxy_buffers 4 32k;
- proxy_busy_buffers_size 64k;
- proxy_temp_file_write_size 64k;
- }
- location /NginxStatus {
- stub_status on;
- access_log on;
- auth_basic "NginxStatus";
- }
- }
复制代码 2012-02-19 12:57:23,199 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,217 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 17 ms (execution: 14 ms, result: 3 ms)
2012-02-19 12:57:23,243 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,258 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 14 ms (execution: 12 ms, result: 2 ms)
2012-02-19 12:57:23,286 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,303 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 16 ms (execution: 14 ms, result: 2 ms)
2012-02-19 12:57:23,349 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,365 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 15 ms (execution: 13 ms, result: 2 ms)
?????? DaemonCollege time=2012-02-19 13:00:00
^C
root@ubuntu:~# tail -f /opt/tomcat/apache-tomcat-6.0.35/logs/catalina.out
2012-02-19 13:05:02,302 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/index!index!action!200] took 1 ms (execution: 0 ms, result: 1 ms)
2012-02-19 13:05:02,304 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 18 ms (execution: 17 ms, result: 1 ms)
2012-02-19 13:05:02,357 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,359 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,664 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,669 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 308 ms (execution: 8 ms, result: 300 ms)
2012-02-19 13:05:02,673 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/index!index!action!200] took 2 ms (execution: 1 ms, result: 1 ms)
2012-02-19 13:05:02,675 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 316 ms (execution: 11 ms, result: 305 ms)
2012-02-19 13:05:02,721 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,731 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 9 ms (execution: 7 ms, result: 2 ms)
|
|