Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696922
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
View Options
diff --git a/templates/mirror.init.erb b/templates/mirror.init.erb
index 214e910..c735b14 100644
--- a/templates/mirror.init.erb
+++ b/templates/mirror.init.erb
@@ -1,85 +1,88 @@
#!/bin/sh
NAME=kafka-mirror
PID_FILE=/var/run/$NAME.pid
DAEMON="/opt/kafka/bin/kafka-run-class.sh"
DAEMON_OPTS="kafka.tools.MirrorMaker <%- @consumer_config.sort.each do |c| -%> --consumer.config /opt/kafka/config/<%= c[0] -%>.properties<%- end -%> --num.streams <%= @num_streams -%> --producer.config <%= @producer_config -%> --num.producers <%= num_producers -%><%- if !@whitelist.eql?('') -%> --whitelist=\"<%= @whitelist -%>\"<%- end %><%- if !@blacklist.eql?('') -%> --blacklist=\"<%= @blacklist -%>\"<%- end -%>"
start() {
+ ulimit -n 65536
+ ulimit -s 10240
+ ulimit -c unlimited
if [ -f $PID_FILE ]
then
PID=`cat $PID_FILE`
if [ -z "`ps -ef | awk '{print $2}' | grep "^$PID$"`" ]; then
echo "\n$PID_FILE exists, process is already running"
exit 0
else
echo "\n$PID_FILE exists but the process is not running. Deleting $PID_FILE and re-trying"
rm -f $PID_FILE
start
fi
else
exec $DAEMON $DAEMON_OPTS >> /var/log/kafka/mirror.log 2>&1 &
sleep 2
PID=`ps ax | grep -E '[k]afka.tools.MirrorMaker' | awk '{print $1}'`
echo $PID > $PID_FILE;
echo "\n$NAME started"
fi
}
stop() {
if [ ! -f $PID_FILE ]
then
echo "\n$PID_FILE does not exist, process is not running"
return 1
else
kill `cat $PID_FILE`;
rm -f $PID_FILE;
echo "\n$NAME stopped"
return 0
fi
}
status() {
if [ -f $PID_FILE ]
then
PID=`cat $PID_FILE`
if [ -z "`ps -ef | awk '{print $2}' | grep "^$PID$"`" ]
then
echo "$NAME stopped but pid file exists"
exit 1
else
echo "$NAME running with pid $PID"
exit 0
fi
else
echo "$NAME stopped"
exit 1
fi
}
case "$1" in
status)
status
;;
start)
echo -n "Starting daemon: "$NAME
start
;;
stop)
echo -n "Stopping daemon: "$NAME
stop
;;
restart)
echo -n "Restarting daemon: "$NAME
stop
sleep 2
start
;;
*)
echo "Usage: "$1" {status|start|stop|restart}"
exit 1
esac
exit 0
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Aug 18, 10:08 PM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3328307
Attached To
R143 puppet-puppet-kafka
Event Timeline
Log In to Comment