公众号:架构师与哈苏
关注公众号进入it交流群! 公众号:架构师与哈苏 不定时都会推送一些实用的干货。。。

github rpm地址:

https://github.com/rabbitmq/erlang-rpm

要安装rabbitmq先安装它的语言 创建erlang repo

/etc/yum.repos.d/rabbitmq-erlang.repo

# In /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1

刷新缓存

yum clean all
yum makecache

安装erlang

yum install erlang

出现问题:

  / rpm -ivh erlang-22.3-1.el7.x86_64.rpm
准备中...                          ################################# [100%]
	file /usr/lib64/erlang/bin/epmd from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/erl from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/erlc from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/escript from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/run_erl from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/to_erl from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/no_dot_erlang.boot from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/start from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/start.boot from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/start.script from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/start_clean.boot from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/start_erl from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/bin/start_sasl.boot from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/driver_int.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_driver.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_drv_nif.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_fixed_size_int_types.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_int_sizes_config.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_memory_trace_parser.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_nif.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_nif_api_funcs.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/lib/liberts.a from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/lib/liberts_r.a from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/ei.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/ei_connect.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/eicode.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/include/erl_interface.h from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/lib/libei.a from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/lib/libei_st.a from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/lib/liberl_interface.a from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/usr/lib/liberl_interface_st.a from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/releases/RELEASES from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/releases/RELEASES.src from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64
	file /usr/lib64/erlang/releases/start_erl.data from install of erlang-22.3-1.el7.x86_64 conflicts with file from package erlang-erts-R16B-03.18.el7.x86_64

解决方案:
删除旧的erlang其他依赖

yum remove erlang-erts-R16B-03.18.el7.x86_64

安装rabbitmq

vim /etc/yum.repos.d/rabbitmq.repo

[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/7/
gpgcheck=0
repo_gpgcheck=0
enabled=1

刷新缓存

yum clean all
yum makecache

安装rabbitmq命令

yum install rabbitmq-server

查询rabbitmq状态

systemctl status rabbitmq-server

创建开机自启动

systemctl enable rabbitmq-server

启动rabbitmq的web管理后台界面命令

rabbitmq-plugins enable rabbitmq_management

服务地址:

http://{node-hostname}:15672/

默认账号:guest 密码:guest

image.png

只能 localhost,修改配置允许远程访问:
没有配置文件创建配置文件:
vim /etc/rabbitmq/rabbitmq.config
经典格式

# DANGER ZONE!
#
# allowing remote connections for default user is highly discouraged
# as it dramatically decreases the security of the system. Delete the user
# instead and create a new one with generated secure credentials.
loopback_users = none

新格式

%% DANGER ZONE!
%%
%% Allowing remote connections for default user is highly discouraged
%% as it dramatically decreases the security of the system. Delete the user
%% instead and create a new one with generated secure credentials.
[{rabbit, [{loopback_users, []}]}].

也可以修改下面文件:

vim /usr/lib/rabbitmq/lib/rabbitmq_server-3.8.3/ebin/rabbit.app

找到{loopback_users, [<<"guest">>]},
修改为{loopback_users, []},

新增用户 账号:admin 密码:

rabbitmqctl add_user admin pwd

分配角色 超级管理员

rabbitmqctl set_user_tags admin administrator

更改密码

rabbitmqctl change_password admin 123456

重启
systemctl restart rabbitmq-server

springBoot 启动找不到挂载点,进入web后台设置挂载点

image.png

我遇到的服务起不来,配置被我玩坏了,解决方案

Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
服务起不来:
有一种解决版本是将“/var/lib/rabbitmq/mnesia/”目录下的所有内容删掉(rm -rf *),然后重新启动再配置。

posted on 2020-09-18 12:13  公众号/架构师与哈苏  阅读(314)  评论(0)    收藏  举报