I want to use mongod --dbpath with setParameter but I cannot because I can not stop mongodb on digitalocean. How can I do it?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello, I am trying to edit mongodb.conf file but I get permission error with the file 644 permission.
You can use
“service mongod stop” or “service mongo stop” or /etc/init.d/mongo stop or /etc/init.d/mongod stop or
check the mongod process & kill it with below command
for i in ps -ef | egrep 'shardsvr|configsvr|replSet|configdb' | grep -v egrep | awk -F" " '{print $2}'; do kill -9 $i; done
Please refer to my script at http://dbversity.com/mongodb-shard-creation-script/
You can set the parameter while MongoDB is still running. Connect to MongoDB as an admin user and run the following command:
db.getSiblingDB('admin').runCommand( { setParameter: 1, failIndexKeyTooLong: false } );
You might also need to add it to /etc/mongod.conf or /etc/mongodb.conf (the filename is different depending on what version of mongodb you are running):
setParameter=failIndexKeyTooLong=false
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.