Reputation: 1201
I have downloaded & extracted the cassandra tar ball package. I'm able to run the process from the extracted location both in background & foreground mode. Could someone provide me instructions to run this as a service ?so that the service can start automatically when the server reboots.
Upvotes: 2
Views: 454
Reputation: 57748
The missing piece here, is that you need a "casasandra" script in the /etc/init.d/
directory. While the .deb
and .rpm
packages take care of this for you, it is possible to write your own. Essentially the init.d script needs to define variables to support your service, definition for the start/stop/restart functions, as well as some supporting methods.
Here's a Git project which provides some detail around how to do this, including a new-service.sh script to do a lot of the heavy-lifting. Note that you'll probably want to look over the finished product, and add some things specific to Cassandra (like disabling gossip and draining on a "stop").
Probably the easiest way to go about this, is to install with one of the above methods (using apt-get or yum) grab the /etc/init.d/cassandra
file that it creates, and augment it for your deployment.
Upvotes: 2