rmongodb icon indicating copy to clipboard operation
rmongodb copied to clipboard

Can't connect to multiple servers

Open Make42 opened this issue 9 years ago • 1 comments

Creating a mongoDB connection can only be done to one server with

  mongo <- mongo.create(host = "myserver1:27017")

and not multiple servers like

  mongo <- mongo.create(host = "myserver1:27017, myserver2:27017, myserver3:27017")
  # or alternatively:
  mongo <- mongo.create(host = c("myserver1:27017", "myserver2:27017", "myserver3:27017"))

however for mongoDB it is necessary, to connect to the master node, which is switching from time to time. Therefore I would like to have two features implemented:

1 It should be possible to set multiple servers and rmongodb is looking autonomously which one is the master. 2 It should be possible to set the setting

  slave = "ok"

for those use-cases in which rmongodb only reads. This feature would allow to read from a slave node (writing to a slave is not possible for mongoDB), and would reduce the load on the master node.

Make42 avatar Jun 17 '15 07:06 Make42

Last code chunk should work. Please, check this SO thread. If not, let me know.

dselivanov avatar Jun 20 '15 10:06 dselivanov