How to configure MongoDB using PHP?

I am working on configuring MongoDB replica on EC2. I would like to adjust the automatic shape so that my nodes can easily rise and fall.

Can I use my own PHP driver to start sharding and add / remove nodes? If so, how?

+3
source share
1 answer

Assuming you connected correctly mongos, you can use the MongoDB :: command () method :

$mongo->selectDB('admin')->command(array('addshard'=>'hostname:port'));
+4
source

All Articles