一、安装Erlang
1.安装Erlang编译依赖:
yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget
2.下载Erlang:
wget http://www.erlang.org/download/otp_src_19.3.tar.gz
3.解压并安装
tar -xzvf otp_src_19.3.tar.gz
cd otp_src_19.3
./configure --prefix=/usr/local/erlang
make && make install
4.配置环境变量
vi /etc/profile
/usr/local/erlang/otp_src_19.3/bin
添加配置:
ER_LANG=/usr/local/erlang/otp_src_19.3
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$MAVEN_HOME/bin:$ER_LANG/bin:
source /etc/profile
查看环境变量配置:
echo $PATH
输入erl查看版本
[root@ONLINE rabbitmq]# erl
Erlang/OTP 21 [erts-10.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V10.3 (abort with ^G)
二、安装Rabbitmq
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el7.noarch.rpm
yum install rabbitmq-server-3.6.6-1.el7.noarch.rpm
此时会报错
#vim /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/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
这个方法无效未解决问题
有效的安装方法
wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.8/rabbitmq-server-3.7.8-1.el7.noarch.rpm
rpm -ivh --nodeps rabbitmq-server-3.7.8-1.el7.noarch.rpm
两句话搞定,此时安装rabbitmq结束
三、启动Rabbitmq
报错1:Failed to create cookie file '/home/rabbitmq/.erlang.cookie
解决方法:rpm安装rabbitmq的时候,会自动建立rabbitmq的用户,但是/home/下无目录,需要根据提示自行创建目录
Jan 16 14:03:35 ONLINE rabbitmqctl[17843]: 14:03:35.219 [error] Failed to create cookie file '/home/rabbitmq/.erlang.cookie': eacces
Jan 16 14:03:35 ONLINE rabbitmqctl[17843]: 14:03:35.219 [error] Failed to create cookie file '/home/rabbitmq/.erlang.cookie': eacces
Jan 16 14:03:35 ONLINE rabbitmqctl[17843]: 14:03:35.996 [error] Failed to create cookie file '/home/rabbitmq/.erlang.cookie'<