disable compression options in mongodb - mongodb

I run mongodb community edition in version 3.0 on Linux Redhat 6.
I would like to disable compression option to improve performance.
My config file is:
systemLog:
destination: file
path: /var/log/mongodb/domains/Instruments/INS_UNIV_univ_DBIZ/mongod.log
logAppend: true
storage:
dbPath: "/export/mongodb/domains/Instruments/INS_UNIV_univ_DBIZ/data"
engine: wiredTiger
wiredTiger:
collectionConfig:
blockCompressor: none
processManagement:
fork: true
pidFilePath: /var/run/mongodb/mongod-ins.pid
net:
port: 5865
replication:
replSetName: MONGO_INS_UNIV_univ_DBIZ
security:
keyFile: /etc/keyfile-ins.txt
setParameter:
enableLocalhostAuthBypass: false
This config file works well and the mongo server starts normally but if I add the option index prefix compression, the server does not start any more.
systemLog:
destination: file
path: /var/log/mongodb/domains/Instruments/INS_UNIV_univ_DBIZ/mongod.log
logAppend: true
storage:
dbPath: "/export/mongodb/domains/Instruments/INS_UNIV_univ_DBIZ/data"
engine: wiredTiger
wiredTiger:
collectionConfig:
blockCompressor: none
indexConfig:
prefixCompression: none
processManagement:
fork: true
pidFilePath: /var/run/mongodb/mongod-ins.pid
net:
port: 5865
replication:
replSetName: MONGO_INS_UNIV_univ_DBIZ
security:
keyFile: /etc/keyfile-ins.txt
setParameter:
enableLocalhostAuthBypass: false
Any help will be very appreciate

That should be
indexConfig:
prefixCompression: false
Instead of
indexConfig:
prefixCompression: none
As the property is Boolean, not a string

Related

/var/run/mongodb/ folder is deleted every system reboot

Every time I restart the system the "/var/run/mongodb/" folder is deleted and mongodb cannot be started. Here is my mongod.conf file:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
# engine:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 38512
bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
security:
authorization: enabled
keyFile: /var/lib/mongodb/replica_set_key
#operationProfiling:
replication:
replSetName: "dbr"
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
I am using Ubuntu 20.04.
I first tried this solution https://stackoverflow.com/a/54755924/14971470 for the
"ERROR: Cannot write pid file to {path_string}: {errAndStr_second}","attr":{"path_string":"/var/run/mongodb/mongod.pid","errAndStr_second":"No such file or directory""
error and it fixed it.
But every time I restart the system, the "/var/run/mongodb/" folder is deleted again and mongodb can't be started.

MongoDB Sharding

I am new to mongodb.
I want to create a Shard Cluster with single Replica Set,In future, if I want to want to extend it will be easy.
Now, Have 4 Ubuntu machine, 1 will work as Router(mongos) and remaining 3 as used as replica set(Primary,Secondary,Secondary).
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /mnt/md0/data/mongodb/dbdata/
journal:
enabled: true
# engine:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /mnt/md0/data/mongodb/logs/mongod.log
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1
#processManagement:
security:
keyFile: /opt/mongo/mongo-keyfile
#operationProfiling:
replication:
replSetName: rs0
sharding:
clusterRole: configsvr
## Enterprise-Only Options:
#auditLog:
#snmp:**strong text**
#mongos.conf
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongos.log
# network interfaces
net:
port: 27017
#bindIp: 127.0.0.1,192.10.10.10
security:
keyFile: /opt/mongo/mongo-keyfile
sharding:
configDB: rs0/Primary_Rs:27017,Secondary1_Rs:27017,Secondary2_Rs:27017
When I am trying to add the Shard in mongos console, I am getting error
Please help me to resolve me the issue.
Thank you In Advance
See you have 2 sharding part in your conf file... and first one config clusterRole as configsvr => remove/comment this one, and retry

Error while starting Mongod with config file option

I am not able to start mongod servers with replication using config file.
when issue the command
mongod --config /etc/mongod1.conf
throws an error-
Unrecognized option: replSet
Unrecognized option: oplogSizeMB
MongoDB Version: 3.0
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo/test
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
# network interfaces
net:
port: 27030
# bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.
#security:
#operationProfiling:
replication:
replSet: testrep
oplogSizeMB: 1024
#sharding:
## Enterprise-Only Options
please help me.
Just ident replSet and oplogSizeMB lines two spaces to the right. That's the thing with yaml

MongoDB replica set not starting

My mongodb replica set server is failing on start. followin is my config file:
# mongod.conf
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
net:
port: 27017
# bindIp: 127.0.0.1
security:
authorization: enabled
keyFile: /home/gurbakhshish/dbKey/mongodb.key
replication:
replSetName: "nm-prd-dbs"
is this config correct. I dont have the issue if i comment security section of config file

Mongos not starting using YAML format for config file

I am trying to start mongos using config file with YAML format. it is throwing error saying "Unrecognized option: sharding.configDB". I am running this on centos6.
Any help will be highly appreciated.
Config file:
systemLog:
destination: file
path: REPLACEWITHLOGPATH
quiet: true
processManagement:
fork: true
net:
bindIp: REPLACEWITHIP
port: REPLACEWITHPORT
storage:
dbPath: REPLACEWITHDBPATH
sharding:
clusterRole: shardsvr
configDB: "172.16.4.61:27019"
I believe you need to remove the clusterRole: shardsvr from your mongos configuration file