You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sébastien Druon <sd...@spotuse.com> on 2011/01/20 17:51:17 UTC
Cassandra automatic startup script on ubuntu
Hello!
I am using cassandra on a ubuntu machine and installed it from the binary
found on the cassandra home page.
However, I did not find any scripts to start it up at boot time.
Where can I find this kind of script?
Thanks a lot in advance
Sebastien
Re: Cassandra automatic startup script on ubuntu
Posted by Clint Byrum <cl...@ubuntu.com>.
On Thu, 2011-01-20 at 17:51 +0100, Sébastien Druon wrote:
> Hello!
>
>
> I am using cassandra on a ubuntu machine and installed it from the
> binary found on the cassandra home page.
> However, I did not find any scripts to start it up at boot time.
>
>
> Where can I find this kind of script?
>
The debs produced by Eric Evans, and the others that I've been building,
have an init.d script in them.
You can find Eric's debs here:
http://wiki.apache.org/cassandra/DebianPackaging
Or the ones I build and test on Ubuntu releases here:
https://launchpad.net/~cassandra-ubuntu/+archive/stable
I just uploaded 0.7.0, so it will still have 0.6.8 in it while the
builds finish and the debs are published.
Re: Cassandra automatic startup script on ubuntu
Posted by Dave Viner <da...@gmail.com>.
You can also use the apt-get repository version, which installs the startup
script. On http://wiki.apache.org/cassandra/CloudConfig, see the Cassandra
Basic Setup section. It applies to any debian based machine, not just cloud
instances.
HTH
Dave Viner
On Thu, Jan 20, 2011 at 9:11 AM, Donal Zang <za...@ihep.ac.cn> wrote:
> On 20/01/2011 17:51, Sébastien Druon wrote:
>
> Hello!
>
> I am using cassandra on a ubuntu machine and installed it from the binary
> found on the cassandra home page.
> However, I did not find any scripts to start it up at boot time.
>
> Where can I find this kind of script?
>
> Thanks a lot in advance
>
> Sebastien
>
> Hi, this is what I do, you can add the watchdog to rc.local
> *%S[%m]%s %~ %# cat watchdog
> #!/bin/bash
> #
> # This script is to check every $INTERVAL seconds to see
> # whether cassandra is work well
> # and restart it if neccesary
> # by donal 2010-01-11
> #
> PORT=9160
> INTERVAL=2
> CASSANDRA=/opt/cassandra
> check() {
> netstat -tln|grep LISTEN|grep :$1
> if [ $? != 0 ]; then
> echo "restarting cassandra"
> $CASSANDRA/bin/stop-server
> sleep 1
> $CASSANDRA/bin/start-server
> fi
> }
> while true
> do check $PORT
> sleep $INTERVAL
> done*
>
>
Re: Cassandra automatic startup script on ubuntu
Posted by Donal Zang <za...@ihep.ac.cn>.
On 20/01/2011 17:51, Sébastien Druon wrote:
> Hello!
>
> I am using cassandra on a ubuntu machine and installed it from the
> binary found on the cassandra home page.
> However, I did not find any scripts to start it up at boot time.
>
> Where can I find this kind of script?
>
> Thanks a lot in advance
>
> Sebastien
Hi, this is what I do, you can add the watchdog to rc.local
/%S[%m]%s %~ %# cat watchdog
#!/bin/bash
#
# This script is to check every $INTERVAL seconds to see
# whether cassandra is work well
# and restart it if neccesary
# by donal 2010-01-11
#
PORT=9160
INTERVAL=2
CASSANDRA=/opt/cassandra
check() {
netstat -tln|grep LISTEN|grep :$1
if [ $? != 0 ]; then
echo "restarting cassandra"
$CASSANDRA/bin/stop-server
sleep 1
$CASSANDRA/bin/start-server
fi
}
while true
do check $PORT
sleep $INTERVAL
done/