Table of contents
1. The RabbitMQ server needs to install erlang before installation.
Method 1: rpm package installation method
Method 2: Source code installation method
4. Download the RabbitMQ rpm installation package
Six, rabbitmq and erlang uninstall
View error log command: journalctl -xe
问题1:ERROR: epmd error for host 192: badarg (unknown POSIX error)
问题2: /usr/sbin/rabbitmq-server: line 16: /usr/sbin/rabbitmq-env: No such file or directory
问题3、/usr/lib/rabbitmq/bin/rabbitmq-env: line 179: exec: erl: not found
rabbitmq /usr/lib/rabbitmq/bin/rabbitmq-server: line 85: erl: command not found
问题4、error: Failed dependencies: erlang >= 23.2 is needed by rabbitmq-server-3.8.
1. The RabbitMQ server needs to install erlang before installation.
For the dependencies between specific versions, please check the official website, RabbitMQ Erlang Version Requirements — RabbitMQ
Here are some examples:
Two, erlang installation
Method 1: rpm package installation method
- Download the Erlang
rpm
installation packageRPM
Download package version address: rabbitmq/erlang - Packages · packagecloud
Select the corresponding version of the erlang package that meets the dependencies, el/7, and the number 7 represents the system version.
Click the link to enter the detailed page and get the download link:
wget --content-disposition https://packagecloud.io/rabbitmq/erlang/packages/el/7/erlang-23.3.4.11-1.el7.x86_64.rpm/download.rpm
Select a directory file to store the current rpm, which is placed /usr/local/rabbitMQ/
under the folder
cd /usr/local/rabbitmq/
# 安装
rpm -ivh erlang-23.3.4.11-1.el7.x86_64.rpm
# 查看版本
erl -v
Method 2: Source code installation method
1. First install some required dependencies:
yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget
2. Download the corresponding version of Erlang
If the online download is too slow, you can pre-download it elsewhere and upload it to the server
3. Unzip, compile and install
cd /usr/local
mkdir erlang
tar -zxvf otp_src_24.0.tar.gz
cd otp_src_24.0
./configure --prefix=/usr/local/erlang
This process may take a long time. If there is an err in the configure process, to solve the dependency problem, info and warn will have no effect.
If there is APPLICATIONS INFORMATION, DOCUMENTATION INFORMATION, it has no effect.
make && make install
This process may take a long time, if there is a prompt that other dependent packages are missing, follow the prompts to install
yum install -y 缺少的依赖xxx
4. Configure environment variables and compile to take effect
After the installation is complete, configure the environment variable /etc/profile
vim /etc/profile
Add a line at the end
#erlang
export PATH=$PATH:/usr/local/erlang/bin
wq save and exit
Compilation takes effect
source /etc/profile
5. Verify that Erlang is installed successfully
Enter erl, the version information will appear, that is, the installation is successful
# erl -v
Exit the erlang command line:
halt().
3. Download and install socat
[socat download address]: RPM resource socat(x86-64)
After downloading, go to the download directory and execute the following command:
# 安装命令
rpm -ivh socat-1.7.3.2-2.el7.x86_64.rpm
4. Download the RabbitMQ rpm installation package
[rabbitmq download address]: Releases · rabbitmq/rabbitmq-server · GitHub
or address:
GitHub - rabbitmq/rabbitmq-server: Open source RabbitMQ: core server and tier 1 (built-in) plugins
安装命令
# rpm -ivh rabbitmq-server-3.8.26-1.el7.noarch.rpm
5. Start rabbitmq
1、
# 启动rabbitmq
systemctl start rabbitmq-server
# 查看rabbitmq状态
systemctl status rabbitmq-server
2、 配置用户和权限
rabbitmqctl list_users
rabbitmqctl add_user root 123456
rabbitmqctl set_permissions -p "/" root ".*" ".*" ".*"
rabbitmqctl delete_user guest
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl change_password root '123456'
rabbitmqctl set_user_tags root administrator
/etc/rabbitmq/rabbitmq.config will be created automatically when it is opened for the first time, just enter the content directly in it.
3、 配置外部访问
vi /etc/rabbitmq/rabbitmq.config
修改所在行如下图所示
[{rabbit,[{loopback_users,[]}]}].
Six, rabbitmq and erlang uninstall
1. Uninstall rabbitmq
Stop the rabbitmq service before uninstalling
service rabbitmq-server stop
View the related list of rabbitmq installations
yum list | grep rabbitmq
Uninstall the related content that rabbitmq has installed
yum -y remove rabbitmq-server.noarch
2. Uninstall erlang
See related list of erlang installations
yum list | grep erlang
Uninstall the related content that erlang has installed
yum -y remove erlang-*
yum remove erlang.x86_64
7. Possible problems:
View error log command: journalctl -xe
# journalctl -xe
Question 1:ERROR: epmd error for host 192: badarg (unknown POSIX error)
ERROR: epmd error for host "77":badarg (unknown POSIX error)
Solution: Edit: add a line to vi /etc/rabbitmq/rabbitmq-env.conf
# vi /etc/rabbitmq/rabbitmq-env.conf
Add this line in the file: NODENAME=rabbit@localhost, save (note: the rabbitmq-env.conf file does not exist, it will be created automatically after opening)
NODENAME=rabbit@localhost
As shown below:
Start again: service rabbitmq-server start
# service rabbitmq-server start
Started successfully!
问题2: /usr/sbin/rabbitmq-server: line 16: /usr/sbin/rabbitmq-env: No such file or directory
Solution: These problems are due to the lack of certain environment configuration files during installation. You only need to use the which command and the find command to find the corresponding file and copy it to the corresponding location, or create a soft link directly.
For example: the error is missing the rabbitmq-env file, let's find out where the existing file is
# which rabbitmq-env
Or search in the root directory to find the file information missing in the error report, and after getting the path of the file, copy the file to the required directory
find / -name rabbitmq*
You can copy the following file to the missing directory where the error was reported, and restart.
启动rabbitmq
service rabbitmq-server start
问题3、/usr/lib/rabbitmq/bin/rabbitmq-env: line 179: exec: erl: not found
rabbitmq /usr/lib/rabbitmq/bin/rabbitmq-server: line 85: erl: command not found
Solution: These problems are caused by the installation of the erlang package. After installation, the environment variables are not configured properly. For this step, see the erlang installation content in step 2 for details.
Query the erlang version: If you can find the erlang version, this kind of problem will basically not occur.
# erl -v
Exit the erlang command line:
halt().
问题4、error: Failed dependencies: erlang >= 23.2 is needed by rabbitmq-server-3.8.
Solution: This kind of problem is the dependency problem encountered when installing the rabbitmq-server-xx.rpm package, just add --nodeps at the end to remove the dependency installation
For example:
# rpm -ivh rabbitmq-server-3.8.26-1.el7.noarch.rpm --nodeps
Start the rabbitmq
service rabbitmq-server start
-------------------------------------------------- ---------------------------------------- No text below ------- -------------------------------------------------- --
Note: For study only, record questions and reference, encourage each other!
Reference article:
2. Install RabbitMQ and erlang in centos7_Program Factory Blog-CSDN Blog
3. Install rabbitmq mining pit on CentOS7.5 - short book
4. Linux Environment RabbitMQ Installation Tutorial - Bug Destroyer - Blog Garden