Install MongoDB

#vi /etc/yum.repos.d/mongodb-org-3.4.repo

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

#yum install -y mongodb-org

#yum install php-devel php-pecl-mongo php-pecl-mongodb –enablerepo=remi

#find / -name php.ini -type f -exec sh -c “echo extension=mongo.so >> {}” \;

#mongo –port 27017

use admin
db.createUser( { user: “root”, pwd: “passwd”, roles: [ “userAdminAnyDatabase”, “dbAdminAnyDatabase”, “readWriteAnyDatabase” ] } )

vim /etc/mongod.conf

security:
authorization: enabled

Comments are closed.