CentOS7安装RabbitMQ
1、安装Erlang
-
> 拷贝erlang到centos中
-
> 运行安装命令:# rpm -Uvh erlang-18.3-1.el7.centos.x86_64.rpm
2、安装RabbitMQ
-
> 拷贝RabbitMQ rpm安装包到CentOS
-
> 运行安装命令:# rpm -Uvh rabbitmq-server-3.6.1-1.noarch.rpm
3、启动RabbitMQ
-
> 运行RabbitMQ
# rabbitmq-server -detached
查看RabbitMQ状态 # rabbitmqctl status 关闭RabbitMQ # rabbitmqctl stop
4、启用RabbitMQ管理控制台
-
> # rabbitmq-plugins enable rabbitmq_management
-
> 查看RabbitMQ状态得到:
Status of node rabbit@rabbitmq1 …
[{pid,10887}, {running_applications, [{rabbitmq_management,"RabbitMQ Management Console","3.6.1"}, {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.1"}, {webmachine,"webmachine","1.10.3"}, {mochiweb,"MochiMedia Web Server","2.13.0"}, {amqp_client,"RabbitMQ AMQP Client","3.6.1"}, {rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.1"}, {ssl,"Erlang/OTP SSL application","7.3"}, {public_key,"Public key infrastructure","1.1.1"}, {crypto,"CRYPTO","3.6.3"}, {compiler,"ERTS CXC 138 10","6.0.3"}, {inets,"INETS CXC 138 49","6.2"}, {asn1,"The Erlang ASN1 compiler version 4.0.2","4.0.2"}, {syntax_tools,"Syntax tools","1.7"}, {rabbit,"RabbitMQ","3.6.1"}, {mnesia,"MNESIA CXC 138 12","4.13.3"}, {os_mon,"CPO CXC 138 46","2.4"}, {xmerl,"XML parser","1.3.10"}, {rabbit_common,[],"3.6.1"}, {ranch,"Socket acceptor pool for TCP protocols.","1.2.1"}, {sasl,"SASL CXC 138 11","2.7"}, {stdlib,"ERTS CXC 138 10","2.8"}, {kernel,"ERTS CXC 138 10","4.2"}]}, {os,{unix,linux}}, {erlang_version, "Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:64] [hipe] [kernel-poll:true]\n"}, {memory, [{total,52964248}, {connection_readers,0}, {connection_writers,0}, {connection_channels,0}, {connection_other,2680}, {queue_procs,2680}, {queue_slave_procs,0}, {plugins,231488}, {other_proc,18604696}, {mnesia,58376}, {mgmt_db,40880}, {msg_index,45248}, {other_ets,1338800}, {binary,37952}, {code,27319120}, {atom,992409}, {other_system,4289919}]}, {alarms,[]}, {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]}, {vm_memory_high_watermark,0.4}, {vm_memory_limit,414048256}, {disk_free_limit,50000000}, {disk_free,17816612864}, {file_descriptors, [{total_limit,924},{total_used,2},{sockets_limit,829},{sockets_used,0}]}, {processes,[{limit,1048576},{used,198}]}, {run_queue,0}, {uptime,451}, {kernel,{net_ticktime,60}}] 添加用户 # rabbitmqctl add_user admin admin 设置用户权限 # rabbitmqctl set_user_tags admin administrator 查看用户列表 # rabbitmqctl list_users
5、其他命令
-
> 查看RabbitMQ占用端口
# netstat -tnlp | grep 5672
-
> 关闭防火墙
# systemctl stop firewalld.service
-
> 启动防火墙
# systemctl start firewalld.service
-
> 禁止防火墙开机启动
# systemctl disable firewalld.service
注:centos7不支持ifconfig和netstat等命令,要使用这些命令需要安装一些插件
-
> # yum install wget
-
> # yum install net-tools