CentOS 7下安装RabbitMQ
安装erlang
由于rabbitmq是基于erlang语言开发的,所以必须先安装erlang
erlang官网:https://www.erlang.org/downloads
注意事项:erlang的版本会影响到rabbitmq的安装,两者有个版本对照
查看对照的地址:http://www.rabbitmq.com/which-erlang.html
安装依赖
yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget gtk2-devel binutils-devel
安装erlang
wget http://erlang.org/download/otp_src_23.0.tar.gz #下载(会比较慢,请耐心等待)
tar -zxf otp_src_23.0.tar.gz
cd otp_src_23.0
./configure --prefix=/usr/local/erlang
make
make install
如果configure
遇到这个错,可忽略
configure: creating x86_64-unknown-linux-gnu/config.status
config.status: creating config.mk
config.status: creating c_src/Makefile
configure: WARNING: No GLU headers found, wx will NOT be usable
./configure: line 4659: wx-config: command not found
configure: WARNING:
wxWidgets must be installed on your system.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' or 'wx-config --static --libs' command)
is in LD_LIBRARY_PATH or equivalent variable and
wxWidgets version is 2.8.4 or above.
*********************************************************************
********************** APPLICATIONS DISABLED **********************
*********************************************************************
jinterface : No Java compiler found
odbc : ODBC library - link check failed
*********************************************************************
*********************************************************************
********************** APPLICATIONS INFORMATION *******************
*********************************************************************
wx : No GLU headers (glu.h) found, wx will NOT be usable
wxWidgets not found, wx will NOT be usable
*********************************************************************
*********************************************************************
********************** DOCUMENTATION INFORMATION ******************
*********************************************************************
documentation :
fop is missing.
Using fakefop to generate placeholder PDF files.
*********************************************************************
校验erlang
查看一下是否安装成功
ll /usr/local/erlang/bin
添加环境变量
echo 'export PATH=$PATH:/usr/local/erlang/bin' >> /etc/profile
刷新环境变量
source /etc/profile
甩一条命令
erl
瞬间进入了一个未知的世界
# erl
Erlang/OTP 23 [erts-11.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]
Eshell V11.0 (abort with ^G)
1>
在里面输入halt().
命令退出来(那个点号别忘记)
# erl
Erlang/OTP 23 [erts-11.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]
Eshell V11.0 (abort with ^G)
1> halt().
#
安装RabbitMQ
rabbitmq官网:http://www.rabbitmq.com/
rabbitmq下载:https://github.com/rabbitmq/rabbitmq-server/releases
安装RabbitMQ
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.7/rabbitmq-server-generic-unix-3.8.7.tar.xz
xz -d rabbitmq-server-generic-unix-3.8.7.tar.xz
tar -xf rabbitmq-server-generic-unix-3.8.7.tar
mv rabbitmq_server-3.8.7/ /usr/local/
cd /usr/local/
mv rabbitmq_server-3.8.7 rabbitmq
配置RabbitMQ
配置环境变量
echo 'export PATH=$PATH:/usr/local/rabbitmq/sbin' >> /etc/profile
刷新环境变量
source /etc/profile
创建配置目录
mkdir /etc/rabbitmq
启动RabbitMQ
启动:
rabbitmq-server -detached
停止:
rabbitmqctl stop
状态:
rabbitmqctl status
防火墙或安全组之类的自行处理(5672
和15672
端口)
WEB管理
开启web插件
rabbitmq-plugins enable rabbitmq_management
默认账号密码:guest
guest
(这个账号只允许本机访问)
用户管理
查看所有用户
rabbitmqctl list_users
添加一个用户
rabbitmqctl add_user appblog 123456
配置权限
rabbitmqctl set_permissions -p "/" appblog ".*" ".*" ".*"
查看用户权限
rabbitmqctl list_user_permissions appblog
设置tag
rabbitmqctl set_user_tags appblog administrator
删除用户(安全起见,删除默认用户)
rabbitmqctl delete_user guest
配置好用户之后,就可以用新账号进行登陆
版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/25/install-rabbitmq-under-centos-7/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论