RabbitMQ 中的磁盘 space 问题

Disk space issue in RabbitMQ

我是 rabbitmq 的新手。我试图将 100 万条示例消息推送到我的队列中。

我已经在C盘安装了RabbitMQ。但是当 运行 由于 C 驱动器中的磁盘 space 问题导致进程被中断时,我清除了队列。

我的问题是,有没有办法更改消息的存储位置。

就我而言,我有 500 GB 的 D 驱动器,我想使用该驱动器。我怎样才能做到这一点。

我用过Python客户端

for i in range (0,1000000):

channel.queue_declare(queue='hello')

channel.basic_publish(exchange='',
                      routing_key='hello',
                      body='Hello World!')
print " [x] Sent 'Hello World!'"


connection.close()

您应该定义环境变量。请参阅有关 File Locations 和特别是 RABBITMQ_MNESIA_BASE 环境变量的 RabbitMQ 文档:

This base directory contains sub-directories for the RabbitMQ server's Mnesia database files, one for each node, unless RABBITMQ_MNESIA_DIR is set explicitly. (In addition to Mnesia files this location also contains message storage and index files as well as schema and cluster details.)

对于你来说是这样的 RABBITMQ_MNESIA_BASE=d:\rabbitmq\db