安装配置
- 安装epel包 http://dl.fedoraproject.org/pub/epel/7/x86_64/
- yum install wxGTK rabbitmq-server
Rabbit MQ 配置
进入/etc/rabbitmq 目录,配置MQ。环境变量配置文件:rabbitmq-env.conf ;配置信息的配置文件 rabbitmq.config。
mkdir -p /home/rabbitmq/mnesia /home/rabbitmq/log
chown -R rabbitmq:rabbitmq /home/rabbitmq/
rabbitmq-env.conf
RABBITMQ_NODENAME=redhat188 # 节点名字
RABBITMQ_NODE_IP_ADDRESS=127.0.0.1 #监听ip
RABBITMQ_NODE_PORT=5672 #监听port
RABBITMQ_CONFIG_FILE=/etc/rabbitmq/rabbitmq.config #配置文件的路径
RABBITMQ_MNESIA_BASE=/home/rabbitmq/mnesia #需要使用的MNESIA数据库的路径
RABBITMQ_LOG_BASE=/home/rabbitmq/log #log的路径
[root@redhat188 rabbitmq]# more rabbitmq.config
[{auth_backends,[rabbit_auth_backend_internal]},
{auth_mechanisms,['PLAIN','AMQPLAIN']},
{backing_queue_module,rabbit_variable_queue},
{cluster_nodes,[]},
{collect_statistics,fine},
{collect_statistics_interval,5000},
{default_permissions,[<<".*">>,<<".*">>,<<".*">>]},
{default_user,<<"guest">>},
{default_user_tags,[administrator]},
{default_vhost,<<"/">>},
{delegate_count,16},
{error_logger,{file,"/home/rabbitmq/log/rabbit@redhat188-error.log"}},
{frame_max,131072},
{hipe_compile,false},
{included_applications,[]},
{msg_store_file_size_limit,16777216},
{msg_store_index_module,rabbit_msg_store_ets_index},
{queue_index_max_journal_entries,262144},
{sasl_error_logger,{file,"/home/rabbitmq/log/rabbit@redhat188-sasl-error.log"}},
{server_properties,[]},
{ssl_listeners,[]},
{ssl_options,[]},
{tcp_listen_options,
[binary,
{packet,raw},
{reuseaddr,true},
{backlog,128},
{nodelay,true},
{exit_on_close,false}]},
{tcp_listeners,[5672]},
{trace_vhosts,[<<"/">>]},
{vm_memory_high_watermark,0.4}]
插件管理
启动页面管理
rabbitmq-plugins enable rabbitmq_management
rabbitmq-plugins list
web页面: ip:15672/
Server管理
启动和关闭
service rabbitmq-server start
systemctl rabbitmq-server start
系统监控和管理
进入 ip:15672/ 管理页面,可以监控系统和管理系统。Admin页面可以进行users,Virtual Hosts,Policies等管理。
用户管理
新建用户:rabbitmqctl add_user xxx pwd
删除用户: rabbitmqctl delete_user xxx
改密码: rabbimqctl change_password {username} {newpassword}
设置用户角色:rabbitmqctl set_user_tags {username} {tag …}