Mongodb set feature compatibility to 3.4 fail

mongodb-3.2mongodb-3.4

I want to enable the features of my Mongodb 3.4 after upgrading. I have sharded cluster enviroment And after I ran the commands:

use admin
db.adminCommand ({setFeatureCompatibilityVersion: "3.4"})

In mongos instance I got the following output:

{"ok": 1}

But when I try to check with it succeeded with command:

db.adminCommand ({getParameter: 1, featureCompatibilityVersion: 1})

I get the following output:

{"ok": 0, "errmsg": "no option found to get"}

And when I check in ops manager I see that the command did not work

Best Answer

You probably ran your command

 db.adminCommand ({getParameter: 1, featureCompatibilityVersion: 1})

on a mongos instance. The documentation states in this case:

The operation is undefined on the mongos instances. For a sharded cluster that has access control enabled, to run the command against a member of the shard replica set, you must connect to the member as a shard local user.

When you connect to a mongod instead, the command should work as expected.