Closed pulse00 closed 9 years ago
You can pass multiple connection points encapsulated within the DisqueURI. There is only one connection at a time, the hosts are used as HA failover hosts. If a connection goes down, another host is used for reconnect. I'm open for discussion how to balance load amongst different hosts from the client perspective. Use the scheme disque://[password@]host[:port][,host2[:port2]][,hostN[:port2N]] to specify multiple hosts.
Robert Gründler notifications@github.com schrieb am Fr., 21. Aug. 2015 um 13:30:
Is it possible to connect to more than one node? We'd like to run a cluster of disque nodes, and currently it looks like we can only pass a single URI to the DisqueClient.
— Reply to this email directly or view it on GitHub https://github.com/mp911de/spinach/issues/7.
Alright, we'll give that a try. Thanks a lot for the fast response.
I've tried the following setup:
disque://192.168.205.10:7711,192.168.205.10:7712
disque -p 7711 cluster meet 127.0.0.1 7712
)When start the application, the client seems to connect to the first node running on 7711
. Now when i stop that node, i'm seeing this in the logs:
2015-08-21 16:18:09.239 DEBUG c.l.redis.protocol.ConnectionWatchdog : Reconnecting, last destination was /192.168.205.10:7711
2015-08-21 16:18:09.239 DEBUG c.l.redis.protocol.ConnectionWatchdog : Cannot connect: java.net.ConnectException: Connection refused: /192.168.205.10:7711
2015-08-21 16:18:09.239 DEBUG c.l.redis.protocol.ConnectionWatchdog : scheduleReconnect()
The client seems to try to reconnect to the same node over and over, without ever trying the 2nd node. Is there anything we might configure additionally to the disque uri?
You've done everything right. I'll label the issue as bug then.
Robert Gründler notifications@github.com schrieb am Fr., 21. Aug. 2015 um 16:23:
I've tried the following setup:
- 2 Nodes running in a vagrant box on different ports
- The client has been setup with the URI disque://192.168.205.10:7711, 192.168.205.10:7712
- The 2 nodes run clustered (disque -p 7711 cluster meet 127.0.0.1 7712 )
When start the application, the client seems to connect to the first node running on 7711. Now when i stop that node, i'm seeing this in the logs:
2015-08-21 16:18:09.239 DEBUG c.l.redis.protocol.ConnectionWatchdog : Reconnecting, last destination was /192.168.205.10:7711 2015-08-21 16:18:09.239 DEBUG c.l.redis.protocol.ConnectionWatchdog : Cannot connect: java.net.ConnectException: Connection refused: /192.168.205.10:7711 2015-08-21 16:18:09.239 DEBUG c.l.redis.protocol.ConnectionWatchdog : scheduleReconnect()
The client seems to try to reconnect to the same node over and over, without ever trying the 2nd node. Is there anything we might configure additionally to the disque uri?
— Reply to this email directly or view it on GitHub https://github.com/mp911de/spinach/issues/7#issuecomment-133441147.
Thanks. Let me know if i can provide more details to help debugging.
Fixed, uploaded spinach-0.2-SNAPSHOT to https://oss.sonatype.org/content/repositories/snapshots/. Please retest.
Great, that fixed it. Failover works now, thanks a lot!
Is there another release planned in the near future, or should we stick to the SNAPSHOT
repo?
It depends on how you define near future. I need to implement https://github.com/mp911de/spinach/issues/5 to publish a 0.2 release. I'm targeting Sep 7 for releasing 0.2 unless some blocker bugs cross the way. Feedback appreciated.
Great, thanks for the info.
Would creating a minor release be much of a hassle for you? We're working on an apache-camel component which uses spinach, and it would be great to have failover support.
Another question: Would you accept a PR implementing JMX support for spinach?
Ok, I'll release a 0.1.1 later this day.
What do you want to expose by JMX? I'm thinking a while about a statistics publisher to expose latencies and so forth. You can catch me on IRC (freenode) or Gitter (https://gitter.im/mp911de/lettuce) for a chat
@pulse00 Just released https://github.com/mp911de/spinach/releases/tag/0.1.1 Should be available on mvn central in a couple of hours
Superb, thanks!
Is it possible to connect to more than one node? We'd like to run a cluster of disque nodes, and currently it looks like we can only pass a single URI to the
DisqueClient
.