发布时间:2020-03-31 10:33:45编辑:admin阅读(3350)
5672是rabbitmq 默认TCP监听端口,我已经给rabbitmq配置SSL,它使用新的端口号5671。
如何给rabbitmq配置SSL,请参考链接:
https://www.cnblogs.com/xiao987334176/p/12304761.html
由于安全问题,需要关闭默认的端口号5672
目前的SSL版rabbitmq配置文件/etc/rabbitmq/rabbitmq.config
完整内容如下:
[ {rabbit, [ {ssl_listeners, [5671]}, {ssl_options, [{cacertfile,"/etc/rabbitmq/cert/ca_certificate.pem"}, {certfile,"/etc/rabbitmq/cert/client_certificate.pem"}, {keyfile,"/etc/rabbitmq/cert/client_key.pem"}, {verify,verify_peer}, {fail_if_no_peer_cert,true}]} ]} ].
现在它在端口5671和5672上工作
要禁用标准的RabbitMQ 5672端口,将{tcp_listeners,[]}添加到您的rabbitmq.conf中:
/etc/rabbitmq/rabbitmq.config 完整内容如下:
[ {rabbit, [ {tcp_listeners, []}, {ssl_listeners, [5671]}, {ssl_options, [{cacertfile,"/etc/rabbitmq/cert/ca_certificate.pem"}, {certfile,"/etc/rabbitmq/cert/client_certificate.pem"}, {keyfile,"/etc/rabbitmq/cert/client_key.pem"}, {verify,verify_peer}, {fail_if_no_peer_cert,true}]} ]} ].
它适用于RabbitMQ >=3.1.5,由于我的版本为3.8.2,所以是支持的。
/etc/init.d/rabbitmq-server restart
# netstat -anpt|grep beam.smp tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 5459/beam.smp tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 5459/beam.smp tcp 0 0 127.0.0.1:54963 127.0.0.1:4369 ESTABLISHED 5459/beam.smp tcp 0 0 :::5671 :::* LISTEN 5459/beam.smp
登录到rabbitmq后台,展开端口内容。
可以发现没有5672了。
本文参考链接:
http://www.voidcn.com/article/p-udmrsctc-btu.html
47606
45987
36909
34470
29082
25713
24566
19715
19248
17756
5566°
6155°
5691°
5737°
6706°
5483°
5484°
5989°
5965°
7295°