Centos中安装rabbitmq3.6.5

原创
2016/11/03 22:16
阅读数 347

一、Centos中安装erlang

1、下载最新erlang19 http://erlang.org/download/otp_src_19.0.tar.gz 

2、用winscp工具上传至/usr/local/src目录下,进入目录下

# cd /usr/local/src

# tar -zxvf otp_src_19.0.tar.gz -C ../         解压至上级目录

# cd ../otp_src_19.0   

3、安装依赖

# yum install ncurses ncurses-base ncurses-devel ncurses-libs ncurses-static ncurses-term ocaml-curses ocaml-curses-devel -y

# yum install openssl-devel zlib-devel -y

# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel perl

# yum -y install ncurses-devel

# yum install ncurses-devel

# yum list|grep ncurses

# yum -y install ncurses-devel

# yum install ncurses-devel

4、编译

# ./configure -h  #执行帮助

# ./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac   #不用java编译,故去掉java避免错误

5、安装

# make & make install

6、修改环境变量

# vim /etc/profile

#添加代码

# export ERLANG_HOME=/usr/local/erlang

# export PATH=$ERLANG_HOME/bin:$PATH

# source /etc/profile

7、测试是否安装成功

# erl    #如果成功会返回erl的版本号18

 

二、Centos中安装rabbitmq3.6.5

1、下载RabbitMQ3.6.5

# cd /usr/local/src

# wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-generic-unix-3.6.5.tar.xz

# tar xvJf rabbitmq-server-generic-unix-3.6.5.tar.xz

# mv rabbitmq_server-3.6.5 ../

# cd /usr/local/rabbitmq_server-3.6.5/sbin

# ./rabbitmq_server -detached              后台启动rabbitmq_server

# ./rabbitmq-plugins enable rabbitmq_management  开启插件管理页面,需要重启rabbitmq

# ./rabbitmqctl stop                停止服务

# ./rabbitmq_server -detached

 

默认rabbitmq是禁止远程用户访问的,需要开启(可以网上查询)

 

增加用户admin,密码admin即可

# ./rabbitmqctl add_user admin admin

# ./rabbitmqctl list_users

# ./rabbitmqctl set_user_tags admin administrator

# ./rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"

 

安装完成之后,需要开启5672 15672端口供客户端访问

# vi /etc/sysconfig/iptables

# -A INPUT -m state –state NEW -m tcp -p tcp –dport 5672 -j ACCEPT

# -A INPUT -m state –state NEW -m tcp -p tcp –dport 15672 -j ACCEPT

# service iptables restart

 

可以输入http://ip:15672 输入用户名admin密码为admin,进行访问

 

 

参考:

http://www.rabbitmq.com/download.html 

http://www.rabbitmq.com/install-generic-unix.html 

https://www.erlang-solutions.com/resources/download.html 

问题:

安装完rabbitmq-server,重启时间很长,并且报错ERROR: epmd error for host "yourhostname": timeout
原因是:主机名和ip不匹配,需要更改hostname或者/etc/hosts文件
修改主机名:#hostname yourhostname  要跟/etc/hosts  /etc/sysconfig/network  文件中一致。

展开阅读全文
打赏
0
1 收藏
分享
加载中
更多评论
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部