yum install rabbitMQ

 

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

 
After the installation is complete, run:

Successful installation.
 

2. Install RabbitMQ

 
Download RabbitMQ rpm: wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el6.noarch.rpm
 
yum -y install rabbitmq-server-3.6.6-1.el6.noarch.rpm
 
Note:
 
If reported: Requires: socat
 
Update source wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo
yum install socat

Start the rabbitmq service:   

Running in the foreground: rabbitmq-server start (after the user closes the connection, the process is automatically terminated)  

Running in the background: rabbitmq-server -detached 

 

3. Install the plugin

 
Start the web management interface
rabbitmq-plugins enable rabbitmq-management
 
Add access users, the default user guest can only access locally.
rabbitmqctl add_user admin 123456
 
Set roles:
 
rabbitmqctl set_user_tags admin administrator
 
Set default vhost ("/") access
rabbitmqctl set_permissions -p “/” admin “.” “.” “.*”
 
Browser access: http://IP:15672
 
Username admin, password 123456 to log in

 

 If you encounter problems, please refer to: http://blog.csdn.net/qq315737546/article/details/53105418

 script

copy code
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 "." "." ".*"
copy code

 

 

 

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

 
What if I want to log in remotely? For security reasons, the default user of guest can only log in through http://localhost:15672, and other IPs cannot directly use this guest account. Here we can use the configuration file to log in to the management interface remotely, just edit the /etc/rabbitmq/rabbitmq.config file (add it if it is not available), and add the following configuration.
 

{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 ".*" ".*" ".*"

 

 
In fact, you can also directly add information such as users and passwords through the management platform page. If you can't access or log in remotely, check whether the port 5672 or 15672 is not open! ! ! ! ! !

 

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

rabbitmqctl  list_users

 

 
Category:  rabbitMQ

 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

 
After the installation is complete, run:

Successful installation.
 

2. Install RabbitMQ

 
Download RabbitMQ rpm: wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el6.noarch.rpm
 
yum -y install rabbitmq-server-3.6.6-1.el6.noarch.rpm
 
Note:
 
If reported: Requires: socat
 
Update source wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo
yum install socat

Start the rabbitmq service:   

Running in the foreground: rabbitmq-server start (after the user closes the connection, the process is automatically terminated)  

Running in the background: rabbitmq-server -detached 

 

3. Install the plugin

 
Start the web management interface
rabbitmq-plugins enable rabbitmq-management
 
Add access users, the default user guest can only access locally.
rabbitmqctl add_user admin 123456
 
Set roles:
 
rabbitmqctl set_user_tags admin administrator
 
Set default vhost ("/") access
rabbitmqctl set_permissions -p “/” admin “.” “.” “.*”
 
Browser access: http://IP:15672
 
Username admin, password 123456 to log in

 

 If you encounter problems, please refer to: http://blog.csdn.net/qq315737546/article/details/53105418

 script

copy code
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 "." "." ".*"
copy code

 

 

 

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

 
What if I want to log in remotely? For security reasons, the default user of guest can only log in through http://localhost:15672, and other IPs cannot directly use this guest account. Here we can use the configuration file to log in to the management interface remotely, just edit the /etc/rabbitmq/rabbitmq.config file (add it if it is not available), and add the following configuration.
 

{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 ".*" ".*" ".*"

 

 
In fact, you can also directly add information such as users and passwords through the management platform page. If you can't access or log in remotely, check whether the port 5672 or 15672 is not open! ! ! ! ! !

 

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

rabbitmqctl  list_users

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325298412&siteId=291194637