-2

Please guide me to change 1 node standlone (have data) to 2 node 1 arbiter Replicate Set

closed as unclear what you're asking by mustaccio, kevinsky, John Eisbrener, Colin 't Hart, hot2use May 30 at 15:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1

Please follow Convert a Standalone to a Replica Set in the documentation:

  1. Shut down the standalone mongod instance.
  2. Restart the instance. Use the --replSet option to specify the name of the new replica set.For example, the following command starts a standalone instance as a member of a new replica set named rs0. The command uses the standalone’s existing database path of /srv/mongodb/db0:

    WARNING

    Before binding to a non-localhost (e.g. publicly accessible) IP address, ensure you have secured your cluster from unauthorized access. For a complete list of security recommendations, see Security Checklist. At minimum, consider enabling authentication and hardening network infrastructure.

    mongod --port 27017 --dbpath /srv/mongodb/db0 --replSet rs0 --bind_ip localhost,<hostname(s)|ip address(es)>
    
  3. Connect a mongo shell to the mongod instance.

  4. Use rs.initiate() to initiate the new replica set:

    rs.initiate()
    

    The replica set is now operational. To view the replica set configuration, use rs.conf(). To check the status of the replica set, use rs.status().

Not the answer you're looking for? Browse other questions tagged or ask your own question.