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

Key mapping issue

9 replies [Last post]
  • Login or register to post comments
Sun, 02/13/2011 - 01:46
Tom
Offline
Joined: 06/07/2010
Groups: None

Hi,

I'm having a problem with my membase server.
When I use just a single server - everything is fine.
When I add a second server (to the cluster) it seems the the key-server mapping malfunctions. I.e. keys are being saved (I can see the keys in the membase web console), but if I try to get the values of those keys I get a response that they don't exist. My guess is that the key may be saved on server#1 and when I try to get it my client (Enyim) tries to get it from server#2.

I'm using the Enyim client for ASP.Net/C#, my Membase servers are installed on fedora machines.

Is this a known problem?
Is there a know solution?

Thanks in advance,
Tom.

Top
  • Login or register to post comments
Mon, 02/14/2011 - 11:05
perry
Offline
Joined: 10/11/2010
Groups:

 Hi Tom, can you paste the Membase config section from your App.config?

 

Also, what version of Enyim and Membase are you using?  Lastly, are you using a Membase bucket or memcached bucket?

 

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
Tue, 02/15/2011 - 01:52
Tom
Offline
Joined: 06/07/2010
Groups: None

Hi Perry,

My Membase version is 1.6.5.
My Enyim client version is 2.11.
I'm using a disk bucket.


I don't use an app.config/web.config, instead, I use a programatic configuration.
Here's the code:



private static readonly Dictionary<string, MembaseClient> MembaseClients = new Dictionary<string, MembaseClient>();

private static void TryStartCacheIfNotStarted(string bucketName)
{
    if (MembaseClients.ContainsKey(bucketName) && MembaseClients[bucketName] != null)
        return;

    string memcachedUris = ConfigurationManager.AppSettings["MemcachedUri"];

    if (string.IsNullOrEmpty(memcachedUris))
    {
        throw new ApplicationException("Failed to read MemcachedUri from the config file");
    }

    MembaseClientConfiguration clientConfiguration = new MembaseClientConfiguration();
    clientConfiguration.SocketPool.MaxPoolSize = 20;
    clientConfiguration.BucketPassword = string.Empty;
    clientConfiguration.Bucket = bucketName;

    foreach (var memcachedUri in memcachedUris.Split(','))
    {
        clientConfiguration.Urls.Add(new Uri(memcachedUri));
    }

    try
    {
        MembaseClients[bucketName] = new MembaseClient(clientConfiguration);
    }
    catch (Exception e)
    {
        throw new ApplicationException("Failed to create a memcached client", e);
    }
}

 

 

Notes:

The value of "MemcachedUri" is "http://[server ip]:8091/pools/default/", where [server ip] is my membase server's ip (it can obviously be a comma delimited list of URIs). I use this URL regardless of the bucket's name. Is that the correct way? (It's not that clear from the documentation here)

 

Thank you.

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

 Tom, 

 

You are correct about the URL and from what I can tell this "should" all be working fine.

 

There are a few other things to look at...what exactly do you get back when accessing a key that's having a problem?  Does it appear as a "miss" or do you get an actual error back?

 

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
Wed, 02/16/2011 - 00:14
Tom
Offline
Joined: 06/07/2010
Groups: None

I get a miss.

Top
  • Login or register to post comments
Wed, 02/16/2011 - 11:42
perry
Offline
Joined: 10/11/2010
Groups:

 And you can confirm that the initial store operation succeeds properly?  You can verify that the item count increases on the Membase side (in the correct bucket, etc?)

 

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
Thu, 02/17/2011 - 00:43
Tom
Offline
Joined: 06/07/2010
Groups: None

I'll describe what I've tested:
I wrote a couple of dosens of tests, and they all pass (saving/reading/deleting keys).

I have some code in my web app that saves a lot of keys to a membase bucket, and I can see the keys' names in the web console.

I wrote some code in a console app that tries to get those keys and the result I'm getting is that the keys don't exist. I did not put a time limit on those keys, so they should be persisted to disk, and thus available.

If I only use a single membase server - it all works fine. When I add a second membase server these keys become unavailable. Also, other features in the app relying on the membase bucket are not working properly. But I've not been able to reproduce the problem in an automated test.

 

Tom.

Top
  • Login or register to post comments
Sun, 02/20/2011 - 14:36
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None
  1. 1. Did you rebalance the servers after adding the second node?
  2. 2. If you start with a 2 node configuration, can you add then retrieve the keys?
  3. 3. Also, can you give some sample keys which have disappeared? (So the node selector algorithm can be checked)
Top
  • Login or register to post comments
Mon, 02/21/2011 - 01:02
Tom
Offline
Joined: 06/07/2010
Groups: None

Hi Attila,

1. I did rebalance the servers after adding the second node.

2. I'm not sure I understood. What does "start" mean? Does it mean that there are no keys on the membase servers or does it mean without open connections to membase? Regarding the former - I haven't tried that (I can try and recreate that scenario in my debug environment, would that help?). If it's the latter then yes (I sometimes reset my IIS servers, though not all at the same time, for obvious reasons).

3. Here are some sample keys I use:
ad_count_20110221_837_3_99
ad_count_20110221_108_1_35
ad_count_20110221_108_254_15
ad_count_20110221_848_325_84
ad_count_20110221_108_256_130

Thank you!
Tom.

Top
  • Login or register to post comments
Mon, 02/21/2011 - 03:39
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None

 I meant that recreate the scenerio where you store and try to retrieve the items but with a 2 node configuration. If this works then the node selection algrithm works, and the issue lies somewhere else.

Also, can you please reproduce the issue with the initial setings (moving from 1 server to 2), but with debug logging enabled?

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