• [AMQP] RabbitMQ 安装与测试


    转:http://blog.csdn.net/xuguang121/article/details/7679804

    RabbitMQ 是AMQP标准协议下的另外一种实现,这篇blog记录了我的安装与测试。

    安装步骤

    1、  yum groupinstall Base "Development Tools" "Perl Support"  
    2、  sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
    3、  yum install unixODBC unixODBC-devel
    4、  wget http://erlang.org/download/ otp_src_R15B01 .tar.gz
         yum -y install ncurses-devel
    5、   ./configure --prefix= /usr/local/erlang    --without-javac

     

     
    1-5 erlang have build successuflly, but the RabbitMQ have need the Erlang RPM
    so take the step6 to fix
     
    :hfqaqpidsvr02:root > rpm -ivh erlang-R12B-3.3.el5.kb.i386.rpm 
    error: Failed dependencies:
            tk is needed by erlang-R12B-3.3.el5.kb.i386
    yum install tk
     
    6.:hfqaqpidsvr02:root > rpm -ivh erlang-R12B-3.3.el5.kb.i386.rpm 
    Preparing...                ########################################### [100%]
       1:erlang                 ########################################### [100%]
     
    7.:hfqaqpidsvr02:root > rpm -qa|grep erlang
    erlang-R12B-3.3.el5.kb
     
    8.:hfqaqpidsvr02:root > rpm -ivh rabbitmq-server-2.8.2-1.noarch.rpm 
    Preparing...                ########################################### [100%]
       1:rabbitmq-server        ########################################### [100%]
     
    9:hfqaqpidsvr02:root > rpm -qa|grep rabbit
    rabbitmq-server-2.8.2-1

    安装遇到的问题
    1.down load Erlang otp_src_R15B01.tar.gz  http://www.erlang.org/download.html
    2. install Erlang 
        a.yum groupinstall Base "Development Tools" "Perl Support" 
        b. ./configure --prefix=/usr/local/erlang 
    Error
    :
    configure: error: No curses library functions found
    configure: error: /bin/sh '/usr/local/xuguang/RabbitMq/erlang/otp_src_R15B01/erts/configure' failed for erts
     
    RootCause:缺少ncurses安装包
     
               Fix:yum -y install ncurses-devel
       c. make make install
           出现了失败:
                     Fix :1.sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
                             2. yum install unixODBC unixODBC-devel

       d.tar zxvf /usr/local/xuguang/RabbitMq/otp_doc_man_R15B01.tar.gz -C /usr/local/erlang/lib/erlang 
     
       e.have not 编辑.erlang文件
     
    Yum 直接安装:需要加到 yum 仓库中 wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
     
    3.rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
    4.rpm -ivh rabbitmq-server-2.8.2-1.noarch.rpm
      error: Failed dependencies:
            erlang >= R12B-3 is needed by rabbitmq-server-2.8.2-1.noarch

    启动
    :hfqaqpidsvr02:root > service rabbitmq-server start
    Starting rabbitmq-server: SUCCESS
    rabbitmq-server.
    :hfqaqpidsvr02:root > service rabbitmq-server status
    [{pid,11575},
     {running_applications,[{rabbit,"RabbitMQ","2.8.2"},
                            {mnesia,"MNESIA  CXC 138 12","4.4.3"},
                            {os_mon,"CPO  CXC 138 46","2.1.6"},
                            {sasl,"SASL  CXC 138 11","2.1.5.3"},
                            {stdlib,"ERTS  CXC 138 10","1.15.3"},
                            {kernel,"ERTS  CXC 138 10","2.12.3"}]},
     {os,{unix,linux}},
     {erlang_version,"Erlang (BEAM) emulator version 5.6.3 [source] [smp:2] [async-threads:30] [hipe] [kernel-poll:true]\n"},
     {memory,[{total,12641669},
              {processes,5051576},
              {processes_used,5049080},
              {system,7590093},
              {atom,706785},
              {atom_used,687708},
              {binary,29761},
              {code,5947749},
              {ets,352708}]},
     {vm_memory_high_watermark,0.20521283045107527},
     {vm_memory_limit,1717986918},
     {disk_free_limit,8371732480},
     {disk_free,14864244736},
     {file_descriptors,[{total_limit,924},
                        {total_used,3},
                        {sockets_limit,829},
                        {sockets_used,1}]},
     {processes,[{limit,1048576},{used,116}]},
     {run_queue,0},
     {uptime,11}]
    ...done.

    对于cluster启动与针对集群的测试这里就不描述了。

    性能测试

    Testenv

    1.Broker : 1 VM 2 cpu 8G memory

    2.Sender : run java command /usr/bin/java -classpathcommons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar:. ConcurrencySend -c100 -n 100(same as QPID C++ Tool)

    3.Receiver: run java command /usr/bin/java -classpathcommons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar:. SimpleConsumer>receive.result

    TestResult

    1.    SenderMessage 10000  Cost 3.408s (it include the thread creat and join time) sowe can define the Send request >=2873 request/s

    SendMessage Body: Xuguang Test Start TimeTue Jun 12 05:11:30 GMT 2012

    SendMessage Body: Xuguang Test Start TimeTue Jun 12 05:11:30 GMT 2012

    SendMessage Body: Xuguang Test Start TimeTue Jun 12 05:11:30 GMT 2012

    SenderCost Time3408ms

    2.    ReceiveMessage :total receive 10000 and Cost time more than 3s so we can defineReceiver request <=3333request/s

    wdhf1wco001:root >grep "Message Receive" ./receive.result -wc

    10000

    First :messageMessageReceive TimeTue Jun 12 05:19:55 GMT 2012Xuguang Test Start TimeTue Jun 1205:19:55 GMT 2012

    Last:Message ReceiveTimeTue Jun 12 05:19:58 GMT 2012Xuguang Test Start TimeTue Jun 12 05:19:58 GMT2012


    3.    Broker(10.224.57.130)

    CPU

    Memory

    AttachMent Is Rabbitmq compare with QPID

  • 相关阅读:
    C#:将空间数据加载到树视图控件
    C# 常见错误
    C#:Application操作(待补充)
    C#:XML操作(简单)
    C#:xml操作(待补充)
    C#:消息框
    C#:数学运算(待补充)
    C#:Ini文件操作(待补充)
    C#:文件操作(待补充)
    2015河南省农村拆迁赔偿流程
  • 原文地址:https://www.cnblogs.com/bugY/p/2768943.html
Copyright © 2020-2023  润新知