4. RabbitMQ的安装
首先安装依赖 1 yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC unixODBC-devel httpd python-simplejson
安装Erlang 1 2 3 4 5 6 7 wget http://erlang.org/download/otp_src_19.0.tar.gz tar -vxf otp_src_19.0.tar.gz cd otp_src_19.0./configure --prefix=/usr/local /erlang --with-ssl -enable -threads -enable -smmp-support -enable -kernel-poll --enable -hipe --without-javac make && make install
然后打开文件,在最下面插入这一段 1 2 3 4 vim /etc/profile export ERLANG_HOME=/usr/local /erlangexport PATH=$PATH :$ERLANG_HOME /bin
然后刷新下
1 2 3 source /etc/profileerl -v (检查erlang是否安装完成)`
安装rabbitmq
1 2 3 wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el6.noarch.rpm yum -y install rabbitmq-server-3.6.6-1.el6.noarch.rpm
这里可能会报错 解决方法:yum -y install socat
此时会报错没有socat包或是找不到socat包,解决方法安装centos的epel的扩展源yum -y install epel-release
之后执行yum -y install socat
再重新安装rabbitmq-server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 yum -y install rabbitmq-server-3.6.6-1.el6.noarch.rpm systemctl start rabbitmq-server (一定要执行 不然会报错) rabbitmq状态 service rabbitmq-server status 启动rabbitmq service rabbitmq-server start 暂停rabbitmq service rabbitmq-server stop service rabbitmq-server restart service rabbitmq-server try-restart service rabbitmq-server reload service rabbitmq-server force-reload 开机启动rabbitmq chkconfig rabbitmq-server on 查看rabbitMq进程 ps -ef | grep rabbitmq 启动web管理页面 rabbitmq-plugins enable rabbitmq_management (http://127.0.0.1:15672)` 默认用户名密码 guest guest (只能localhost登录) 查看用户列表 rabbitmqctl list_users 添加用户 rabbitmqctl add_user admin 123456 添加角色 rabbitmqctl set_user_tags admin administrator 设置权限 rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
注意: 5672端口是连接rabbitmq用的