3

I'm working on setting up a MongoDB replica set on EC2. I'd like to configure auto-sharding such that my nodes can easily come up and down.

Is it possible to use the native PHP driver to trigger sharding and add/remove nodes? If so, how?

4

1 に答える 1

4

Assuming you have your connection to mongos right, you can use the MongoDB::command() method for that:

$mongo->selectDB('admin')->command(array('addshard'=>'hostname:port'));
于 2011-06-18T17:22:56.213 に答える