configsvr:true

1,158 views
Skip to first unread message

Maxim Neverov

unread,
Sep 29, 2016, 10:46:37 AM9/29/16
to mongodb-user
Hi,

I'm trying to deploy mongo sharding cluster following this instruction
When I run mongod --config configuration_file_path I get the the error message in log:
"Locally stored replica set configuration is invalid; See http://www.mongodb.org/dochub/core/recover-replica-set-from-invalid-config for information on how to recover from this. Got "BadValue: Nodes started with the --configsvr flag must have configsvr:true in their config" while validating".
My configuration file is:
sharding:
    clusterRole: "configsvr"
replication:
    replSetName: "rs0"
net:
    port: 27017    
storage:
    dbPath: "db_path"
systemLog:
    destination: "file"
    path: "log_path"

I already tried to add configsvr: true to sharding and got "Unrecognized option: sharding.configsvr". I've also tried to set this option with 
setParameter:
    configsvr: "true"
with the same result.

mongod --version
db version v3.2.4
git version: e2ee9ffcf9f5a94fad76802e28cc978718bb7a30
allocator: tcmalloc
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64

How can I set this option?

Kevin Adistambha

unread,
Oct 28, 2016, 12:11:17 AM10/28/16
to mongodb-user

Hi

It’s been a while since you posted this issue. Have you had success in resolving this?

To deploy config servers as a replica set, you need two basic things:

  1. The mongod instance must be called with the --replSet and --configsvr options. The --configsvr option can also be set in the sharding.clusterRole: configsvr if using a config file.
  2. The replica set configuration (i.e. the document you passed into rs.initiate()) must contain the field configsvr: true

The main issue in your deployment is this line you posted:

Got “BadValue: Nodes started with the —configsvr flag must have configsvr:true in their config” while validating”.

This error appears when you initiate a regular replica set (i.e. without the --configsvr option and without the configsvr: true during rs.initiate()) and then attempt to restart it using the --configsvr option. That is, you cannot repurpose an existing replica set into config servers.

To use replica set config servers, you must create a new replica set, or upgrade an existing config server deployment. This is because there are additional restrictions that replica set config servers must abide compared to a regular replica set.

For more information, please see:

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages