yum install epel-release
搜索mongodb-server
安装mongodb
yum install mongodb-server.x86_64
配置mongodb
vim /etc/mongod.conf
修改为0.0.0.0 允许所以ip服务!
启动mongodb
systemctl start mongod
成功
创建角色:
use oa
show users
db.createUser({user: "root",pwd: "123456",roles: [ { role: "dbOwner", db: "oa" } ]})