少年阿賓

          那些青春的歲月

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
          Haproxy根目錄:F:\SysWork\openSource\haproxy\haproxy1.5.12

          配置文件haproxy.cfg如下:


          global  
                  log 127.0.0.1   local0
          #        maxconn 4096
                  chroot F:\SysWork\openSource\haproxy\haproxy1.5.12
          #        uid 99
          #        gid 99
          #        daemon
                  nbproc 1
                  pidfile F:\SysWork\openSource\haproxy\haproxy1.5.12\haproxy.pid         
                  debug quiet
          defaults  
                  log     127.0.0.1       local3
                  mode    http
                  option httplog
                  option httpclose
                  option dontlognull
                  option forwardfor
                  option redispatch
                  retries 3
                  maxconn 8192
                  balance roundrobin
                  timeout connect 50000
          timeout client  50000
          timeout server  50000
                  timeout check   20000
          listen httpweb :8100  
                 mode http  
                 balance roundrobin  
                 option httpclose  
                 option forwardfor  
                 option httpchk GET /index.html #心跳檢測的文件  
                 server httpweb1 localhost:9200 cookie 1 weight 5 check inter 2000 rise 2 fall 3
                 server httpweb2 localhost:9300 cookie 2 weight 3 check inter 2000 rise 2 fall 3
            
          listen httpservice :8200  
                 mode http  
                 balance roundrobin  
                 option httpclose  
                 option forwardfor  
                 option httpchk GET /index.html #心跳檢測的文件  
                 server httpservice1 localhost:9200 cookie 3 weight 5 check inter 2000 rise 2 fall 3
                 server httpservice2 localhost:9300 cookie 4 weight 3 check inter 2000 rise 2 fall 3
          listen tcpservice        
          bind 0.0.0.0:8400        
          mode tcp             
          server tcpservice1 localhost:20880 cookie 5 weight 3 check inter 2000 rise 2 fall 3
            
          listen status 127.0.0.1:8300
              stats enable
              stats uri /status
              stats auth admin:123456
              stats realm (Haproxy\ statistic) 


          啟動命令:
          F:\SysWork\openSource\haproxy\haproxy1.5.12>haproxy.exe -f haproxy.cfg
          [WARNING] 240/200829 (11260) : parsing [haproxy.cfg:14] : 'option httplog' not usable with proxy 'tcpservice' (needs 'mo
          de http'). Falling back to 'option tcplog'.
          [WARNING] 240/200829 (11260) : config : 'option forwardfor' ignored for proxy 'tcpservice' as it requires HTTP mode.
          [WARNING] 240/200829 (11260) : config : proxy 'tcpservice' : ignoring cookie for server 'tcpservice1' as HTTP mode is di
          sabled.
          Available polling systems :
                 poll : pref=200,  test result OK
               select : pref=150,  test result FAILED
          Total: 2 (1 usable), will use poll.
          Using poll() as the polling mechanism.
          [WARNING] 240/200829 (11260) : [haproxy.main()] Cannot raise FD limit to 4019.
          [WARNING] 240/200829 (11260) : [haproxy.main()] FD limit (256) too low for maxconn=2000/maxsock=4019. Please raise 'ulim
          it-n' to 4019 or more to avoid any trouble.
          [WARNING] 240/200830 (11260) : Server httpweb/httpweb1 is DOWN, reason: Layer4 connection problem, info: "Connection ref
          used", check duration: 1000ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
          [WARNING] 240/200831 (11260) : Server httpweb/httpweb2 is DOWN, reason: Layer4 connection problem, info: "Connection ref
          used", check duration: 1000ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
          [ALERT] 240/200831 (11260) : proxy 'httpweb' has no server available!
          [WARNING] 240/200831 (11260) : Server httpservice/httpservice1 is DOWN, reason: Layer4 connection problem, info: "Connec
          tion refused", check duration: 1000ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in
           queue.
          [WARNING] 240/200831 (11260) : Server httpservice/httpservice2 is DOWN, reason: Layer4 connection problem, info: "Connec
          tion refused", check duration: 998ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in
          queue.
          [ALERT] 240/200831 (11260) : proxy 'httpservice' has no server available!



          監控頁面地址:http://127.0.0.1:8300/status



          現在配置文件除了http代理之外,還有tcp代理,http代理就是簡單的代理tomcat的請求。把haproxy的請求分發給多個tomcat,而tcp代理我這里是代理的dubbo請求,dubbo啟動起來的時候20880端口,但是我們可以通過這里的8400端口提供請求
          我們之前都是通過telnet localhost 20880可以看到dubbo控制臺,現在可以通過telnet localhost 8400查看dubbo控制臺
          posted on 2015-08-29 20:09 abin 閱讀(4368) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 普宁市| 桂林市| 炎陵县| 洛浦县| 迁安市| 确山县| 墨玉县| 祁东县| 舞阳县| 台湾省| 方城县| 张掖市| 永安市| 柳州市| 寻甸| 通许县| 新邵县| 永善县| 深泽县| 普陀区| 饶阳县| 盘锦市| 大同县| 义乌市| 麦盖提县| 汽车| 册亨县| 夏津县| 天镇县| 纳雍县| 杨浦区| 朝阳区| 肇庆市| 翼城县| 萍乡市| 遵义市| 临漳县| 吉林市| 文昌市| 巧家县| 柞水县|