安装docker
yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engineyum install -y yum-utils
yum-config-manager
--add-repo
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repoyum install docker-ce docker-ce-cli containerd.io
设置阿里云加速
/etc/docker/daemon.json 设置如下 { "registry-mirrors": ["https://brh40ef2.mirror.aliyuncs.com"], "log-driver": "json-file", "log-opts": { "max-size": "100m", "max-file": "10" } }
重启Docker服务
systemctl daemon-reload systemctl restart docker systemctl enable docker # 开机自启动
安装RabbitMQ
docker pull rabbitmqdocker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 -v
pwd
/data:/var/lib/rabbitmq --hostname myRabbit -e RABBITMQ_DEFAULT_VHOST=my_vhost -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin rabbitmq:latestdocker exec -it rabbitmq rabbitmq-plugins enable rabbitmq_management
添加用户,设置权限
docker exec -it rabbitmq /bin/bashcd /opt/rabbitmq/sbin/
./rabbitmqctl add_user star 123456
./rabbitmqctl set_user_tags star administrator
RabbitMQ之无权限访问 vhost '/'
点击用户名称 [star] 进入用户设置页面