准备工作,更新yum源
正式环境慎用 yum update -y
# 进入目录
cd /etc/yum.repos.d/
# 创建目录
mkdir backup
# 默认源配备份
mv C* backup/
# 下载阿里云yum源
wget -O /etc/yum.repos.d/CenOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 清除旧缓存
yum clean all
# 创建新缓存
yum makecache
# 更新yum
yum update -y
# 更新epel第三方软件库
yum install -y epel-release
# 再次执行,就可以安装了
yum install –y wxWidgets-devel
yum install wxBase #for /usr/bin/wx-config-3.0
cd /usr/bin
# 创建软连接
ln -s wx-config-3.0 wx-config
安装erlang
yum -y install openssl-devel unixODBC-devel gcc flex gcc-c++ kernel-devel \
m4 ncurses-devel glibc-devel make xmlto perl wget gtk2-devel \
binutils-devel fop.noarch
获取安装包
wget http://erlang.org/download/otp_src_23.1.tar.gz
执行命令
tar -zxvf otp_src_23.1.tar.gzrc_23.1.tar.gzcd otp_src_23.1./configure --prefix=/usr/local/erlang --with-ssl -enable-threads \
-enable-smmp-support -enable-kernel-poll --enable-hipe make && make install;
添加erlang环境变量
echo 'export PATH=$PATH:/usr/local/erlang/bin' >> /etc/profile
source /etc/profile
查看erlang是否安装成功
#查看
erl
#退出
1、命令方式1:执行init:stop().
2、命令方式2:执行halt().
3、快捷键方式1:Control+C 然后选a
4、快捷键方式2:Control+G 然后按q
安装rabbitMQ
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-generic-unix-3.8.9.tar.xz
tar -xf rabbitmq-server-generic-unix-3.8.9.tar.xz -C /usr/local/
mv /usr/local/rabbitmq_server-3.8.9/ /usr/local/rabbitmq/
添加rabbitmq环境变量
echo 'export PATH=$PATH:/usr/local/rabbitmq/sbin' >> /etc/profile
source /etc/profile
启动rabbitMQ
## 启动MQ
rabbitmqctl start
## 守护进程方式启动MQ
rabbitmq-server -detached
## 停止MQ
rabbitmqctl stop
## 查看MQ状态
rabbitmqctl status
## 启用WEB查看
rabbitmq-plugins enable rabbitmq_management
web插件启用成功会显示如下:
Enabling plugins on node rabbit@localhost:
rabbitmq_management
The following plugins have been configured:rabbitmq_managementrabbitmq_management_agentrabbitmq_web_dispatch
Applying plugin configuration to rabbit@localhost...
The following plugins have been enabled:rabbitmq_managementrabbitmq_management_agentrabbitmq_web_dispatch
started 3 plugins.
如果报如下异常:
Starting rabbitmq-server (via systemctl): Job for rabbitmq-server.service failed. See ‘systemctl status rabbitmq-server.service’ and ‘journalctl -xn’ for details. [FAILED]
尝试下面的操作:
禁用 SELinux ,修改 /etc/selinux/config
SELINUX=disabled
修改后重启系统
管理rabbitMQ用户
## 查看用户
rabbitmqctl list_users
## 添加一个用户
rabbitmqctl add_user root root#123
## 配置权限
rabbitmqctl set_permissions -p "/" root ".*" ".*" ".*"
## 查看用户权限
rabbitmqctl list_user_permissions root
## 设置tag
rabbitmqctl set_user_tags root administrator
## 删除默认用户
rabbitmqctl delete_user guest
登录Web管理界面
安装好插件并开启服务后,可以浏览器输入
http://ip:15672,账号密码自己创建用户即可登录
或者全输入guest即可登录[guest只允许localhost登录]
个人原创,转载请注明来源:https://blog.csdn.net/hncdyj