1

I'm trying to change Replica Set Protocol to pv1. I have 5 replica set servers Mongo 3.6. I'm using the documentation from here https://docs.mongodb.com/manual/reference/replica-set-protocol-versions/ to make those changes.

The documentation is pretty clear and operation seems simple https://docs.mongodb.com/manual/reference/replica-set-protocol-versions/#modify-replica-set-protocol-version. On PRIMARY server I executed this three commands:

cfg = rs.conf();
cfg.protocolVersion=1;
rs.reconfig(cfg);

After doing it I'm getting :

rs.reconfig(cfg);
{
    "ok" : 1,
    "operationTime" : Timestamp(1531825299, 3),
    "$clusterTime" : {
        "clusterTime" : Timestamp(1531825299, 3),
        "signature" : {
            "hash" : BinData(0,"AIwmnD882cUdRgKYgGsRZg9Z4q0="),
            "keyId" : NumberLong("6577197549977862145")
        }
    }
}

Everything looks good, but after relogin to mongo I can see this:

MongoDB shell version v3.6.6
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.6
Server has startup warnings: 
2018-07-10T22:50:39.164+0200 I REPL     [replexec-0] 
2018-07-10T22:50:39.164+0200 I REPL     [replexec-0] ** WARNING: This replica set was configured with protocol version 0.
2018-07-10T22:50:39.164+0200 I REPL     [replexec-0] **          This protocol version is deprecated and subject to be removed 
2018-07-10T22:50:39.164+0200 I REPL     [replexec-0] **          in a future version.

I don't know what I'm doing wrong? Any help why this operation doesn't work ?

3
  • Is there something left in a config file since those are startup warnings.
    – Breadtruck
    Jul 20, 2018 at 5:33
  • @Breadtruck what do you mean? The configuration file didn't change and it was the same before upgrade to 3.6.
    – B14D3
    Jul 31, 2018 at 5:51
  • I am not sure anymore, but it says in the 3.6 documentation ... Starting in MongoDB 3.2, new replica sets use protocolVersion: 1 by default. Previous versions of MongoDB use version 0 of the protocol and cannot run as members of a replica set configuration that specifies protocolVersion 1. NOTE: MongoDB 3.6 deprecates the replica set protocol version 0. .... So I was basically thinking that you really still had the member set to 0 based on the warning , even though you made the changes, and I was thinking you could have something in the service config that was still out of line
    – Breadtruck
    Aug 6, 2018 at 22:45

2 Answers 2

4

You need to restart the mongod service after rs.reconfig(cfg). The reconfig will change the protocol version but it will be active after the restart. First you need to restart the secondary, then do a stepdown for the primary and restart it also. After that you will not see the warning anymore.

1
  • surprisingly, that's worked :) thx :)
    – B14D3
    Sep 9, 2018 at 19:13
0

In mongodb warnings are generated during startup and will be displayed in mongo shell until restart. It's historical warnings and you can see actual timestamp when they were generated.

You could want to restart mongodb only to hide these historical warnings.

But no need to restart mongodb to change protocol version since replication configuration applied on the fly right after rs.reconfig().

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .