Skip to content

Instantly share code, notes, and snippets.

@s0undt3ch
Created September 18, 2015 14:01
Show Gist options
  • Save s0undt3ch/969b744d3d7b88c29cba to your computer and use it in GitHub Desktop.
Save s0undt3ch/969b744d3d7b88c29cba to your computer and use it in GitHub Desktop.
CentOS 7 Cassandra systemd service file
# /usr/lib/systemd/system/cassandra.service
[Unit]
Description=Cassandra
After=network.target
[Service]
PIDFile=/var/run/cassandra/cassandra.pid
User=cassandra
Group=cassandra
ExecStart=/usr/sbin/cassandra -f -p /var/run/cassandra/cassandra.pid
StandardOutput=journal
StandardError=journal
LimitNOFILE=100000
LimitMEMLOCK=infinity
LimitNPROC=32768
LimitAS=infinity
Restart=always
[Install]
WantedBy=multi-user.target
@Phrozyn
Copy link

Phrozyn commented Apr 3, 2020

Tested on CentOS 8, works!

@nickzakharov
Copy link

On my sysV file I call the following command when stopping cassandra:
nodetool -u cass** -pw pass** -h 127.0.0.1 decommission

Do I need to do this in systemd file as a ExecStopPost command?

@ilyaevseev
Copy link

ilyaevseev commented Oct 11, 2022

Should be useful in forking mode:

TimeoutStartSec=300

But foreground mode seems more stable (imho).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment