Verify version of rabbitmq

前端 未结 11 2039
误落风尘
误落风尘 2020-12-23 15:30

How can I verify which version of rabbitmq is running on a server?

Is there a command to verify that rabbitmq is running?

相关标签:
11条回答
  • 2020-12-23 16:18

    You can simply execute from the command line:

    sudo rabbitmqctl status | grep rabbit
    
    0 讨论(0)
  • 2020-12-23 16:20

    As Marek said on a local server, or, on a remote server (using amqplib):

    from amqplib import client_0_8 as amqp
    import sys
    
    conn = amqp.Connection(host=sys.argv[1], userid="guest", password="guest", virtual_host="/", insist=False)
    
    for k, v in conn.server_properties.items():
        print k, v
    

    Save as checkVersion.py and run with python checkVersion.py dev.rabbitmq.com:

    % python checkVersion.py dev.rabbitmq.com
    information Licensed under the MPL.  See http://www.rabbitmq.com/
    product RabbitMQ
    copyright Copyright (C) 2007-2011 VMware, Inc.
    capabilities {}
    platform Erlang/OTP
    version 2.6.0
    
    0 讨论(0)
  • 2020-12-23 16:20

    In the likely event you're using the "management" (web) plug-in, the RabbitMQ version appears in the upper-right corner of every web page, along with the version of the Erlang run-time.

    0 讨论(0)
  • 2020-12-23 16:21

    Since I was looking to do this in C# on a Windows machine and all the current answers are for *nix, I'll post the code that I ended up using:

        public string GetRabbitMqVersion()
        {
            string prefix = "rabbitmq_server-";
            var dirs = System.IO.Directory.EnumerateDirectories(@"C:\Program Files (x86)\RabbitMQ Server", string.Format("{0}*",prefix));
    
            foreach (var dir in dirs)
            {
                //Just grab the text after 'rabbitmq_server-' and return the first item found
                var i = dir.LastIndexOf(prefix);
                return dir.Substring(i+16);
            }
            return "Unknown";
        }
    
    0 讨论(0)
  • 2020-12-23 16:23

    If rabbitimq can not start I found the only way to determine version is via installer system.

    Eample Debian/Ubuntu:

    dpkg -s rabbitmq-server | grep Version
    
    0 讨论(0)
提交回复
热议问题