本文介绍了如何禁用 RabbitMQ 默认 tcp 监听端口 - 5672的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为 RabbitMQ rabbitmq.config 文件配置了新的端口号,即带有 SSL 的 5671.

I have configured the RabbitMQ rabbitmq.config file with new port number i.e. 5671 with SSL.

现在我想禁用默认端口,即 5672.

Now I want to disable the default port i.e. 5672.

配置文件如下:-

[
  {rabbit, [
     {ssl_listeners, [5671]},
     {ssl_options, [{cacertfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cacert.pem"},
                    {certfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cert.pem"},
                    {keyfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/key.pem"},
                    {verify,verify_peer},
                    {fail_if_no_peer_cert,false},

                   {ciphers,[{dhe_rsa,aes_256_cbc,sha},
 {dhe_dss,aes_256_cbc,sha},
 {rsa,aes_256_cbc,sha}]}

                    ]

    }
   ]}
].

现在它在端口 5671 和 5672 上工作.但我需要禁用端口 5672.提出一些意见或建议.

Now its working on both port 5671 and 5672.But I need to disable the port 5672.Give some comments or suggestion.

提前致谢.

推荐答案

要禁用标准 RabbitMQ 5672 端口,请将 {tcp_listeners, []} 添加到您的 rabbitmq.conf:

To disable standart RabbitMQ 5672 port add {tcp_listeners, []} to your rabbitmq.conf:

[
  {rabbit, [
     {tcp_listeners, []},
     {ssl_listeners, [5671]},
     {ssl_options, [{cacertfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cacert.pem"},
                    {certfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cert.pem"},
                    {keyfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/key.pem"},
                    {verify,verify_peer},
                    {fail_if_no_peer_cert,false},

                   {ciphers,[{dhe_rsa,aes_256_cbc,sha},
 {dhe_dss,aes_256_cbc,sha},
 {rsa,aes_256_cbc,sha}]}

                    ]

    }
   ]}
].

它适用于 RabbitMQ 3.1.5

It works with RabbitMQ 3.1.5

这篇关于如何禁用 RabbitMQ 默认 tcp 监听端口 - 5672的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 01:02