-
Notifications
You must be signed in to change notification settings - Fork 23
Resources
Sikana Tanupabrungsun edited this page Apr 19, 2018
·
25 revisions
- sudo apt-get install python-pip
- sudo pip install --upgrade celery
- https://www.howtoforge.com/tutorial/install-mongodb-on-ubuntu-16.04/
- If MongoDB could not be started with sudo service mongod start:
** 1. sudo netstat -lpn | grep :27017 ;list the running mongo process
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 11598/mongod ;Example output
** 2. sudo kill -9 PID ; ex. 11598
** 3. sudo mongod --fork --dbpath /var/lib/mongodb --smallfiles --logpath /var/log/mongodb.log --logappend --config /etc/mongod.conf
- https://docs.mongodb.com/manual/reference/ulimit/
- http://serverfault.com/questions/626978/mongodb-error-out-of-file-descriptors-waiting-one-second-before-trying-to-acc
- If the service is terminated, crashed or whatever reasons, the lock file will not be removed and so we have to remove it manually before starting the service
- sudo rm /var/lib/mongodb/mongod.lock
- Sometimes you will also need to manually remove a port file
- sudo rm /tmp/mongodb-27017.sock
- Make sure MongoDB uses schema 3
- db.system.version.save({ "_id" : "authSchema", "currentVersion" : 3 })
- Then create a new user
- db.createUser({user: USERNAME, pwd: PWD, roles: [{role: "root", db: "admin"}]})
- Enable the authentication
- Edit the config file: sudo pico /etc/mongod.conf
- Uncomment:
- security: authorization: enabled
- Restart the service: sudo service mongod restart