#带管理页面 #下载镜像 docker pull rabbitmq:management #创建容器并运行(15672是管理界面的端口,5672是服务的端口。这里顺便将管理系统的用户名和密码设置为admin admin) docker run -dit --name rabbitmq -p 15672:15672 -p 5672:5672 -v /Users/liangshu/rabbitmq/lib:/var/lib/rabbitmq -v /Users/liangshu/rabbitmq/log:/var/log/rabbitmq rabbitmq:management #进入容器 docker exec -it rabbitmq bash cd /usr/sbin/ rabbitmq-plugins enable rabbitmq_management rabbitmqctl add_user admin admin rabbitmqctl set_user_tags admin administrator rabbitmqctl set_permissions -p / admin ‘.*‘ ‘.*‘ ‘.*‘ #celery 配置mq RABBITMQ_HOSTS = "localost" RABBITMQ_PORT = 5672 RABBITMQ_VHOST = ‘/‘ RABBITMQ_USER = ‘admin‘ RABBITMQ_PWD = ‘admin‘ BROKER_URL = ‘amqp://%s:%s@%s:%d/%s‘ % (RABBITMQ_USER, RABBITMQ_PWD, RABBITMQ_HOSTS, RABBITMQ_PORT, RABBITMQ_VHOST)