Centos7 RabbitMQ installation environment

1 RabbitMQ concept

MQFull 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-Labdevelopment, 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: wgetThe version is too low, it is recommended to update wgetthe 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.7a direct implementation of the above will get an error:
Here Insert Picture Description
there is a problem: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try againthe need to install epelsource

Solution: put /etc/yum.repos.d/epel.repothe 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 DNSto the /etc/resolv.confnext add this:

nameserver 8.8.8.8
search localdomain
然后重启network服务:service network restart

For not Centos 6.7being given to resolve:
If cd /var/cache/yum/x86_64/6/there is a folder erlang-solutionscan be solved as follows:
need the following:

  • cd /var/cache/yum/x86_64/6/erlang-solutions
  • Modifying primary.xml.gzthe shaencrypted valueHere Insert Picture Description
  • sha1sum primary.xml.gzIt will return an encrypted string after Here Insert Picture Description
  • vim repomd.xmlIn repomd.xmlthe modification <data type="primary"> <checksum type="sha">results sha1sum command results</checksum>
  • Finally, the implementation of yum install erlangit

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:
Here Insert Picture Description

3.4 ip remote login settings RabbitMQ

Here we have to create a rabbitmqusername, 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:15672browser: . Which serveripis the RabbitMQ-Serverip 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 hostsmodifications to/
    Here Insert Picture Description

3.6.2 Centos7 change the host name in two places consistent

For Centos7To modify the host name remains, then use hostnamectl
Here Insert Picture Description
as well as in /etc/hoststhis document have to change it
Here Insert Picture Description
注意:if rabbitmqstarted for a long time, or close for a long time, indicating that the host name is inconsistent, which led to javathe connection will be timed out

Published 334 original articles · won praise 186 · views 310 000 +

Guess you like

Origin blog.csdn.net/u012060033/article/details/104209301