【转载】centos下搭建RabbitMQ
centos下搭建RabbitMQ
1.安装erlang
1.安装erlang
wget http://erlang.org/download/otp_src_19.3.tar.gz
tar -xvzf otp_src_19.3.tar.gz
tar -xvzf otp_src_19.3.tar.gz
下面安装erlang依赖工具
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel
然后进行后续操作
cd otp_src_19.3
./configure --prefix=/usr/erlang --without-javac
make
make install
cd otp_src_19.3
./configure --prefix=/usr/erlang --without-javac
make
make install
验证一下erlang是否安装成功
./bin/erl
./bin/erl
![](https://img2018.cnblogs.com/blog/1639508/201906/1639508-20190617201923104-1302085486.png)
把Erlang配置到/etc/profile文件中并通过source /etc/profile设置生效
vim /etc/profile
vim /etc/profile
在文件最后的 “unset i” 代码上面添加下面内容添加新的环境变量
#set erlang environment
export ERLANG_HOME=/usr/local/otp_src_19.3
export PATH=$PATH:$ERLANG_HOME/bin
试环境改变立即生效
source /etc/profile
#set erlang environment
export ERLANG_HOME=/usr/local/otp_src_19.3
export PATH=$PATH:$ERLANG_HOME/bin
试环境改变立即生效
source /etc/profile
![](https://img2018.cnblogs.com/blog/1639508/201906/1639508-20190617201933152-948215151.png)
2.安装MQ
下载地址(https://www.rabbitmq.com/install-rpm.html),使用下列命令
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.8/rabbitmq-server-3.6.8-1.el7.noarch.rpm
rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
yum install rabbitmq-server-3.6.8-1.el7.noarch.rpm
3.配置RabbitMQ(启动MQ,记得进行项目编译部署时这个服务必须时启动的)
service rabbitmq-server start
service rabbitmq-server start