RabbitMQ安装步骤

  1. 给centos安装epel yum 源

# rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

  1. 安装erlang运行环境

# yum install erlang

  1. 安装rabbitmq server

# rpm -ivh http://www.rabbitmq.com/releases/rabbitmq-server/v3.0.0/rabbitmq-server-3.0.0-1.noarch.rpm

  1. warning: rabbitmq-server-``3.6``.``6``-``1``.el6.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY``error: Failed dependencies:`` ``erlang >= R16B-``03 is needed by rabbitmq-server-``3.6``.``6``-``1``.el6.noarch`` ``socat is needed by rabbitmq-server-``3.6``.``6``-``1``.el6.noarch
  2. 安装socat
    # yum makecache
    # yum -y install socat
  3. 打开server

# chkconfig rabbitmq-server on

# rabbitmqctl status

  1. 会报异常:

# rabbitmqctl status

  1. Status of node rabbit``@devnote ...``Error: unable to connect to node rabbit``@devnote``: nodedown DIAGNOSTICS``=========== nodes in question: [rabbit``@devnote``] hosts, their running nodes and ports:``- devnote: [{rabbitmqctl24923,``51045``}] current node details:``- node name: rabbitmqctl24923``@devnote``- home dir: /var/lib/rabbitmq``- cookie hash: TblHThacrBHJzl5Vt7Y4Ww==
    执行命令:

# /sbin/service rabbitmq-server stop

# /sbin/service rabbitmq-server start

# rabbitmqctl status 测试正确

  1. 添加管理员账号
    rabbitmqctl add_user rabbitadmin 123456
  2. 分配用户标签
    rabbitmqctl set_user_tags rabbitadmin administrator
  3. 创建和赋角色完成后查看并确认
    rabbitmqctl list_users
  4. 登陆
    浏览器输入地址:http://服务器IP地址:15672/
    用户名密码:rabbitadmin/123456
  5. 常用命令

    查看所有队列信息

   # rabbitmqctl list_queues

    关闭应用

   # rabbitmqctl stop_app

    启动应用,和上述关闭命令配合使用,达到清空队列的目的

   # rabbitmqctl start_app

    清除所有队列

   # rabbitmqctl reset

上一篇:理解Windows中的路由表和默认网关


下一篇:解决yum update失败