1

I've got a group of servers that currently use both memcached and repcached side by side (listening on different ports). The memcached service is used to store local data that doesn't need to be shared. The repcached instance is used to allow pairs of servers to collaborate.

When I found Couchbase I was really excited because it looks like it would allow me to:

  1. Make some data persistent
  2. Share with more than two nodes
  3. Leave most of my code as-is since it uses the memcached API

So I installed Couchbase but I've run into a problem--it doesn't look like there's a way to setup two clusters on the same server. I'd like one cluster that doesn't share with any other server and a second cluster that does share with other servers.

Yes, I could setup several dedicated servers for Couchbase to create different clusters but I've got plenty of CPU + ram to spare on the servers that are currently running memcached + repcached so I'd prefer to just replace those services with Couchbase.

Is it possible to run two instances of Couchbase on the same host? I realize I'd have to change some ports around. I just haven't seen anyone talking about doing anything like this so I'm thinking the answer is "no"... but I had to ask because it looks like Couchbase would be perfect for my needs.

If this won't work then I'd be interested in any alternative suggestions. For example, one idea I had was using Memcached + MemcacheDB to emulate a persistent non-shared Couchbase cluster. However, I don't like the fact that MemcacheDB doesn't support expiring records and I'd rather not have to write a routine to delete millions of records each month (and then wonder if performance will degrade over time).

Any thoughts would be appreciated. :-)

Kuf
  • 17,318
  • 6
  • 67
  • 91
Jeremy
  • 214
  • 2
  • 8

1 Answers1

2

The best solution here is probably to run a single instance of Couchbase and create one memcached bucket and one Couchbase bucket. The memcached bucket won't have persistence and will function exactly like memcached. The other bucket will have persistence and supports the memcached api. You can create as many buckets as you want in a single Couchbase server.

Your other option is to virtualize and run a Couchbase server on each vm.

mikewied
  • 5,273
  • 1
  • 20
  • 32
  • Thanks for taking a moment to share your thoughts. When you say that the memcached bucket "will function exactly like memcached" are you saying that it won't span across entire cluster? The idea of running a second Couchbase server on a separate vm is something I had thought of too but was hoping for a simpler solution. – Jeremy Jun 01 '12 at 17:21
  • 2
    The memcached buckets don't provide replication if that's what your asking. They will span across the entire cluster though so if you add another server to your cluster it will add more memory to your memcached bucket. For example, if you have 3 servers with one memcached bucket that is 2GB in size then your cluster will have 6GB available for that bucket. If you add another server then your cluster will have 8GB available. Also, if you use the Couchbase SDK's the clients will recognize that another server has been added an immediately begin using it. – mikewied Jun 03 '12 at 04:46