In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to install RabbitMQ in CentOS7". In daily operation, I believe many people have doubts about how to install RabbitMQ in CentOS7. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts about "how to install RabbitMQ in CentOS7"! Next, please follow the small series to learn together!
RabbitMQ is a message queue used for common process communication. It supports point-to-point, request-response and publish-subscribe modes and provides support for multiple languages. Java, C#, PHP are supported. Often used in asynchronous processing, decoupling is applied. In complex business scenarios such as traffic peak elimination, it belongs to message middleware like java kafka.
Minimum CentOS 7 server root privileges This guide was written as root, if logged in as sudo, run sudo -i. Update basic system
Before installing any packages, it is recommended that you update packages and repositories using the following command.
yum -y update
After updating the system, install Erlang further.
Install Erlang
RabbitMQ is written in the Erlang language, and in this tutorial we will install the latest version of Erlang on the server. Erlang is not available in the default YUM repository, so you will need to install the EPEL repository. Running the following command is the same.
yum -y install epel-releaseyum -y update
Now install Erlang using the following command.
yum -y install erlang socat
You can now check the Erlang version using the following command.
erl -version
You will get the following output.
[root@liptan-pc ~]# erl -versionErlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 5.10.4
To switch to the Erlang shell, type the following command.
erl
The shell will change and you will get the following output.
Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]Eshell V5.10.4 (abort with ^G)1>
You can exit the shell by pressing ctrl + C twice. Erlang is now installed on the system and RabbitMQ can now be installed.
Install RabbitMQ
RabbitMQ provides RPM packages for pre-compiled, ready-to-install enterprise Linux systems. The only dependency required is to install Erlang into the system. We have Erlang installed and we can download RabbitMQ further. Download the Erlang RPM package by running it.
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm
If you don't have wget installed, run yum -y install wget. You can always find a link to the latest version of RabbitMQ download page.
Import the GPG key by running:
rpm –import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
Run RPM Install RPM package:
rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm
RabbitMQ is now installed on your system.
Start RabbitMQ
You can start the RabbitMQ server process by running the following command.
systemctl start rabbitmq-server
To automatically start RabbitMQ at boot time, run the following command.
systemctl enable rabbitmq-server
To check the status of RabbitMQ servers, run:
systemctl status rabbitmq-server
If the startup is successful, you should get the following output.
? rabbitmq-server.service - RabbitMQ broker Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2017-07-15 18:59:14 UTC; 3min 22s agoMain PID: 29006 (beam.smp) Status: "Initialized" CGroup: /system.slice/rabbitmq-server.service ?? 29006 /usr/lib64/erlang/erts-9.0/bin/beam.smp -W w -A 64 -P 1048576 -t 5000000 -stbt db -zdbbl 32000 -K tr... ?? 29149 /usr/lib64/erlang/erts-9.0/bin/epmd -daemon ?? 29283 erl_child_setup 1024 ?? 29303 inet_gethost 4 ?? 29304 inet_gethost 4Jul 15 18:59:13 centos rabbitmq-server[29006]: Starting broker... Jul 15 18:59:14 centos rabbitmq-server[29006]: systemd unit for activation check: "rabbitmq-server.service"Jul 15 18:59:14 centos systemd[1]: Started RabbitMQ broker.Jul 15 18:59:14 centos rabbitmq-server[29006]: completed with 0 plugins.
If you have a firewall installed and running, port 8161 must be allowed through the firewall. Running the following command is the same.
firewall-cmd –zone=public –permanent –add-port=4369/tcpfirewall-cmd –zone=public –permanent –add-port=25672/tcpfirewall-cmd –zone=public –permanent –add-port=5671-5672/tcpfirewall-cmd –zone=public –permanent –add-port=15672/tcpfirewall-cmd –zone=public –permanent –add-port=61613-61614/tcpfirewall-cmd –zone=public –permanent –add-port=1883/tcpfirewall-cmd –zone=public –permanent –add-port=8883/tcpfirewall-cmd –reload
If you enable SELinux, you must run the following command to allow RabbitMQ services.
setsebool -P nis_enabled 1 Access the Web console
Start the RabbitMQ Web administration console by running:
rabbitmq-plugins enable rabbitmq_management
Give ownership of RabbitMQ files to RabbitMQ users by running:
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/
You will now need to create administrative users for the RabbitMQ Web administration console. Running the following command is the same.
rabbitmqctl add_user admin StrongPasswordrabbitmqctl set_user_tags admin administratorrabbitmqctl set_permissions -p / admin ".* " ".* " ".* "
Change Administrator to the preferred user name of the Administrator user. Make sure to change StrongPassword to a very strong password.
To access RabbitMQ's admin panel, use your favorite Web browser and open the following URL.
http://Your_Server_IP:15672/
You will see the following login page.
After logging in, you will see the Management Information Center.
You can find user lists, virtual hosts, and policies in the dashboard's "Administration" tab. You should remove security precautions for guest users.
You can find a list of message queues in the Queue tab. This interface allows you to create new queues or delete existing queues.
You can find a list of current connections on the Connections tab
Similarly, you can find channels and exchanges on their respective tabs.
At this point, the study of "how to install RabbitMQ in CentOS7" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.