Comments (6)
In general yes, but not with run-rs currently. Will add.
from run-rs.
Thanks for the quick reply, could you point me where could i make temporary change for it if this is quick like removing the 2 other server instances?
from run-rs.
Fix is in v0.2.2 š
from run-rs.
Thanks you very much for your changes! Unfortunately, i just read on mongodb site that when your specify only one server instance into the connection string using the replicat set option mongo is creating a standalone server connection. Here is what i have done:
1- stopped my mongodb service that is running when my laptop is booting
2- start the service like this -> mongod --replSet rs0
3- const dbClient: MongoClient = await MongoClient.connect('mongodb://localhost:27017/rollback-test/?replicaSet=rs0', {useNewUrlParser: true});
Here is the result: UnhandledPromiseRejectionWarning: MongoError: no primary found in replicaset or invalid replica set name.
Here is what I have read from Mongo Web site, maybe I have a bad understanding, could you confirm me if you also see having replicat set on a single instance make transaction NOT AVAILAIBLE.
Mongo doc:
replicaSet | Specifies the name of theĀ replica set, if theĀ mongodĀ is a member of a replica set.When connecting to a replica set it is important to give a seed list of at least twoĀ mongodinstances. If you only provide the connection point of a singleĀ mongodĀ instance, and omit theĀ replicaSet, the client will create aĀ standaloneĀ connection. |
---|---|
Thanks for your time :) |
from run-rs.
If you specify the replicaSet option in your query string, the MongoDB driver will try to make a replica set connection, even if you only have 1 host in your connection string. That error message looks like you're trying to connect to a standalone mongod instance as a replica set, which you can't do. There's a difference between a 1 node replica set and a standalone mongod. Try using run-rs -n 1
and see if that works.
from run-rs.
from run-rs.
Related Issues (20)
- Gets stuck on 'Starting replica set...' HOT 8
- MongoDB 4.4.2 fails to start HOT 1
- Unable to start or create replica set with mongodb 4.4.1 HOT 1
- Is it possible to configure the ports? HOT 2
- Warnings HOT 1
- Starting rs with --keep throws an error HOT 1
- Error: Server is unavailable HOT 8
- run-rs nuked my existing databases HOT 1
- colors dependecy attack through prettyjson
- How to uninstall the mongodb rs installed by run-rs in macos?
- moment.js security vulnerability
- --keep option, way to avoid logging entire db contents on start? HOT 1
- No mongod process found at mongod, check your --mongod option
- Error: spawn Unknown system error -86 HOT 2
- Changing default ports with --portStart flag does not work
- Support Apple Silicon
- Not Working with Node Version 18 HOT 1
- Invalid namespace specified error when adding document to collection with feathers-mongodb and run-rs
- mongoDB is no longer available for download for Ubuntu 16.04
- Error "Server is unavailable" with Node >= 17 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from run-rs.