How can PHP connect Membase via SASL on port 11211
Hello everybody! I've set Membase listening on port 11211(SASL required) and now I can't no longer telnet it with error message "SERVER_ERROR unauthorized, null bucket" while I attempt to set a record.
Actually, I used to visit Memcached with PHP code as below:
$memcache = new Memcache;
$memcache->connect('192.168.37.230', 11211);
But now, I want to visit Membase which listens on 11211 which provides SASL authen. . Could anybody tell me how to write the PHP code with SASL? Thanks~!
Thank you Perry for your quick responce!
I'm using pecl-memcached and I just don't know how I can use it to connect membase with SASL. I can't use the following instuctions any longer if the bucket set be of SASL.
$memcache = new Memcache;
$memcache->connect('192.168.37.230', 11211);
Could you kindly tell me how I write the instuctons with pecl-memcached to connected membase with SASL? Thanks~!
I'm still googling around a bit, apparently it's not so easy to find ;-)
I did find this post: http://pecl.php.net/bugs/bug.php?id=17149. At the bottom, he says he tested it with the NorthScale Memcached server which is the name of our product from last year so we know it's possible and in fact works the same way in the current Membase.
I'll post back if/when I find more specific examples but you might consider posting something to the pecl-memcached mailing list.
Perry
Thank you, Perry!
I write a pure PHP Memcached class with SASL support in https://github.com/ronnywang/PHPMemcacheSASL
You can use this
Tom, some PHP memcache drivers support SASL while others do not. Can you tell me which specific driver you're using?
I believe the pecl-memcached one does support SASL, so it might be worth trying that out.
You also don't "have" to use SASL auth here. If you just set that bucket to live on a different point (11212 for example) you can setup your client to connect to it:
$memcache = new Memcache;
$memcache->connect('192.168.37.230', 11212);
You may also want to take a look at setting up a client-side Moxi process (http://www.couchbase.org/wiki/display/membase/Moxi) which can be very beneficial for a PHP deployment and also gives you some more flexibility on connecting to a specific bucket. For example, you can password protect the bucket from within the Membase cluster but then setup a client-side Moxi to provide a no-authentication connection.
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!