带有websockets和http的apache mod_proxy集群

时间:2015-03-12 04:32:12

标签: apache http websocket cluster-computing mod-proxy

我有

  1. apache 2.4.10 192.168.0.10
  2. jboss8 node1 192.168.0.20 - 在域模式下
  3. jboss8 node2 192.168.0.21 - 处于从属模式 -
  4. 我尝试使用http和websocket连接通过mod_proxy http://192.168.0.10/myapp创建集群

    <VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/html/cluster1
    ServerName 192.168.0.10
    ErrorLog logs/cluster1_log_error
    CustomLog logs/cluster1_log_comm common
    TransferLog logs/cluster1_log_trans
    
    Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
    <Proxy balancer://jboss>
        BalancerMember   ws://192.168.0.21:8080 route=2
        BalancerMember http://192.168.0.21:8080 route=2
        BalancerMember   ws://192.168.0.20:8080 route=1
        BalancerMember http://192.168.0.20:8080 route=1
        ProxySet  stickysession=ROUTEID
        ProxySet nofailover=off
    </Proxy>
    ProxyPreserveHost On
    ProxyRequests Off
    
    ProxyPass /myapp balancer://jboss/myapp
    ProxyPassReverse /myapp balancer://jboss/myapp
    
    
    <Location /mcm>
        SetHandler balancer-manager
    </Location>
    

    但如果我通过平衡器管理器禁用jboss2的工作者ws和http - 流量仍然发送到节点

    怎么做对了? 两个平衡器? 一个平衡器? 我需要帮助

0 个答案:

没有答案