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 6790505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:43:59+00:00 2026-05-26T17:43:59+00:00

I have a mongodb replicaset on ubuntu.. In replica set, hosts are defined as

  • 0

I have a mongodb replicaset on ubuntu.. In replica set, hosts are defined as localhost. You can see ;

{
    "_id" : "myrep",
    "version" : 4,
    "members" : [
            {
                    "_id" : 0,
                    "host" : "localhost:27017"
            },
            {
                    "_id" : 2,
                    "host" : "localhost:27018"
            },
            {
                    "_id" : 1,
                    "host" : "localhost:27019",
                    "priority" : 0
            }
    ]

}

I want to change host adresses with real ip of server. But when i run rs.reconfig, I get error :

{
    "assertion" : "hosts cannot switch between localhost and hostname",
    "assertionCode" : 13645,
    "errmsg" : "db assertion failure",
    "ok" : 0

}

How can i solve it ?
Thank you.

  • 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-05-26T17:43:59+00:00Added an answer on May 26, 2026 at 5:43 pm

    The only way I found to change host names is recreating replica set.. To make it right db directories need to be cleaned.. Then starting all servers with replication mode after that creating new repset with new host names fixed it.

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

Sidebar

Related Questions

here's my problem: I have a MongoDB Replica Set which I will have to
What is the maximum number of shards MongoDB can have?
I have searched in google about mongoDB and iOS but found nothing. Can I
I have mongodb running on a remote server. I can ssh to the remote
i have installed mongodb (1.8.3) on two seperate servers and set them up to
I have a MongoDB collection with documents in the following format: { _id :
I never have my hands on coding. I got a doubt regarding mongodb replica
I have a mongodb object as follows: array ( '_id' => new MongoId(4cc97fb0247ae8747ec5fefb), 'posts'
I have a MongoDB collection with objects, the _id property of which is a
I have mongodb running and using morphia. Having a Collection of BatchData Documents and

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.