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

  • SEARCH
  • Home
  • 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 8852583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:26:16+00:00 2026-06-14T13:26:16+00:00

In two different terminals, I start up mongod with: mongod –dbpath 1 –port 27001

  • 0

In two different terminals, I start up mongod with:

mongod --dbpath 1 --port 27001 --smallfiles --oplogSize 50 --logpath log.1 --replSet test
mongod --dbpath 2 --port 27002 --smallfiles --oplogSize 50 --logpath log.2 --replSet test

(data subdirectories 1 and 2 already created).

I go into a third window and run the mongo shell against one of the mongod instances

mongo --port 27001

In the shell, I setup a configuration as

cfg = { _id: "test", members: [ {_id:0, host: "localhost:27001"}, {_id:1, host:"localhost:27002"} ] }

then run:

use admin
rs.initiate(cfg)

The response from the shell is:

{
"startupStatus" : 4,
"info" : "hotest",
"errmsg" : "all members and seeds must be reachable to initiate set",
"ok" : 0
}

The logfile for instance on port 27001 reports:

Sun Nov 18 18:32:56 [rsStart] trying to contact macbookpro.local:27001
Sun Nov 18 18:32:56 [rsStart] couldn't connect to macbookpro.local:27001: couldn't connect to server macbookpro.local:27001
Sun Nov 18 18:32:56 [rsStart] replSet can't get local.system.replset config from self or any seed (yet)

It appears that the rs.initiate(cfg) cannot connect to the mongod instance on port 27001. But when I run mongod without –replSet the mongo shell connects just fine.

It isn’t clear where I am screwing up but I will bet it is obvious.

  • 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-14T13:26:17+00:00Added an answer on June 14, 2026 at 1:26 pm

    Found it!

    It turns out that when one installs MongoDB on OSX with brew a configuration file is created at /usr/local/etc/mongo.conf. In this file there was the line:

    # Only accept local connections
    bind_ip = 127.0.0.1

    Well, if you look at the log the rsStart error was:

    Sun Nov 18 18:32:56 [rsStart] trying to contact macbookpro.local:27001
    Sun Nov 18 18:32:56 [rsStart] couldn't connect to macbookpro.local:27001: couldn't connect to server macbookpro.local:27001
    Sun Nov 18 18:32:56 [rsStart] replSet can't get local.system.replset config from self or any seed (yet)
    

    and if I ping macbookpro.local the IP address returned was 192.168.41.1. 192.168.41.1 <> 127.0.0.1 so mongod was refusing to respond. Removing this line from the configuration allowed be to setup replication successfully.

    sheesh. I am such an idiot. Looked for hours at this and kept thinking that the machine name when connected to the network was 127.0.0.1. Let this be a lesson to you—don’t get old!

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

Sidebar

Related Questions

Here I am running two instance of same program in two different terminals. The
i was debugging a program in two terminals by giving different input,but at on
The two different code snippets(with minor change) show some error in calculations by joda
Can two different iPhone applications share the same settings? I'm releasing two iPhone products,
How can I create two different lists for one model? In my case I
I have two different libGL libraries on the same Ubuntu 11.04 machine. One library
I have a two different ways of representing data in my app: via UITableView
I currently have two different models: User and Project . The User model has
I have two different buttons on my page. I want them both to be
I found there're two different opinions about how greedy regex is executed: one is,

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.