mongoDb、rabbitmq安装

    0

mongoDb

  1. 下载并启动
docker run --name mongo  -p 27017:27017 -d mongo:latest  --auth
  1. 进入容器
docker exec -it container_id  mongo admin
  1. 创建admin
db.createUser({ user: 'admin', pwd: 'admin', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] }); 
#验证一下对不对
db.auth("admin","admin");
#退出
exit
  1. 创建业务库
use zzf;
db.createUser({ user: "zzf", pwd: "zzf", roles: [ { role: "dbAdmin", db:"zzf" } ] });
#or
db.createUser({ user: "zzf", pwd: "zzf", roles: [ { role: "readWrite", db:"zzf" } ] });
db.auth("zzf","zzf");
db.items.insert({"name":2})

rabbitmq

docker run --name rabbitmq -d -p 15672:15672 -p 5672:5672 rabbitmq:management

进入 ip:15672 账号密码都是guest

#讨论区
00条评论
实时对话
loading...