浏览文章
文章信息
Magento2 安装rabbitmq-server消息中间件RabbitMQ|Magento2 amqp
13073
1、安装
sudo apt install -y rabbitmq-server2、验证
systemctl status rabbitmq-server 或者 service rabbitmq-server status3、基本操作
service rabbitmq-server start # 启动 service rabbitmq-server stop # 停止 service rabbitmq-server restart # 重启 rabbitmqctl add_vhost /testhost # 添加vhost rabbitmqct list_vhosts # 列出 rabbitmqctl delete_vhost /testhost # 删除vhost4、用户管理
rabbitmqctl list_users # 查看用户列表 rabbitmqctl add_user admin yourpassword # 增加普通用户 rabbitmqctl set_user_tags admin administrator # 给普通用户分配管理员角色5、检测可用性
6、账户授权
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"7、配置
找到app/etc/env.php
添加以下内容
'queue' => [ 'consumers_wait_for_messages' => 1, 'amqp' => [ 'host' => '127.0.0.1', 'port' => '5672', 'user' => 'magento', 'password' => 'magento', 'virtualhost' => '/' ], ],8、Magento验证连接性
bin/magento queue:consumers:start async.operations.all