Client-Side Moxi -- configuration for cluster
Hi,
Can someone help clarify for me what I need to do in this situation:
-- I have set up a membase cluster (node1, node2 and node3) and now setting up moxi on client-side
Q1.
In my client's moxi configuration, I have made it so like this:
./moxi -Z port_listen=11311 http://node1:8091/pools/default/bucketsStreaming/default
Is it sufficient to just specify one node in this line, or should I also specify nodes 2 & 3 in the config?
I am asking because although it seems that the cluster is behaving well, I can't be sure if the bandwidth is being distributed among every node with the clients or just among themselves.
Q2.
I am trying out a reverse proxy configuration with nginx, just by simply passing all requests to port 8091 on nginx to all three nodes. Like so:
./moxi -Z port_listen=11311 http://proxy:8091/pools/default/bucketsStreaming/default
and on nginx:
upstream backend {
server node1:8091;
server node2:8091;
server node3:8091;
}
server {
server_name 127.0.0.1, 192.168.1.10, proxy.domain.com;
listen 8091;
location / {
proxy_pass http://backend;
}
}
I can get a connection when I do a test with curl or wget, but moxi doesn't seem to be 'seeing' the cluster if I do it this way.
Any hints on how I can fix this?
Thanks,
zaros
Hi Perry,
Thanks for the response.
For the first part, I think that's fine, thanks for the clarification and for the tip!
For the second part, I have tried the curl command, strangely the first few times I got a 404 Object Not Found error (this even happened on a localhost test, and netstat shows moxi is listening), and now every time I do get the JSON response. However, during this time it seemed from the servers' web interfaces that comms was working just fine. Probably just a hiccup somewhere, but just thought you should know.
I am not sure if nginx is closing the connection -- it could well have been, after I googled a bit -- but I will experiment further and hopefully get it all working.
I have the information I require now. Thanks again, much appreciated.
zaros
Zaros,
For your first question, it is sufficient to only configure Moxi with one address. It will use this REST interface to get the full topology (the vbucket map), and send the actual data requests directly to the individual nodes. Rest assured that the bandwidth/load is being distributed to all nodes. You can even see this via the UI if you look at the statistics for each node individually.
As a best practice, we recommend configuring Moxi with at least 2 of these addresses so that if the one node fails, Moxi will still be able to maintain a connection to the cluster. It will only use one at a time, and if that fails, round-robin through its list to find a working one.
Or, you can do what you're doing in question #2 and achieve the same results.
For question 2, what errors are you getting back from Moxi? Can you confirm that 'curl http://proxy:8091/pools/default/bucketStreaming/default' returns the appropriate JSON response with a vbucket map and also keeps the connection open? It is a "comet stream" that needs to maintain a constant connection, so perhaps the nginx is closing it? I'm not an expert there, but I know we have customers doing this successfully.
Perry
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!