Connecting to Membase Server using Membase Client
I realize there are many posts out there about the basics of connecting to a NS Server from the NS client. I have read through many of them and are still having some issues connecting to the server via the NS Client. The biggest “gotcha” that I found in our install is that we CAN telnet to port 11211, however, we CANNOT telnet to 11212 or 8080. The admin interface works just fine and we have configured a cluster of 3 servers with a bucket called “SessionManager”. What I have tried thus far is:
1) Using the base enyim client, try caching on port 11211
2) Using the base enyim client, try caching on port 11212
3) Using the NS Client, try caching on port 8080
All of these scenarios fail. The server and client do not throw exceptions. We just get a return from the client of ‘false’. We have tested our working code base against an existing Memcached installation and know the code is functional in that scenario.
We have configured Membase in the App.Config with the following configuration (I checked the base class in a watch variable while debugging to ensure it picked up our configuration).
[CODE]
[/CODE]
Our codecalling NS looks like this
[CODE]using (MembaseClient ClientInstance = new MembaseClient())
{
bool added = Client.Store(StoreMode.Add, cachekey, data);
if (!added)
{
throw new Exception("Could not add data");
}
}[/CODE]
Any advice you can give would be appreciated.
Michael, is it possible that you have the wrong username and password defined in the configuration? This is the username/pass for connecting to the admin interface of the UI. I believe there is an open issue with the client not properly reporting when this is incorrect, and I will follow up on that.
Additionally, you "should" be able to telnet to ports 11212 and 8080. If this is not possible, can you try telnetting to these ports from the local machine? If that works, then there is probably some firewall in play here preventing you from connecting. That will need to be resolved before you can use the current configuration.
Let me know how that goes.
Perry
Hi Perry, thanks for the reply. I have made sure that we are using the same username / password used to connect to the admin console (the UI at port 8080). I tried on the local machine with 127.0.0.1 and had the same results. I could telnet into port 11211, but no such luck for 11212 or 8080.
thx.
When you say that you can't telnet to those ports, do you get a connection refused or does it connect and then not do anything or does it timeout?
It connects, but when you type stat, it just kicks you out. If we do the same steps on the MCD port (11211) we get the stats repeated back to us.
So port 8080 should not return stats, that's just for our REST API. Port 11212 definitely should return stats however.
Looking at your code as well, I see that you're using the "Add" store mode. This should return false if the key already exists, is that possible here? What happens if you change "Add" to "Set"?
Gotcha, that clears up some confusion then. Regarding the add. We are using a guid for the key, so we should always be adding something rather than clashing with something already in cache.
Thanks Michael. Have you been able to get your code working properly now?
Perry
Well, our windows machine is still not working. We got a linux instance up which works better for us, and we are able to connect. It would be great to know what is going on just in case we ever see something like this again ... I suspect it has something to do with port 11212 not being open for telnet. Does the REST interface ever use port 11212 or does it go directly after the MCD port on 11211?
No, the REST interface shouldn't use port 11212. I'm also interested in the fact that you were able to connect on port 11212 but not get any stats output, would you mind sending a screenshot of that if the server is still up and running?
Michael, is it possible that you have the wrong username and password defined in the configuration? This is the username/pass for connecting to the admin interface of the UI. I believe there is an open issue with the client not properly reporting when this is incorrect, and I will follow up on that.
Additionally, you "should" be able to telnet to ports 11212 and 8080. If this is not possible, can you try telnetting to these ports from the local machine? If that works, then there is probably some firewall in play here preventing you from connecting. That will need to be resolved before you can use the current configuration.
Let me know how that goes.
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 Membase: http://www.membase.com/products-and-services/overview
Call or email "sales -at- membase -dot- com" today!