What port have you configured your memcached client to connect to?
If it’s the standard memcached port 11211 (or another custom port - i.e. anything not11210 then you’ll be connecting to the Couchbase cluster via the moxi memcached proxy. Moxi will return stats from the Couchbase Server in the original form, which at a guess is not in the format that the legacy memcached client expects.
While Couchbase Server does support using vanilla memcached clients for normal Key/Value operations, you may want to use a native client to take full advantage of Couchbase Servers’ capabilities. See the Deployment Strategies page for more details.
I am connecting to Couchbase via 11212, so it via the moxi memcached proxy.
I tried to change the Couchbase’s memcached bucket port to 11210, but it gave me port in use error…
nestat tell me memcached is listen to the port 11210, but when I kill the memcached process, Couchbase server becomes down and pending.
So I guess the port 11210 is always listen by Couchbase?
I tried to connect the port 11210 with Memcached, but the connection cannot be made.
With telnet I could connect to the port, but using stats command it just frozen.
And what are the Native Client? Do you mean using the Couchbase PHP SDK?
I tried do:
$cbc = new \CouchbaseCluster(“http://localhost:11212”);
$bucket = $cbc->openBucket(‘My-Bucket’);
It gave me:
ErrorException [ Fatal Error ]:
Uncaught exception ‘Fuel\Core\PhpErrorException’ with message ‘file([CouchbaseNative]/CouchbaseBucket.class.php): failed to open stream: No such file or directory’
Yes, port 11210 is the standard Couchbase port for SASL-authenticated buckets. You will need to use a smart SDK (e.g. PDP SDK 2.0) to access Couchbase on that port.
I tried both port 11210 and 11212 with the above code, but I still get the same exception fail on openBucket:
Uncaught exception ‘Fuel\Core\PhpErrorException’ with message ‘file([CouchbaseNative]/CouchbaseBucket.class.php): failed to open stream: No such file or directory’ in /home/ec2-user/webapps/rest_api/fuel/core/classes/debug.php:324
By the way, I just notice I could connect to the defined memcached bucket ‘My-Bucket’ with port 8091 instead of either 11210 and 11212. Even though the memcached bucket port is configured as 11212.
Bucket Settings
Bucket Type: Memcached
Access Control: Dedicated port (supports ASCII portocol and is auth-less) Protocol port: 11212
But I guess I am not connecting to the memcached bucket in the right way you mentioned.
When using smart SDK (e.g. PHP SDK) Couchbase’s memcached bucket uses 8091 (Nothing to do with the port I assigned)
When using vanilla memcached clients I have to connect via Moxi Memcached Proxy (with the port I assigned to the memcached bucket). And since 11210 is not available or reachable, so I guess no way for getStats() works for vanilla memcached clients?