Giter Site home page Giter Site logo

Comments (12)

indexzero avatar indexzero commented on September 24, 2024

Not sure. Maybe @yosefd can answer this

from winston-mongodb.

yosefd avatar yosefd commented on September 24, 2024

The package options include only host and port, as it is now, so it doesn't support replica sets.

However, I am using this package to log into full sharded mongo with multiple shards and multiple replica sets. With sharded installation you have mongo router (mongos) that can be addressed like a single server.

from winston-mongodb.

btmdave avatar btmdave commented on September 24, 2024

+1

from winston-mongodb.

gabrieledarrigo avatar gabrieledarrigo commented on September 24, 2024

Hello all.
In regards to preveiuos questions, is it possible to specify only the master of replica set in the host configuration?

from winston-mongodb.

mvdwalle avatar mvdwalle commented on September 24, 2024

It is not really an option to use a mongos installation just for logging. Support for replicasets would be really useful.

from winston-mongodb.

philpoore avatar philpoore commented on September 24, 2024

2nd that...!
It's already half working, you can write into the DB primary, but when the Primary moves you get:
TypeError: Object Error: Cannot write to a secondary has no method 'isCompatible'

mvdwalle knows all the things...!

It would be pretty easy i think, why can't you use connection strings like mongoose...?
"uri":"db1/thing,db2/thing,db3/thing"

from winston-mongodb.

AaronM04 avatar AaronM04 commented on September 24, 2024

I'm getting this same error, @philpoore .
What do you mean by "when the Primary moves"?

from winston-mongodb.

philpoore avatar philpoore commented on September 24, 2024

Primary DB Server in the Replica Set.
If the first server in Mongo Connection String is the Primary Server it'll work.

But as soon as the set nominates a new primary. The connection to DB fails... :(

from winston-mongodb.

philpoore avatar philpoore commented on September 24, 2024

You can Hack Replica Sets in by changing https://github.com/indexzero/winston-mongodb/blob/master/lib/winston-mongodb.js#L76:

this.server = new mongodb.Server(this.host, this.port, {
    ssl: this.ssl
  });

GIVE ME 30 min i'll patch it...

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on September 24, 2024

@philpoore you may send a pull request. Note, that you should keep compatibility with old settings format and follow the same style guide. Thank you.

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on September 24, 2024

Replica Sets are supported in current version.

from winston-mongodb.

niftylettuce avatar niftylettuce commented on September 24, 2024

See #39

from winston-mongodb.

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.