Skip to content

Commit

Permalink
Update readme for local replica set
Browse files Browse the repository at this point in the history
  • Loading branch information
lmd59 committed Mar 5, 2024
1 parent b472f63 commit be14a92
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ npm install --workspace=<app-or-service> <package-name>

Copy `app/.env.example` to `app/.env.local` and `service/.env.example` to `service/.env`. Make any changes to point to the measure repository service, Mongo database, and optionally the VSAC API. `0.0.0.0` may be a more appropriate database address than `localhost` for certain environment setups.

### Mongo Replica Set Setup

Use the mongodb configuration file to configure the single node replica set. More information about the configuration file and system location, see the mongodb [configuration file documentation](https://www.mongodb.com/docs/manual/reference/configuration-options/).

1. First shutdown any currently running mongodb standalone instance: `brew services stop mongodb-community`.
2. Add this replication set configuration to the file:
```
replication:
replSetName: rs0
```
3. Start mongodb again using homebrew: `brew services restart mongodb-community`.
4. Initialize the replica set using mongosh:
```bash
mongosh
```
```bash
rs.initiate()
```
5. From here you can continue to use the replica set, and in the future, you can do a normal start of the server using homebrew: `brew services start mongodb-community` (without need to reinitialize the replica set).

Further information on standalong to replica set conversion can be found in the mongodb [replica set conversion documentation](https://www.mongodb.com/docs/manual/tutorial/convert-standalone-to-replica-set/).

## Usage

Once you have the necessary dependencies installed, you can run the following in the root directory:
Expand Down

0 comments on commit be14a92

Please sign in to comment.