You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by nick <sz...@163.com> on 2013/11/28 10:45:10 UTC

Activemq ajax project( activemq-web-demo) does not support load balance?

I had deployed the activemq-web-demo project in tow tomcat.

   atomcat ip and port is 192.168.18.244:8080;
   btomcat ip and port is 192.168.18.244:8081;

   I opend the url http://192.168.18.244:8080/activemq-web-demo/chat.html by
chrome.
     open   the url http://192.168.18.244:8081/activemq-web-demo/chat.html
by ie.

  its all goes well. 

  then i configured in my nginx.conf like this.
   
           *upstream www.jamenke.com{
                  server 192.168.18.244:8081;
           }*
   ...
           location  / {
            root   html;
            index  index.html index.htm;
            proxy_pass   http://www.jamenke.com;
            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;
        }
   
   I opend the url http://192.168.18.244/activemq-web-demo/chat.html by
chrome and ie.
   It goes well too. 

   at last. I add configured nginx.conf like this:
              *upstream www.jamenke.com{
                  server 192.168.18.244:8081;
                  /server 192.168.18.244:8080;  # add this line/ 
           }*
   and restart nginx.
    I opend the url http://192.168.18.244/activemq-web-demo/chat.html by
chrome and ie.
    I found it cannot recieve messages.
    
<http://activemq.2283324.n4.nabble.com/file/n4674904/20131128173955.png> 

    *can anyone tell me , it does not support load balance? If it support,
how can i do .*

   Thanks, Best Regards
   
   Nick.
   

   

      



  



--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-ajax-project-activemq-web-demo-does-not-support-load-balance-tp4674904.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Activemq ajax project( activemq-web-demo) does not support load balance?

Posted by nick <sz...@163.com>.
I had solved this problem. 
  
   the activemq ajax message was based on session and clientId.
 
so i use chrome console watch network. i found amq request once on atomcat,
once on btomcat., once on atomcat ...... 
   
   so i add *ip_hash;* and restart nginx. it goes well. 

upstream www.jamenke.com{ 
                  *ip_hash;* 
                  server 192.168.18.244:8081; 
                  server 192.168.18.244:8080;  # add this line  
           }


  



--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-ajax-project-activemq-web-demo-does-not-support-load-balance-tp4674904p4674942.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.