Installation of RabbitMQ under Linux [Extreme Edition]
First of all, let me explain that the Linux version we are using here is CentOS7. For related content, you can refer to my previous blog:
VMware download, installation and creation of virtual machine
VMware installation Centos7 ultimate step-by-step detailed graphic process.
At the end of the above, there are instructions for downloading and installing Xshell.
1. Download the required installation files
Directly attach the resource link (zip). No points are required. You can download it directly. Because it is a speed version, only one version is uploaded here. The latest version so far is 3.8.9, and the version in the link is 3.6.5. (If you want to download related installation resources by yourself, you can refer to the detailed installation version)
Download link: https://download.csdn.net/download/cjl836735455/13118790
There are mainly three files in the compressed package:
- erlang installation package
light-18.3-1.el7.centos.x86_64.rpm - socat installation package
socat-1.7.3.2-1.1.el7.x86_64.rpm - rabbitmq installation package
rabbitmq-server-3.6.5-1.noarch.rpm
2. Start installation
- Upload the installation file we decompressed to linux
Here we use a file upload tool: [Linux] 1. How does Xshell connect to a virtual machine to implement file upload?
There are many file upload tools. I will just bring out one. As long as it can upload quickly, it will be OK.
- Online installation of dependent environments
yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel tk tc xz
- Install Erlang
rpm -ivh erlang-18.3-1.el7.centos.x86_64.rpm
I made no mistakes here, but please note that if the following error occurs (Yes, you can skip this step):
indicates that the gblic version is too low. We can check the gblic version of the current machine with the following statement:
strings /lib64/libc.so.6 | grep GLIBC
Then upgrade the corresponding gblic according to the version prompted in the error message. For example, the error message in the picture says that
glibc needs to be upgraded to version 2.15 :
1.使用yum更新安装依赖
sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make -y
2.下载rpm包
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-utils-2.17-55.el6.x86_64.rpm & wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-static-2.17-55.el6.x86_64.rpm & wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm & wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm & wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm & wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm & wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/nscd-2.17-55.el6.x86_64.rpm &
3.安装rpm包
sudo rpm -Uvh *-2.17-55.el6.x86_64.rpm --force --nodeps
4.查看安装后的版本
strings /lib64/libc.so.6 | grep GLIBC
- Install socat
rpm -ivh socat-1.7.3.2-1.1.el7.x86_64.rpm --force --nodeps
- Install RabbitMQ
rpm -ivh rabbitmq-server-3.6.5-1.noarch.rpm
3. Configuration and startup testing
- RabbitMQ comes with a web management interface plug-in. We only need to enable it in the configuration.
rabbitmq-plugins enable rabbitmq_management
A failed was reported here, which is not in the way, because we opened the plug-in when rabbitmq was not started, and it prompted us that the changes will take effect after restarting. From the enabled above, we can see that our rabbitmq_management plug-in has been enabled.
- Next, we modify some default configuration information, such as passwords, configurations, etc., such as modifying user information: <<"guest">> in loopback_users, only retaining guest, indicating that user guest is enabled
vim /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/ebin/rabbit.app
Modify the initial user guest.
I installed the mini version here. You need to install vim yourself. If there is a prompt vim: command not found, friends can refer to this blog to download: vim: command not found in linux
. We scroll down to find loopback_users, and then Change <<"guest">> to guest and save.
- Come down and set the configuration file.
There is no default configuration file in the rpm version, but there will be a template configuration file. We don’t have any special configuration properties that need to be modified now, so we only need to copy the template configuration file to rabbitmq. Just go to the configuration file directory. If you need to modify the configuration in the future, just modify it directly above.
Enter the directory where the template configuration file is placed:
cd /usr/share/doc/rabbitmq-server-3.6.5/
Next we copy it to the directory where the configuration file is read, and modify the name at the same time:
cp rabbitmq.config.example /etc/rabbitmq/rabbitmq.config
Then we can see this configuration file
- rabbitmq basic commands
service rabbitmq-server start # Start service
service rabbitmq-server stop # Stop service
service rabbitmq-server restart # Restart service
Let's start rabbitmq, use its own user guest/guest, log in and visit http://ip address:15672 to access the
page:
If the page cannot be accessed, please turn off the Linux firewall: Common commands such as opening the Linux firewall and viewing ports
Login successful:
OK, you're done.