BUNNY: How can we connect to RMQ cluster

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

BUNNY: How can we connect to RMQ cluster

Loganathan Sellapa
Hi All,

I have two RMQ servers such as R1 & R1 and both are running in cluster setup.  I want to connect to R2 if R1 is down and vice versa , what is the way to achieve it in bunny gem?


regards,
Loganathan
Mob: +91 7760780741 | +91 9944414388
Skype: loganathan.sellappa
ViewMe


_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BUNNY: How can we connect to RMQ cluster

Michael Klishin-4
 On 12 August 2014 at 18:10:20, Loganathan Sellapa ([hidden email]) wrote:
> > I have two RMQ servers such as R1 & R1 and both are running in cluster  
> setup. I want to connect to R2 if R1 is down and vice versa , what  
> is the way to achieve it in bunny gem?

Most people stick an HAproxy in front of the nodes and point clients to it.

That said, it should be fairly trivial to pick a host from a list in Bunny like
you already can do in the Java client, I'll look into adding it.
--  
MK  

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BUNNY: How can we connect to RMQ cluster

Loganathan Sellapa
Hi Michael,

Thanks is their any patch available for this feature, or is it a good way to make connection with one node and switch to other  one if we get an connection error?

Regards,
Loganathan

On Wednesday, 13 August 2014 09:58:15 UTC+5:30, Michael Klishin wrote:
 On 12 August 2014 at 18:10:20, Loganathan Sellapa (<a href="javascript:" target="_blank" gdf-obfuscated-mailto="bImo1qbhuMwJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">logana...@...) wrote:
> > I have two RMQ servers such as R1 & R1 and both are running in cluster  
> setup. I want to connect to R2 if R1 is down and vice versa , what  
> is the way to achieve it in bunny gem?

Most people stick an HAproxy in front of the nodes and point clients to it.

That said, it should be fairly trivial to pick a host from a list in Bunny like
you already can do in the Java client, I'll look into adding it.
--  
MK  

Staff Software Engineer, Pivotal/RabbitMQ

_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Michael Klishin-4


On 19 August 2014 at 14:38:37, Loganathan Sellappa ([hidden email]) wrote:
> > Thanks is their any patch available for this feature, or is it
> a good way to make connection with one node and switch to other
> one if we get an connection error?

Like I said before, it is common to use a proxy in front of your cluster
but you can try master:

https://github.com/ruby-amqp/bunny/pull/234/files
https://github.com/ruby-amqp/bunny/commit/091696492de801505943a70320c338ebb63dba30
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Loganathan Sellapa
HI Michael,

Thanks I will try this out.

regards,
Loganathan
Mob: +91 7760780741 | +91 9944414388
Skype: loganathan.sellappa
ViewMe



On Tue, Aug 19, 2014 at 4:15 PM, Michael Klishin <[hidden email]> wrote:


On 19 August 2014 at 14:38:37, Loganathan Sellappa ([hidden email]) wrote:
> > Thanks is their any patch available for this feature, or is it
> a good way to make connection with one node and switch to other
> one if we get an connection error?

Like I said before, it is common to use a proxy in front of your cluster
but you can try master:

https://github.com/ruby-amqp/bunny/pull/234/files
https://github.com/ruby-amqp/bunny/commit/091696492de801505943a70320c338ebb63dba30
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Loganathan Sellapa
Hi Michael,

I have updated the bunny gem to 1.4.0(also with master branch) and then updated the RMQ settings with two hosts h1 & h2 provided with SSL certificates which is valid for h2 only, latter I tried to make the connection , but getting the below error. Ideally it should work for the second host(d1p500tlm-prxs-podrmq-a-cert.vmware.com), can you let me know what I am doing wrong here, for your reference listed the rmq settings

SETTING1:

RMQ SETTING:

production:
  <<: *defaults
  rmq_settings:
    port: 5671
    vhost: vchs
    auth_mechanism: EXTERNAL
    tls: true
    tls_cert: /home/logan/git/presto/ssl/server/cert.pem
    tls_key: /home/logan/git/presto/ssl/server/key.pem
    tls_ca_certificates: ["/home/logan/git/presto/ssl/ca/ca-chain.pem"]
    verify_peer: true

GEMFILE:
 gem 'bunny', "1.4.0"

ERROR:

Bunny::TCPConnectionFailed: Could not establish TCP connection to ["D1P310TLM-PRXS-PODRMQ-A-CERT.VCHSLABS.COM", "d1p500tlm-prxs-podrmq-a-cert.vmware.com"]:5671: 


SETTING2:

RMQ SETTING:
production:
  <<: *defaults
  rmq_settings:
    port: 5671
    vhost: vchs
    auth_mechanism: EXTERNAL
    tls: true
    tls_cert: /home/logan/git/presto/ssl/server/cert.pem
    tls_key: /home/logan/git/presto/ssl/server/key.pem
    tls_ca_certificates: ["/home/logan/git/presto/ssl/ca/ca-chain.pem"]
    verify_peer: true

GEMFILE:
 gem 'bunny', :git => 'https://github.com/ruby-amqp/bunny.git', branch: "master"

ERROR:

Bunny::TCPConnectionFailed: Could not establish TCP connection to ["D1P310TLM-PRXS-PODRMQ-A-CERT.VCHSLABS.COM", "d1p500tlm-prxs-podrmq-a-cert.vmware.com"]:5671: 


SETTING3: (Working perfectly)

production:
  <<: *defaults
  rmq_settings:
    port: 5671
    vhost: vchs
    auth_mechanism: EXTERNAL
    tls: true
    tls_cert: /home/logan/git/presto/ssl/server/cert.pem
    tls_key: /home/logan/git/presto/ssl/server/key.pem
    tls_ca_certificates: ["/home/logan/git/presto/ssl/ca/ca-chain.pem"]
    verify_peer: true


regards,
Loganathan
Mob: +91 7760780741 | +91 9944414388
Skype: loganathan.sellappa
ViewMe



On Tue, Aug 19, 2014 at 4:19 PM, Loganathan Sellapa <[hidden email]> wrote:
HI Michael,

Thanks I will try this out.

regards,
Loganathan
Mob: <a href="tel:%2B91%207760780741" value="+917760780741" target="_blank">+91 7760780741 | <a href="tel:%2B91%209944414388" value="+919944414388" target="_blank">+91 9944414388
Skype: loganathan.sellappa
ViewMe



On Tue, Aug 19, 2014 at 4:15 PM, Michael Klishin <[hidden email]> wrote:


On 19 August 2014 at 14:38:37, Loganathan Sellappa ([hidden email]) wrote:
> > Thanks is their any patch available for this feature, or is it
> a good way to make connection with one node and switch to other
> one if we get an connection error?

Like I said before, it is common to use a proxy in front of your cluster
but you can try master:

https://github.com/ruby-amqp/bunny/pull/234/files
https://github.com/ruby-amqp/bunny/commit/091696492de801505943a70320c338ebb63dba30
--
MK

Staff Software Engineer, Pivotal/RabbitMQ



_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Michael Klishin-4
On 20 August 2014 at 11:40:07, Loganathan Sellapa ([hidden email]) wrote:
> > host: […]  

It should be :hosts, not :host. :host works just like before. 
--  
MK  

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Loganathan Sellapa
Hi Michael,

Thanks, but still I am not able to connect to the RMQ whenever I provide some invalid hosts like below, the reason for this kind of testing is my RMQ VM itself may gets down sometime in that case I want to pick the valid one.

production:
  <<: *defaults
  rmq_settings:
    hosts: ["d1p500tlm-prxs-podrmq-a-cert.vchslabs.cqom","invalid.vchslabs.cowwwm","invalid.coswaqqwm", "d1p500tlm-prxs-podrmq-a-cert.vchslabs.com","D1P310TLM-PRXS-PODRMQ-A-CERT.VCHSLABS.COM"]
    port: 5671
    vhost: vchs
    auth_mechanism: EXTERNAL
    automatic_recovery: true
    tls: true
    tls_cert: /home/logan/git/presto/ssl/server/cert.pem
    tls_key: /home/logan/git/presto/ssl/server/key.pem
    tls_ca_certificates: ["/home/logan/git/presto/ssl/ca/ca-chain.pem"]
    verify_peer: true



Bunny::TCPConnectionFailed: Could not establish TCP connection to d1p500tlm-prxs-podrmq-a-cert.vchslabs.cqom:5671:




regards,
Loganathan
Mob: <a href="tel:%2B91%207760780741" value="+917760780741" target="_blank">+91 7760780741 | <a href="tel:%2B91%209944414388" value="+919944414388" target="_blank">+91 9944414388
Skype: loganathan.sellappa
ViewMe



On Wed, Aug 20, 2014 at 1:33 PM, Michael Klishin <[hidden email]> wrote:
On 20 August 2014 at 11:40:07, Loganathan Sellapa ([hidden email]) wrote:
> > host: […]

It should be :hosts, not :host. :host works just like before. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Michael Klishin-4
 On 20 August 2014 at 12:21:58, Loganathan Sellapa ([hidden email]) wrote:
> > Bunny::TCPConnectionFailed: Could not establish TCP connection  
> to …:  

Bunny does not recover from initial failures, however, this is trivial to
do yourself:

begin
  connect
rescue Bunny::TCPConnectionFailed => _
  sleep 5
  retry
end

or something like that. Can you try that? This feature is certainly pretty
simplistic at the moment but I expect things to work for recovery (which
handles failed connection attempts).
--  
MK  

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Loganathan Sellapa
HI Michael,

Thanks, it works.

regards,
Loganathan
Mob: +91 7760780741 | +91 9944414388
Skype: loganathan.sellappa
ViewMe



On Wed, Aug 20, 2014 at 1:58 PM, Michael Klishin <[hidden email]> wrote:
 On 20 August 2014 at 12:21:58, Loganathan Sellapa ([hidden email]) wrote:
> > Bunny::TCPConnectionFailed: Could not establish TCP connection
> to …:

Bunny does not recover from initial failures, however, this is trivial to
do yourself:

begin
  connect
rescue Bunny::TCPConnectionFailed => _
  sleep 5
  retry
end

or something like that. Can you try that? This feature is certainly pretty
simplistic at the moment but I expect things to work for recovery (which
handles failed connection attempts).
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ruby-amqp] Re: BUNNY: How can we connect to RMQ cluster

Michael Klishin-4


On 20 August 2014 at 12:52:04, Loganathan Sellapa ([hidden email]) wrote:
> > Thanks, it works.

Excellent. I'll consider adding an option for reconnecting on initial
connect, unfortunately, this feature makes detecting misconfigurations
harder.

But worth considering for sure.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
please subscribe to the new list!

[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Loading...