Skip to content

Instantly share code, notes, and snippets.

@Aricg
Created May 31, 2013 15:35
Show Gist options
  • Select an option

  • Save Aricg/5685819 to your computer and use it in GitHub Desktop.

Select an option

Save Aricg/5685819 to your computer and use it in GitHub Desktop.
change and push a new hostname to the mongodb cluster.
cluster1:PRIMARY> conf = rs.conf()
{
"_id" : "cluster1",
"version" : 98579,
"members" : [
{
"_id" : 0,
"host" : "shortname001:27017"
},
{
"_id" : 1,
"host" : "long.name002.com:27017",
"arbiterOnly" : true
},
{
"_id" : 2,
"host" : "long.name003.com:27017"
}
]
}
cluster1:PRIMARY> conf.members[0].name = "long.name001.com:27017"
cluster1:PRIMARY> rs.reconfig(conf, { force: true } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment