1

I have memcached cluster with couchbase. For balancing using HAProxy. But have problem with check health.

For check is good following request:

curl -v http://10.0.110.1:8091/pools/default/buckets/default/nodes/10.0.110.1%3A8091/stats

Response is 200 or 404.

In HAProxy:

option httpchk GET /pools/default/buckets/default/nodes/10.0.110.1%3A8091/stats
  server memcached1 10.0.110.1:11211 check inter 3s port 8091
  server memcached2 10.0.110.2:11211 check inter 3s port 8091
  server memcached3 10.0.110.3:11211 check inter 3s port 8091

Problem with "/pools/default/buckets/default/nodes/10.0.110.1%3A8091/stats". How add variable IP of hosts.

Maybe use a variable "dst". But did not work for me:

option httpchk GET /pools/default/buckets/default/nodes/%25%5Bdst%5D%3A8091/stats

Please help me with this issue.

artful
  • 31
  • 1
  • 7

1 Answers1

1

Why not just install Couchbase's Moxi (memcached proxy) on each application server node pointed at Couchbase buckets? Then you get all of the HA features of Couchbase, but do not need to modify your application code? And no need for HAProxy either. Moxi will on your behalf use the power of Couchbase's sharding to distribute the data evenly too.

Kirk
  • 206
  • 1
  • 3
  • I use Couchbase. Now I have 3 nodes in cluster. My app connect to one of these nodes. But when this node down the system becomes inoperable. I decided to use HAProxy for fault tolerance. But in situation when one node from cluster been not reachable - start auto-failover. When it come back, cluster not use this node, but HAProxy check the port and mark as operable and forward traffic to it. After that all work bad. Maybe I missed something about couchbase? – artful Aug 12 '16 at 18:48
  • Moxi is a Couchbase tool. You do not need HAProxy. You need Moxi plus Couchbase with Couchbase buckets, not memcached buckets. Moxi will proxy your memcache calls to Couchbase and balance them. This is exactly what it does. You can download Moxi from the Couchbase Web site. – Kirk Aug 13 '16 at 22:25
  • 1
    Yeah! That's working great! Thank you very much! :) – artful Aug 16 '16 at 19:15