Article Directory
- 1 RabbitMQ concept
- 2 Installation Rabbit
- 2.1 Erlang
- RabbitMQ Server 2.2 installation
- 2.3 Starting RabbitMQ
- 3 install the Web management interface plug-in
1 RabbitMQ concept
MQ
Full name MessageQueue
, message queue ( MQ
) is an application communication method according to the application. Applications to communicate through the message read out of the queue, without the need for a dedicated link to link them. Refers to message passing communication between a program in the data message transmitted by, rather than through direct calls to communicate with each other, it is a technique commonly called directly, such as remote procedure calls. It refers to the application queue by the queue to communicate. It removed using a queue and transmission requirements received concurrently executing applications.
2 Installation Rabbit
The overall environment:Centos 7
2.1 Erlang
2.1.1 What is Erlang
Erlang(['ə:læŋ])
Is a universal language for concurrent programming, which consists of Swedish telecoms equipment maker Ericsson under the jurisdiction of CS-Lab
development, aims to create a way to deal with large-scale programming language and runtime environment concurrent activities
2.1.2 install erlang
2.1.2.1 Download erlang
Ready to install, download the installation files
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
may error:
- Error message:
Unable to establish SSL connection
- Solution:
wget
The version is too low, it is recommended to updatewget
the version update for wget command:yum update wget
2.1.2.2 upgrade erlang
Upgrade installed software:
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
possible error:
error: Failed dependencies: epel-release is needed by erlang-solutions-1.0-1.noarch
- solve:
yum install epel-release
2.1.2.3 Installation
Installation command: yum install erlang
注意:
If it is Centos6.7
a direct implementation of the above will get an error:
there is a problem: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
the need to install epel
source
Solution: put /etc/yum.repos.d/epel.repo
the file on 3
-line comments 去掉
, the fourth line 注释掉
. details as follows:
打开/etc/yum.repos.d/epel.repo,将
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
修改为
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
If that does not work, change DNS
to the /etc/resolv.conf
next add this:
nameserver 8.8.8.8
search localdomain
然后重启network服务:service network restart
For not Centos 6.7
being given to resolve:
If cd /var/cache/yum/x86_64/6/
there is a folder erlang-solutions
can be solved as follows:
need the following:
cd /var/cache/yum/x86_64/6/erlang-solutions
- Modifying
primary.xml.gz
thesha
encrypted value sha1sum primary.xml.gz
It will return an encrypted string aftervim repomd.xml
Inrepomd.xml
the modification<data type="primary"> <checksum type="sha">
results sha1sum command results</checksum>
- Finally, the implementation of
yum install erlang
it
2.1.2.4 see if the installation was successful
erl -version
RabbitMQ Server 2.2 installation
RabbitMQ Server 2.2.1 Download
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.5.1/rabbitmq-server-3.5.1-1.noarch.rpm
If the download fails, do not download or down, enter the download link in a browser, and then import into, and can also be
2.2.2 import and install secret key
Import keys: rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
Installation:yum install rabbitmq-server-3.5.1-1.noarch.rpm
2.3 Starting RabbitMQ
2.3.1 adding boot from Kai
chkconfig rabbitmq-server on
2.3.2 Management rabbitMQ Service
- start up:
/sbin/service rabbitmq-server start
- shut down:
/sbin/service rabbitmq-server stop
- Restart:
/sbin/service rabbitmq-server restart
3 install the Web management interface plug-in
3.1 installation command
rabbitmq-plugins enable rabbitmq_management
After a successful installation 3.2 Content
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.
3.3 Detection mounted state
rabbitmqctl status
as follows:
3.4 ip remote login settings RabbitMQ
Here we have to create a rabbitmq
username, password 123456
, for example, create an account and supports remote ip access.
3.4.1 Create an account
rabbitmqctl add_user rabbitmq 123456
3.4.2 Set User Role
rabbitmqctl set_user_tags rabbitmq administrator
3.4.3 Set user rights
rabbitmqctl set_permissions -p "/" rabbitmq ".*" ".*" ".*"
3.4.4 View current users and roles
rabbitmqctl list_users
3.5 Login
Enter the serverip:15672
browser: . Which serverip
is the RabbitMQ-Server
ip host host.
3.6 java call connection refused
3.6.1 User name Password wrong
Error:
ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
Solution:
- Under carefully check the account password is correct
- After logging in to the following
Can access virtual hosts
modifications to/
3.6.2 Centos7 change the host name in two places consistent
For Centos7
To modify the host name remains, then use hostnamectl
as well as in /etc/hosts
this document have to change it
注意:
if rabbitmq
started for a long time, or close for a long time, indicating that the host name is inconsistent, which led to java
the connection will be timed out