Install RabbitMQ
- http://www.rabbitmq.com/releases/rabbitmq-server/
- 1. Download RabbitMQ
- Official download address http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix-3.6.1.tar.xz
2. To install
RabbitMQ3.6 version, it can be used without make, make install and decompression
#解压rabbitmq,官方给的包是xz压缩包,所以需要使用xz命令
xz -d rabbitmq-server-generic-unix-3.6.1.tar.xz
#xz解压后得到.tar包,再用tar命令解压
tar -xvf rabbitmq-server-generic-unix-3.6.1.tar #移动目录 看个人喜好 cp -rf ./rabbitmq_server-3.6.1 /usr/local/ cd /usr/local/ #修改文件夹名 mv rabbitmq_server-3.6.1 rabbitmq-3.6.1 #开启管理页面插件 cd ./rabbitmq-3.6.1/sbin/ ./rabbitmq-plugins enable rabbitmq_management
Environment: linux centos6.5
1. Install erlang
Download the rpm repository: wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
Install rpm repository
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
install erlang
yum -y install erlang
2. Install RabbitMQ
Start the rabbitmq service:
Running in the foreground: rabbitmq-server start (after the user closes the connection, the process is automatically terminated)
3. Install the plugin
If you encounter problems, please refer to: http://blog.csdn.net/qq315737546/article/details/53105418
script
start service sudo service rabbitmq-server {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload} Usage: /etc/init.d/rabbitmq-server {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload} Install plugin sudo rabbitmq-plugins enable rabbitmq_management create user sudo rabbitmqctl add_user admin ucsmy1234 Set roles: sudo rabbitmqctl set_user_tags admin administrator Setting permissions sudo rabbitmqctl set_permissions -p "/" admin "." "." ".*"
4. Ok, here rabbitmq has been configured and can be started:
- Let's take a look at the default listening port 5672 of rabbitmq:
- #netstat -tnlp|grep 5672
- It is best to enter http://ip:15672/ on the browser to log in to the management interface:
- The username and password used to log in are considered as a guest by default. The login page is as follows:
- To access rabbitmq from another machine (that is, outside of this machine), you need to open port 15672
- #vi /etc/sysconfig/iptables Add port 15672. Then restart service iptables restart
5. Add a remote management account
{rabbit, [{tcp_listeners, [5672]}, {loopback_users, ["asdf"]}]}
].
Now a new authorized user asdf has been added, which can be used remotely. Remember to add this command with the command first:
$ cd /usr/lib/rabbitmq/bin/ #username and password $ sudo rabbitmqctl add_user asdf 123456 #Users are set to administrator to access remotely $ sudo rabbitmqctl set_user_tags asdf administrator $ sudo rabbitmqctl set_permissions -p / asdf ".*" ".*" ".*"
6. User Management
User management includes adding users, deleting users, viewing user lists, and changing user passwords.
Corresponding commands
(1) Add a user
rabbitmqctl add_user Username Password
(2) Delete a user
rabbitmqctl delete_user Username
(3) Modify the user's password
rabbitmqctl change_password Username Newpassword
(4) View the current user list
Environment: linux centos6.5
1. Install erlang
Download the rpm repository: wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
Install rpm repository
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
install erlang
yum -y install erlang
2. Install RabbitMQ
Start the rabbitmq service:
Running in the foreground: rabbitmq-server start (after the user closes the connection, the process is automatically terminated)
3. Install the plugin
If you encounter problems, please refer to: http://blog.csdn.net/qq315737546/article/details/53105418
script
start service sudo service rabbitmq-server {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload} Usage: /etc/init.d/rabbitmq-server {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload} Install plugin sudo rabbitmq-plugins enable rabbitmq_management create user sudo rabbitmqctl add_user admin ucsmy1234 Set roles: sudo rabbitmqctl set_user_tags admin administrator Setting permissions sudo rabbitmqctl set_permissions -p "/" admin "." "." ".*"
4. Ok, here rabbitmq has been configured and can be started:
- Let's take a look at the default listening port 5672 of rabbitmq:
- #netstat -tnlp|grep 5672
- It is best to enter http://ip:15672/ on the browser to log in to the management interface:
- The username and password used to log in are considered as a guest by default. The login page is as follows:
- To access rabbitmq from another machine (that is, outside of this machine), you need to open port 15672
- #vi /etc/sysconfig/iptables Add port 15672. Then restart service iptables restart
5. Add a remote management account
{rabbit, [{tcp_listeners, [5672]}, {loopback_users, ["asdf"]}]}
].
Now a new authorized user asdf has been added, which can be used remotely. Remember to add this command with the command first:
$ cd /usr/lib/rabbitmq/bin/ #username and password $ sudo rabbitmqctl add_user asdf 123456 #Users are set to administrator to access remotely $ sudo rabbitmqctl set_user_tags asdf administrator $ sudo rabbitmqctl set_permissions -p / asdf ".*" ".*" ".*"
6. User Management
User management includes adding users, deleting users, viewing user lists, and changing user passwords.
Corresponding commands
(1) Add a user
rabbitmqctl add_user Username Password
(2) Delete a user
rabbitmqctl delete_user Username
(3) Modify the user's password
rabbitmqctl change_password Username Newpassword
(4) View the current user list