包含linuxmq安装命令的词条( 三 )


Listing users ...
guest[administrator]
linuxprobe[]
...done.
# granting admin role to a user is like follows
[root@vdevops ~]# rabbitmqctl change_password linuxprobe strongpassword
Changing password for user "linuxprobe" ...
...done.
# granting admin role to a user is like follows
[root@vdevops ~]# rabbitmqctl set_user_tags linuxprobe administrator
Setting tags for user "linuxprobe" to [administrator] ...
...done.
# deleting a user is like follows
[root@vdevops ~]# rabbitmqctl delete_user linuxprobe
Deleting user "linuxprobe " ...
...done.
要使用RabbitMQ,也要添加虚拟主机
[root@vdevops ~]# rabbitmqctl add_vhost /my_vhost
Creating vhost "/my_vhost" ...
...done.
[root@vdevops ~]# rabbitmqctl list_vhosts
Listing vhosts ...
/
/my_vhost
...done.
[root@vdevops ~]# rabbitmqctl delete_vhost /my_vhost
Deleting vhost "/my_vhost" ...
...done.
给虚拟主机的用户授予权限,请如下配置
# rabbitmqctl set_permissions [-p vhost] [user] [permission ? (modify) (write) (read)]
[root@vdevops ~]# rabbitmqctl set_permissions -p /my_vhost linuxprobe ".*" ".*" ".*"
Setting permissions for user "linuxprobe" in vhost "/my_vhost" ...
...done.
#
[root@vdevops ~]#rabbitmqctl list_user_permissions linuxprobe
Listing permissions for user "linuxprobe" ...
/my_vhost.*.*.*
...done.
# deleting permission of a specific user is like follows
[root@vdevops ~]# rabbitmqctl clear_permissions -p /my_vhost linuxprobe
Clearing permissions for user "linuxprobe" in vhost "/my_vhost" ...
...done.
RabbitMQ:使用Web UI
[root@vdevops ~]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
[root@vdevops ~]# systemctl restart rabbitmq-server
客户端访问
rabbitmqadmin使用
可以配置RabbitMQ使用rabbitmqadmin命
在Web UI上下载rabbitmqadmin 。登录到Web UI并移动到“http://(主机名或IP地址):15672 /
cli”,然后显示以下屏幕,您可以在这里下载rabbitmqadmin,点击here右键保存rabbitmqadmin.txt,然后上传到服务器上面更改为rabbitmqadmin,并添加执行权限
将rabbitmqadmin上传到RabbitMQ服务器并设置合适的权限,此示例显示如下设置
[root@localhost ~]# ll /usr/local/bin/rabbitmqadmin
-rwxr-xr-x. 1 root root 36112 Nov 11 17:23 /usr/local/bin/rabbitmqadmin
[root@vdevops bin]# rabbitmqadmin list users
+------------+------------------------------+---------------+
|name|password_hash|tags|
+------------+------------------------------+---------------+
| guest| k2rhpzCrZBKkY5WRhUWrGm5DCkg= | administrator |
| linuxprobe | P+YxK1QXIYrJpek5i//rPjn5SME= | administrator |
+------------+------------------------------+---------------+
[root@vdevops bin]# cd
[root@vdevops ~]# rabbitmqadmin list users
+------------+------------------------------+---------------+
|name|password_hash|tags|
+------------+------------------------------+---------------+
| guest| k2rhpzCrZBKkY5WRhUWrGm5DCkg= | administrator |
| linuxprobe | P+YxK1QXIYrJpek5i//rPjn5SME= | administrator |
+------------+------------------------------+---------------+
[root@vdevops ~]# rabbitmqadmin list vhosts
+-----------+---------+
|name| tracing |
+-----------+---------+
| /| False|
| /my_vhost | False|
+-----------+---------+
详细可以参考
linux安装mq7.5linux安装mq7.5
1.上传介质
WS_MQ_LINUX_ON_X86_64_7.5.0.2_IMG.tar.gz

推荐阅读