본문 바로가기

Server | Network

Slowly RabbitMQ shutdown 이 너무 느릴때 해결방법

a stop job is running for rabbitmq messaging server

 

 1986  ls /etc/systemd/system/rabbitmq-server.service.d
 1987  ls /etc/systemd/system
 1988  mkdir /etc/systemd/system/rabbitmq-server.service.d
 1989  vi /etc/systemd/system/rabbitmq-server.service.d/limits.conf
 1990  nano /etc/systemd/system/rabbitmq-server.service.d/limits.conf

 

 edit file

# To override LimitNOFILE, create the following file:
#
# /etc/systemd/system/rabbitmq-server.service.d/limits.conf
#
# with the following content:
#
# [Service]
# LimitNOFILE=65536

LimitNOFILE=32768

 

save

 

 1981  nano /lib/systemd/system/rabbitmq-server.service

 

edit

  GNU nano 2.9.3           /lib/systemd/system/rabbitmq-server.service                    

[Unit]
Description=RabbitMQ Messaging Server
#After=network.target
After=network.target epmd@0.0.0.0.socket
Wants=network.target epmd@0.0.0.0.socket

[Service]
#Type=simple
#User=rabbitmq
Type=notify
User=rabbitmq
Group=rabbitmq
UMask=0027
NotifyAccess=all
TimeoutStartSec=3600

SyslogIdentifier=rabbitmq
LimitNOFILE=65536

# The following setting will automatically restart RabbitMQ
# in the event of a failure. systemd service restarts are not a
# replacement for service monitoring. Please see
https://www.rabbitmq.com/monitoring.html
Restart=on-failure
RestartSec=10

 

WorkingDirectory=/var/lib/rabbitmq

#ExecStart=/usr/sbin/rabbitmq-server
#ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmq-server-wait
##ExecStop=/usr/sbin/rabbitmqctl stop
#ExecStop=/usr/sbin/rabbitmqctl shutdown -t 10
ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server
ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl shutdown
# See rabbitmq/rabbitmq-server-release#51
SuccessExitStatus=69

[Install]
WantedBy=multi-user.target

 

 

Save

 

 1967  sudo apt update
 1968  sudo apt full-upgrade
 1969  sudo apt install -y apt-transport-https locales software-properties-common 
 1970  sudo apt autoremove
 1971  sudo apt install -y apt-transport-https locales software-properties-common 
 1972  curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
 1973  sudo apt install -y fonts-noto nodejs git supervisor nginx ssl-cert postgresql adduser redis-server rabbitmq-server libstdc++6 libxml2 libboost-regex-dev zlib1g fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol libxss1 libcairo2 xvfb libxtst6 libgconf2-4 libasound2

 

vi /etc/systemd/system.conf

uncomment DefaultTimeoutStopSec=15s

Save

refer : https://github.com/rabbitmq/rabbitmq-server-release/blob/master/packaging/debs/Debian/debian/rabbitmq-server.service