-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
First - VM is amazing so far. Thank you.
I'd love to see you add documentation on running VM as a service in systemd. Here's what I did to make it work on CentOS 7, but this should work on any systemd OS.
Create a directory to hold the PID file:
mkdir /run/victoriametrics
Create /etc/systemd/system/victoriametrics.service. Copy and paste the below into this new file, adjusting the ExecStart line as needed.
[Unit]
Description=VictoriaMetrics
After=network.target
[Service]
Type=simple
StartLimitBurst=5
StartLimitInterval=0
Restart=on-failure
RestartSec=1
PIDFile=/run/victoriametrics/victoriametrics.pid
ExecStart=/usr/local/bin/victoriametrics -storageDataPath /data -retentionPeriod 6
ExecStop=/bin/kill -s SIGTERM $MAINPID
[Install]
WantedBy=multi-user.target
Set the file limits for the service:
mkdir /etc/systemd/system/victoriametrics.service.d
In this folder create a file ulimit.conf with the following:
[Service]
LimitNOFILE=32000
LimitNPROC=32000
Enable the service to start automatically:
systemctl enable victoriametrics
Start the service:
systemctl start victoriametrics
mihaibalaci, franchb, robobeaver6, KrepakVitaly, brenc and 5 more