James,
   Here is the init script we are using for our Kafka Server.

[root@H1CHUK5 init.d]# cat tynt-kafka-server
#!/bin/sh
#
# Purpose: This script starts and stops the $DAEMON_NAME daemon
#
# License: GPL
#
# chkconfig: 345 80 30  ## Add chkconfig
# description: Starts Kafka
# Source function library.
. /etc/rc.d/init.d/functions


USER=hdfs
DAEMON_PATH=/usr/local/kafka/bin
DAEMON_NAME=kafka
# Check that networking is up.
#[ ${NETWORKING} = "no" ] && exit 0

PATH=$PATH:$DAEMON_PATH

# See how we were called.
case "$1" in
  start)
        # Start daemon.
        echo -n "Starting $DAEMON_NAME: ";echo
        /bin/su $USER $DAEMON_PATH/kafka-server-start.sh
/usr/local/kafka/config/server.properties &
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down $DAEMON_NAME: ";echo
        #$DAEMON_PATH/kafka-server-stop.sh
ps ax | grep -i 'kafka.Kafka' | grep -v grep | awk '{print $1}' | xargs kill
        ;;
  restart)
        $0 stop
sleep 1
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

exit 0




On Thu, Nov 15, 2012 at 11:30 AM, James A. Robinson <
jim.robin...@stanford.edu> wrote:

> Hi folks,
>
> Do any of you have examples of unix init.d scripts that you
> use for starting and stopping Kafka?
>
> I am putting one together, but thought I'd ask if folks had any
> that might call out edge cases that need to be dealt with.
>
>
> Jim
>



-- 
-- 
*Logan Hardy *| Operations Engineer
33Across <http://www.33across.com/> | Follow us:
Twitter<http://www.twitter.com/33across>
 | Facebook <http://www.facebook.com/33across>

o 801.231.4573

*Learn about our Q1 Brand Graph Category Insights
Report<http://www.33across.com/BrandGraph/33Across_BrandGraph_AQ1_2012.pdf>
*
*
33Across and Tynt in the News
*AdWeek • AllThingsD • Bloomberg • Forbes • TechCrunch • VentureBeat •
WSJ<http://33across.com/news.php#axzz1uqxl0v16>

Reply via email to