找回密码
 注册
首页 ≡≡网络技术≡≡ 服务器 RabbitMQ配置

linux RabbitMQ配置

灰儿 2024-2-11 09:08:01
一、概述
可以使用默认的内建配置来有效地运行RabbitMQ,并且大多数情况下也不需要修改任何RabbitMQ的配置。为了更加有效的操控RabbitMQ,可以利用调节系统范围内的参数来达到定制化的需求。

二、环境变量
RabbitMQ的环境变量都是以“RABBITMQ_“开头的,可以在shell环境中设置,也可以在rabbitmq-env.conf这个RabbitMQ环境变量的定义文件中设置。如果是在非shell环境中配置,则需要去掉”RabbitMQ_“这个前缀。优先级按照shell环境最优先,其次是rabbitmq-env.conf配置文件,最后是默认配置。

rabbitmq-env.conf文件
文件位置在安装目录下的/etc/rabbitmq/
如果rabbitmq-env.conf 的文件不存在,那么我们可以创建该文件,然后我们可以通过环境变量指定该文件的位置

rabbitmq-defaults文件
[root@node01 bin]# find / -name rabbitmq-defaults
/usr/lib/rabbitmq/bin/rabbitmq-defaults
/usr/lib/rabbitmq/lib/rabbitmq_server-3.8.14/sbin/rabbitmq-defaults
[root@node01 bin]#
1
2
3
4
[root@node01 bin]# cat /usr/lib/rabbitmq/bin/rabbitmq-defaults
#!/bin/sh -e
##  The contents of this file are subject to the Mozilla Public License
##  Version 1.1 (the "License"); you may not use this file except in
##  compliance with the License. You may obtain a copy of the License
##  at https://www.mozilla.org/MPL/
##
##  Software distributed under the License is distributed on an "AS IS"
##  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
##  the License for the specific language governing rights and
##  limitations under the License.
##
##  The Original Code is RabbitMQ.
##
##  The Initial Developer of the Original Code is GoPivotal, Inc.
##  Copyright (c) 2012-2021 VMware, Inc. or its affiliates.  All rights reserved.
##

### next line potentially updated in package install steps
SYS_PREFIX=

CLEAN_BOOT_FILE=start_clean
SASL_BOOT_FILE=start_sasl
BOOT_MODULE="rabbit"

if test -z "$CONF_ENV_FILE" && test -z "$RABBITMQ_CONF_ENV_FILE"; then
    CONF_ENV_FILE=${SYS_PREFIX}/etc/rabbitmq/rabbitmq-env.conf
fi
[root@node01 bin]#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
下边是我在官网摘录的RabbitMQ环境变量,可以参考。






没有特殊需要,不建议更改RabbitMQ的环境变量。

三、配置文件
配置项
rabbitmq.config详细配置参数

配置加密
配置文件中有一些敏感的配置项可以被加密,然后在RabbitMQ启动时可以对这些项进行解密。

优化网络配置
待深入…

参数和策略
待深入…

四、总结
RabbitMQ在配置方面相当完善,在许多情况下都可以使用默认的配置而不需要改变其中任何一个就可以让RabbitMQ更好的服务。如果需要尽可能地发挥本身性能,那么对于参数的调优就显得非常重要。还需要慢慢的去深入研磨。

————————————————                 
原文链接:https://blog.csdn.net/qq_32014795/article/details/115549653
您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。