开发者

How can one configure MongoDB sharding using PHP?

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 trigge开发者_如何学编程r sharding and add/remove nodes? If so, how?


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'));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜