PHP and client side moxi
Hi all,
I'm trying to use a client side moxi to connect to a cluster with PHP, but it doesn't seem to work. I am connecting fine to the servers individually by using the following code:
$couch = @(new Couchbase( 'serverX:8091' ] ));
I am trying to connect to the local moxy by using this:
$couch = @(new Couchbase('localhost:11211' ));
It doesn't seem to work. The moxi is listening locally, but when I telnet into it on port 11211 I get disconnected straight away:
telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
Also, I tried to connect to the remote servers on ports 11210 or 11211 to the default bucket and it doesn't work. Am I missing something here?
I'm using the latest enterprise version 1.8.1
You don't need to use client side moxi with the php client. The reason that we have moxi is for clients that don't know what the cluster topology looks like. This means if you have an existing application that uses memcached and that application doesn't use one of the Couchbase supported SDK's then it likely needs moxi to help forward requests.
The Couchbase clients on the other hand take care of this for you by communicating with the cluster so that it can understand the cluster topology. You should just connect to one of your servers with the first example you have posted and the client will properly route requests and also see when nodes are added and removed.