I am trying to install cassandra on a server that has no access to Debian, so I used the tar file, doing the following :
“unzip” to folder /etc/cassandra
Run the service cassandra
And it is working fine, but when I checked with operations they confirmed I also need to configure the service file for an auto-start if there is a reboot of the server (below an example)
[Unit] Description=Cassandra Cluster Node Daemon [Service] Type=forking user=cassandra ExecStart=/etc/cassandra/bin/cassandra ExecStopPost=/usr/bin/rm -rf /data/cassandra/saved_caches SuccessExitStatus=143 [Install] WantedBy=default.targetMy question is more if there isn´t another way to do this. can the file be created automatically?
I tried the sudo apt but kept getting errors
I believe installing from deb or rpm packages will normally take care of updating the necessary init or systemd files automatically which handles auto-restart. If the installation is done via tar files you will need to update these files manually.
Hi Hugo,
Maybe I am missing something something but, is it required to configure a service file? If you want to make sure that the service is restarted after reboot you could use systemctl:
sudo systemctl enable cassandra.service