Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8528521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:49:10+00:00 2026-06-11T08:49:10+00:00

Has anyone been able to connect to a MongoDB replica set using rmongodb ?

  • 0

Has anyone been able to connect to a MongoDB replica set using rmongodb? No matter how I configure mongo.create I get an authentication error, even though the same host/username/password work fine when connecting via the mongo shell.

My code does the equivalent of:

> mongo.create(c("rs-1.mysite.com:12345","rs-2.mysite.com:12345"), "rsName", "user", "password", "my_db")
Unable to connect to replset
Authentication failed.

Update:

Looking at the logs of all the nodes in the replica set, I do not see any attempt to authenticate when I run the code above. Therefore, this may be a rmongodb bug.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:49:11+00:00Added an answer on June 11, 2026 at 8:49 am

    As Sim has noted, rmongodb 1.0.3 does not resolve hostnames.

    It is, however, possible to connect to replica sets from rmongodb with with a few caveats:

    • you must include all hostnames (if the primary isn’t found in the seed host list, rmongodb will fail to connect)
    • hostnames must be provided as IPs
    • if using an admin user, you must first auth to the admin database (this, at least, is expected behaviour but worth noting)
    • I could only get the connection to work by not providing a replSet name

    So my working connect string looks like:

    mongo.create(c("192.168.1.123:27017","192.168.1.124:27018","192.168.1.125:27017"),"","user","password", "thedb")
    

    NB: I only tested this with MongoDB 2.2.0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone at SO been able to connect to an SFTP server using DSA
Has anyone been able to get Windows Installer to use the InstallUISequence table during
Has anyone been able to get the Areas in ASP.NET MVC 2 to work?
Has anyone been able to get uploadify to work with codeigniter? Everything I try
Has anyone been able to modify the destination folder of PDB files using CMake
Has anyone been able to create of find an open source way to implement
Has anyone been able to get the suds soap library to work with the
Has anyone been able to get the MVC mini profiler working on IIS 6?
Has anyone been able to figure out how to configure the ccnet source control
has any one been able to connect to a soap server using ksoap2 android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.