4

I'm using Ubuntu 14.04, mongodb 2.6.3(current secondary) and 2.6.4(current primary).

I'm trying to enable authentication on an already running mongodb replicaset with 3 nodes of which 1 is arbiter.But I was unable to do that. Is it not possible to enable auth after initiating replicaset. An alternative I tried is that first I changed path/to/data in config file and started replicaset with different name (enabling auth in advance this time) and then added remaining nodes with blank /data/directory and then changed /path/to/data for primary to one that contained all my data. But meanwhile current primary became secondary and replicated new primary i.e. data directory of former primary became blank.Can you please suggest a way to do that. Or copying data files from another location to data directory of primary will help? One more thing,that I've already created users on this replicaset.

Shobhit Mishra
  • 337
  • 1
  • 2
  • 13
  • 2
    As stated in the [auth with replica sets tutorial](http://docs.mongodb.org/manual/tutorial/deploy-replica-set-with-auth/), you can't switch on auth without downtime. To enable auth you need to restart the servers with the --auth parameter. you can set up the users on one server and then let it replicate to the others by making the configured server primary. – wdberkeley Aug 27 '14 at 15:18

0 Answers0