[SERVER-11655] am trying to change the port number for one replica set , getting the below error "errmsg" : "exception: assertion src/mongo/db/repl/rs_initiate.cpp:125" Created: 10/Nov/13  Updated: 02/Dec/13  Resolved: 26/Nov/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.4.6
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: saeed meethal Assignee: Gianfranco Palumbo
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mac os x


Operating System: ALL
Participants:

 Description   

From Log :

Sun Nov 10 21:12:48.322 [conn227] DBClientCursor::init call() failed
Sun Nov 10 21:12:48.322 [conn227] replSet cmufcc requestHeartbeat 192.168.1.7:27016 : 10276 DBClientBase::findN: transport error: 192.168.1.7:27016 ns: admin.$cmd query: { replSetHeartbeat: "rep1", v: -1, pv: 1, checkEmpty: false, from: "" }
Sun Nov 10 21:12:48.323 [conn227]   Assertion failure m->h().toString() == i->h.toString() src/mongo/db/repl/rs_initiate.cpp 125
0x10044ac7b 0x10042497c 0x10032c577 0x1003127f6 0x100311c38 0x1001450a5 0x100145ee2 0x10014689c 0x10023f7fe 0x10023ffff 0x1001ed19f 0x10000b9a2 0x100440669 0x10047d815 0x7fff92608772 0x7fff925f51a1
 0   mongod                              0x000000010044ac7b _ZN5mongo15printStackTraceERSo + 43
 1   mongod                              0x000000010042497c _ZN5mongo12verifyFailedEPKcS1_j + 284
 2   mongod                              0x000000010032c577 _ZN5mongo29checkMembersUpForConfigChangeERKNS_13ReplSetConfigERNS_14BSONObjBuilderEb + 2679
 3   mongod                              0x00000001003127f6 _ZN5mongo18CmdReplSetReconfig4_runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 1206
 4   mongod                              0x0000000100311c38 _ZN5mongo18CmdReplSetReconfig3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 84
 5   mongod                              0x00000001001450a5 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 37
 6   mongod                              0x0000000100145ee2 _ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 2282
 7   mongod                              0x000000010014689c _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1036
 8   mongod                              0x000000010023f7fe _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46
 9   mongod                              0x000000010023ffff _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 1551
 10  mongod                              0x00000001001ed19f _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1519
 11  mongod                              0x000000010000b9a2 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 198
 12  mongod                              0x0000000100440669 _ZN5mongo17PortMessageServer17handleIncomingMsgEPv + 1657
 13  mongod                              0x000000010047d815 thread_proxy + 229
 14  libsystem_c.dylib                   0x00007fff92608772 _pthread_start + 327
 15  libsystem_c.dylib                   0x00007fff925f51a1 thread_start + 13
Sun Nov 10 21:12:48.328 [conn227] replSet replSetReconfig exception: assertion src/mongo/db/repl/rs_initiate.cpp:125
Sun Nov 10 21:12:48.329 [conn227] command admin.$cmd command: { replSetReconfig: { _id: "rep1", version: 6, members: [ { _id: 0, host: "192.168.1.7:27016" }, { _id: 1, host: "192.168.1.7:27018" }, { _id: 2, host: "192.168.1.7:27019" }, { _id: 4, host: "192.168.1.7:27020", arbiterOnly: true }, { _id: 5, host: "192.168.1.4:27071" } ] } } ntoreturn:1 keyUpdates:0 locks(micros) W:1 reslen:118 8008ms



 Comments   
Comment by Gianfranco Palumbo [ 14/Nov/13 ]

I'm glad that worked for you.

Let me know if you have any other questions or it's ok to close this issue.

Regards,
Gianfranco

Comment by saeed meethal [ 14/Nov/13 ]

thank you

Comment by Gianfranco Palumbo [ 13/Nov/13 ]

You'll have to change the configuration by doing:

cfg = rs.conf()
// remove the port field
rs.reconfig(cfg)

Comment by saeed meethal [ 13/Nov/13 ]

I have successfully changed the port from mongodb 2.4.8 new version , i hope it is nt wkring for 2.4.6

One more help :

I have made a mistake in conf file and added wrong field column

{ "_id" : 5, "host" : "10.00.00.00:27033", "votes" : 0, "port" : 27033 }

,

How to remove this unexpected field from conf other than rs.remove()

Thanks,
saeedkm

Comment by Gianfranco Palumbo [ 13/Nov/13 ]

Depending if you want to maintain the replicaset available you can follow this tutorial:
http://docs.mongodb.org/manual/tutorial/change-hostnames-in-a-replica-set/#change-hostnames-while-maintaining-replica-set-availability

or this:
http://docs.mongodb.org/manual/tutorial/change-hostnames-in-a-replica-set/#change-all-hostnames-at-the-same-time

Comment by Gianfranco Palumbo [ 12/Nov/13 ]

No the host contains the hostname and port.

It's possible that there was a connectivity issue just as you triggered the command but i'll look into it.

If you have more information that you think might help debug this, please do share.

Comment by saeed meethal [ 12/Nov/13 ]

Thank you so much Gianfranco Palumbo for the info ,the commands which i used for changing port
cfg = rs.conf()
cfg.members[0].host = "hostname:27016"
rs.reconfig(cfg)

QQ: Do i need to use port instead of using host ?

Thanks,
saeedkm

Comment by Gianfranco Palumbo [ 11/Nov/13 ]

Saeed,

To change ports or hostnames in a replicaset, you'll to follow this procedure:
http://docs.mongodb.org/manual/tutorial/change-hostnames-in-a-replica-set/

Can you provide the exact commands you run so I can replicate this and see the reason behind the Assertion?

Regards,
Gianfranco

Comment by saeed meethal [ 10/Nov/13 ]

can someone please help me to resolvve this issue ?

Generated at Thu Feb 08 03:26:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.