https://www.rabbitmq.com/docs/configure
https://www.rabbitmq.com/docs/parameters
https://www.rabbitmq.com/docs/definitions
https://www.rabbitmq.com/docs/configure#means-of-configuration
https://www.cnblogs.com/-wenli/p/13587840.html
文件位置详见https://www.rabbitmq.com/docs/relocate
配置方式
- Configuration File
- 环境变量配置文件 rabbitmq-env.conf
- 主配置文件 rabbitmq.conf
- 附加配置文件 advanced.config
- Environment Variables
- rabbitmqctl、rabbitmq-queues、rabbitmq-queues、rabbitmq-diagnostics
- Parameters and Policies
- Runtime (Erlang VM) Flags
- Operating System Kernel Limits
策略
A policy matches one or more queues by name (using a regular expression pattern) and contains a definition (a map of optional arguments) that are added to the total set of properties of the matching queues.
配置文件示例
https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbit/docs/advanced.config.example
https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbit/docs/rabbitmq.conf.example
rabbitmq.conf
listeners.tcp.default = 5672
num_acceptors.tcp = 20
handshake_timeout = 10000
vm_memory_high_watermark.relative = 0.4
vm_memory_calculation_strategy = rss
vm_memory_high_watermark_paging_ratio = 0.5
disk_free_limit.absolute = 10GB
frame_max = 131072
initial_frame_max = 4096
channel_max = 2047
heartbeat = 60
default_vhost = /
log.dir = /data/rabbitmq_server-3.7.17/logs
log.file = rabbit.log
log.file.level = info
log.file.rotation.size = 52428800
log.file.rotation.count = 10
hipe_compile=true
操作系统参数
fs.file-max = 6553560
net.core.somaxconn = 65534
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 15
查看有效配置
rabbitmq-diagnostics environment
rabbitmq-diagnostics environment -n [node name]