Giter Site home page Giter Site logo

Just a question about run-rs HOT 6 CLOSED

vkarpov15 avatar vkarpov15 commented on July 20, 2024
Just a question

from run-rs.

Comments (6)

vkarpov15 avatar vkarpov15 commented on July 20, 2024

In general yes, but not with run-rs currently. Will add.

from run-rs.

stherrienaspnet avatar stherrienaspnet commented on July 20, 2024

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.

vkarpov15 avatar vkarpov15 commented on July 20, 2024

Fix is in v0.2.2 šŸ‘

from run-rs.

stherrienaspnet avatar stherrienaspnet commented on July 20, 2024

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.

vkarpov15 avatar vkarpov15 commented on July 20, 2024

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.

stherrienaspnet avatar stherrienaspnet commented on July 20, 2024

from run-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.