喵♂呜 的博客

一个刚毕业就当爹的程序猿 正在迷雾中寻找道路...

服务器磁盘爆满导致的RabbitMQ队列信息异常

生产环境上 由于没有迁移 Docker 的默认路径 磁盘空间占满 导致 RabbitMQ 的队列信息丢失

问题详情

  • 生产服务器报错
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=541, reply-text=INTERNAL_ERROR - access to vhost '/' refused for user 'root': vhost '/' is down, class-id=10, method-id=40)
    at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:909)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:859)
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32)
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1013)
    at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:364)
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117)
  • 在RabbitMQAdmin管理页面 队列处于 Down 状态 并且无法删除
  • 重启几次后都无法解决问题

处理方案

  • 通过下列命令重置 RabbitMQ 的应用

    注意 下列命令会导致所有配置丢失 包括用户(Users)和虚拟主机(Vhost)

    1
    2
    3
    rabbitmqctl stop_app
    rabbitmqctl reset
    rabbitmqctl start_app

欢迎关注我的其它发布渠道