1,安装前依赖解决
yum install \
m4 \
vim \
wget \
gcc \
gcc-c++ \
make \
cmake \
automake \
autoconf \
readline \
kernel-devel \
ncurses-devel \
openssl-devel \
unixODBC-deve \
readline-devel \
librabbitmq-devel \
-y
2,源码安装 erlang
1,下载
所需版本:crlang-20.0(opens new window)
2,安装
cd /opt
wget http://erlang.org/download/otp_src_20.0.tar.gz
tar -zxvf otp_src_20.0.tar.gz
cd otp_src_20.0
./configure --prefix=/usr/local/erlang --without-javac
make
make install
3,配置
加入环境变量。
vim /etc/profile
在最后添加:
export PATH=$PATH:/usr/local/erlang/bin
source /etc/profile
4,测试
[root@localhost rabbitmq]$/usr/local/erlang/bin/erl
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V9.0 (abort with ^G)
1> 10+19 .
29
按两下Ctrl + c退出。
3,源码安装 rabbitmq
1,下载
所用版本:rabbitmq-3.6.10(opens new window)
2,安装
cd /opt
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-generic-unix-3.6.10.tar.xz
xz -d rabbitmq-server-generic-unix-3.6.10.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.6.10.tar
cp -r /opt/rabbitmq_server-3.6.10 /usr/local/rabbitmq
3,添加配置文件
vim /usr/local/rabbitmq/etc/rabbitmq/rabbitmq.config
[{rabbit,[{tcp_listeners,[5672]}]}].
4,添加环境变量
vim /etc/profile
export RABBITMQ_HOME=/usr/local/rabbitmq
export PATH=$PATH:/usr/local/rabbitmq/sbin
source /etc/profile
5,启动
/usr/local/rabbitmq/sbin/rabbitmq-server -detached
echo "/usr/local/rabbitmq/sbin/rabbitmq-server -detached" >> /etc/rc.local #添加开机自启动。
4,开启 web 管理界面
/usr/local/rabbitmq/sbin/rabbitmq-plugins enable rabbitmq_management
成功之后,可以通过如下端口访问,用户名密码都是 guest。http://127.0.0.1:15672