Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.6.x

Using Membase Client with a Membase Server w/bucket-type: Memcached

8 replies [Last post]
  • Login or register to post comments
Wed, 12/15/2010 - 07:39
Dark
Offline
Joined: 12/15/2010
Groups: None

Hi,

I've a Membase Community Server 1.6 (bucketname: default, buckettype: Memcached) on a 4-node cluster. All is fine when I connect to it using a standard .NET  Memcached client from any Enyim.Caching.dll version up to 2.7, but if I try to use the Membase Client (from Membase.dll v2.10) I always get a connection timeout.

My question is, is that the expected behaviour (can't use Membase Client with a bucket-type: Memcached) or there's something wrong in my config?

Here's the membase/relevant Web.config part:


    <configSections>
    <section name="membase" type="Membase.Configuration.MembaseClientSection, Membase" />
    </configSections>

  <membase>
    <servers bucket="default" userName="Administrator" password="password">
      <add uri="http://192.168.110.111:8091/pools/default" />
      <add uri="http://192.168.110.112:8091/pools/default" />
      <add uri="http://192.168.110.113:8091/pools/default" />
      <add uri="http://192.168.110.114:8091/pools/default" />
    </servers>
    <socketPool minPoolSize="10" maxPoolSize="200" connectionTimeout="00:00:10" deadTimeout="00:02:00"/>
    <locator type="Enyim.Caching.Memcached.DefaultNodeLocator, Enyim.Caching" />
  </membase>

The bucket name is "default", the bucket type is "memcached" (no replication): i also tried with a bucketPassword="" without results.

I also tried to check the http://192.168.110.111:8091/pools/default  using given credentials and it correctly retrieves the server interface data as a json string, so i guess it's reachable and working.

Any suggestion?
Thanks,

Top
  • Login or register to post comments
Wed, 12/15/2010 - 17:29
bhawana@membase
Offline
Joined: 10/29/2010
Groups: None

Hi,

Can you please paste the code snippet of how you access Membase from your client?

 

Thanks

Bhawana

 

__________________

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!

Top
  • Login or register to post comments
Wed, 12/15/2010 - 18:32
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None

 does your app pool identity have network access? how is your firewall configured?

Top
  • Login or register to post comments
Fri, 12/17/2010 - 08:38
Dark
Offline
Joined: 12/15/2010
Groups: None

Attila Kisko wrote:

 does your app pool identity have network access? how is your firewall configured?

Thanks for the answers. Yes, the app pool identity does indeed have network access.

Here's my code snippet:

string key="testKey";
string value = "testValue";

using (Membase.MembaseClient mc = new Membase.MembaseClient()) {

bool result = mc.Store(StoreMode.Set, key, value);

value = mc.Get(key);

}

The first operation hangs for like 10 secs then returns FALSE.

The second hangs for like 10 secs and then returns NULL (which might sound pretty obvious if you watch the code considering the fact that the corresponding Store() didn't work: but since I have full access to that same Membase Server with a standard enyim memcached client I also tried with a valid/present key... with the same NULL result. So I think I can say that both methods ain't working in my scenario ).

The configuration is exactly like stated in my previous post.

A thing i noticed is that if i remove (or modify) the userName/password part from the <servers> tag the two operations don't hang and immediatly returns their value: that makes me think that it's probably something subsequent to the client/server authentication part, which seems to succeed.

I also want to point out that the standard memcached client, with the app.config file configured accordingly (no buckets-aware config, with <enyim.com> sectionGroup, etc.) correctly works and I'm currently using it in my website with great results, so I don't think it can be a server problem.

I just don't know why the bucket-aware Membase client is not working....

 

Top
  • Login or register to post comments
Fri, 12/17/2010 - 10:12
Dark
Offline
Joined: 12/15/2010
Groups: None

Hi again,

I downloaded the source code of the Membase Client 2.10 and fully debugged my test application, and I finally think I've figured it out.

I'm trying to explain the situation so it can be helpful for other users too.

Basically, my 4 Membase Servers see each other using a dedicated 1GB LAN which has their own IP addresses/subnet mask:

ns_1@192.168.110.101
ns_1@192.168.110.102
ns_1@192.168.110.103
ns_1@192.168.110.104

My application can reach them using another LAN, which has different permissions and IP addresses:

192.168.120.101
192.168.120.102
192.168.120.103
192.168.120.104

While the standard memcached configuration allows the client to call directly the servers using the correct, allowed IP address (192.168.120.101:11211), the membase configuration seems to retrieve the internal cluster IP addresses, which in my scenario are intended to be behind-the-scene. I've seen this in the JSON result of the http://192.168.120.101:8091/pools/default call, which contains:

[...] "hostname":"192.168.110.101:8091" [...] "hostname":"192.168.110.102:8091" [...]  and so on.

Those "unauthorized" (in my scenario) IP addresses are placed in the endPoint of each MemcachedNode and then used to make the actual request: that's why the Socket initialized in the PooledSocket.cs class of Enyim.Caching.dll fails to initialize and the whole process timeouts.

I added a simple "ignoreServerHostnames" configuration property and modified the code to valorize the endPoint property of the MemcachedNodes with the IP used in the <servers> app.Config element, and now it seems to work. I can send you the small code changes if you're interested in implementing this feature and/or discuss the matter with you.

Anyway, thanks a lot for your support and keep up the great work, I've seen the whole code and found it brilliant.

Take care,

 

Top
  • Login or register to post comments
Fri, 12/17/2010 - 15:28
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None

 if you can submit your changes as a pull request on github then i can have a look at them.

on the other hand i think this is an issue which should be addressed by the membase team. why? because if i understand your description correctly you defined all your servers in the app.config and then you use that list instead of the one returned by the config server. and as soon as you add a new node to your cluster that node will appear in the configuration sent by the cluster, but you'll not recognize that you need to use a different IP address for it.

Top
  • Login or register to post comments
Fri, 12/17/2010 - 18:18
Dark
Offline
Joined: 12/15/2010
Groups: None

Attila Kisko wrote:
on the other hand i think this is an issue which should be addressed by the membase team.

 

You're absolutely right, I also consider it a mere workaround rather than a proper fix. A more accurate solution might be, for example, to pass that property value to the server and make it replace the hostname value in the actual response with the IP address used by the caller when it's set to TRUE.

That said, coming from a "memcached" scenario, it's fair to me to manually have to specify every single server cluster's node so I'm quite happy to got it solved.

I hope that this discussion will be useful for the Membase Server development team and for everyone who had encountered my same issue.

 Thank you for your time and keep up the great work!

Top
  • Login or register to post comments
Tue, 12/21/2010 - 11:15
perry
Offline
Joined: 10/11/2010
Groups:

 Attila/Dark, thanks so much for working through this.

 

Another workaround is to use the instructions listed on this page to force the Membase servers to identify themselves via a specific IP address: http://wiki.membase.org/display/membase/Using+Membase+in+the+Cloud

 

Let me know how that works out for you.

 

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!

Top
  • Login or register to post comments
Mon, 03/12/2012 - 08:47
thematxix17
Offline
Joined: 03/12/2012
Groups: None

Nice post for me , tnx ! viagra!

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker