Verify version of rabbitmq

2020-02-16 20:09发布

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

Is there a command to verify that rabbitmq is running?

标签: rabbitmq
11条回答
看我几分像从前
2楼-- · 2020-02-16 20:48

I use following command to trim output down to version,

rabbitmqctl status | grep "{rabbit,\"RabbitMQ\""

Output:

  {rabbit,"RabbitMQ","3.7.3"},
查看更多
▲ chillily
3楼-- · 2020-02-16 20:50

To get RMQ version using C#

using (var connection = connectionFactory.CreateConnection())
{
    if (connection.ServerProperties.ContainsKey("version"))
        Console.WriteLine("Version={0}",
            Encoding.UTF8.GetString((byte[])connection.ServerProperties["version"]));
}

Output:

Version=3.6.3

查看更多
小情绪 Triste *
4楼-- · 2020-02-16 20:51

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";
    }
查看更多
疯言疯语
5楼-- · 2020-02-16 20:54

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.

查看更多
成全新的幸福
6楼-- · 2020-02-16 21:01

sudo rabbitmqctl status

and look for line that looks like that:

{rabbit,"RabbitMQ","2.6.1"},

查看更多
劫难
7楼-- · 2020-02-16 21:02

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
查看更多
登录 后发表回答