0

I'm trying to configure a MongoDB replicaset with 3 replicas. The primary and another use the in memory storage engine, and the third uses wired tiger. I am using this configuration.

When I restart the cluster the data does not persist.

Server has startup warnings:

** WARNING: This replica set node is running without journaling enabled but the
**          writeConcernMajorityJournalDefault option to the replica set config
**          is set to true. The writeConcernMajorityJournalDefault
**          option to the replica set config must be set to false
**          or w:majority write concerns will never complete.
**          In addition, this node's memory consumption may increase until all
**          available free RAM is exhausted.


** WARNING: This replica set node is using in-memory (ephemeral) storage with the
**          writeConcernMajorityJournalDefault option to the replica set config
**          set to true. The writeConcernMajorityJournalDefault option to the
**          replica set config must be set to false
**          or w:majority write concerns will never complete.
**          In addition, this node's memory consumption may increase until all
**          available free RAM is exhausted.

And my configuration.

rs0:PRIMARY> cfg = rs.conf()
{
        "_id" : "rs0",
        "version" : 102744,
        "protocolVersion" : NumberLong(1),
        "writeConcernMajorityJournalDefault" : false,
        "members" : [
                {
                        "_id" : 0,
                        "host" : "mongodb-mongodb-replicaset-0.mongodb-mongodb-replicaset.default.svc.cluster.local:27017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 1,
                        "tags" : {

                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                },
                {
                        "_id" : 1,
                        "host" : "mongodb-mongodb-replicaset-1.mongodb-mongodb-replicaset.default.svc.cluster.local:27017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 1,
                        "tags" : {

                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                },
                {
                        "_id" : 2,
                        "host" : "mongodb-mongodb-replicaset-2.mongodb-mongodb-replicaset.default.svc.cluster.local:27017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : true,
                        "priority" : 0,
                        "tags" : {

                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                }
        ],
        "settings" : {
                "chainingAllowed" : true,
                "heartbeatIntervalMillis" : 2000,
                "heartbeatTimeoutSecs" : 10,
                "electionTimeoutMillis" : 10000,
                "catchUpTimeoutMillis" : -1,
                "catchUpTakeoverDelayMillis" : 30000,
                "getLastErrorModes" : {

                },
                "getLastErrorDefaults" : {
                        "w" : 1,
                        "wtimeout" : 0
                },
                "replicaSetId" : ObjectId("5e736baa5c51ff3e198dd880")
        }
}

The writeConcernMajorityJournalDefault option IS set to false!

Thanks in advance!

New contributor
user1646040 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
0

Ok what you need to do is to change:

    mongo "${ssl_args[@]}" --eval "rs.initiate({'_id': '$replica_set', 'members': [{'_id': 0, 'host': '$service_name'}]})"

to

    mongo "${ssl_args[@]}" --eval "rs.initiate({'_id': '$replica_set', 'writeConcernMajorityJournalDefault': false, 'members': [{'_id': 0, 'host': '$service_name'}]})"

The data still doesn't persist.

New contributor
user1646040 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

user1646040 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.