forked from qubole/rubix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new:usr:Improve RPM package with configuration and scripts (qubole#52)
This commit adds * configuration files for bookkeeper and lds. * Start/Stop scripts * Sets up run, log and conf directories. Tested using rubix-admin on Qubole clusters.
- Loading branch information
Showing
5 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
log4j.rootLogger=WARN, R | ||
|
||
log4j.appender.R=org.apache.log4j.RollingFileAppender | ||
log4j.appender.R.File=/var/log/rubix/bks.log | ||
log4j.appender.R.MaxFileSize=10MB | ||
log4j.appender.R.MaxBackupIndex=2 | ||
log4j.appender.R.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.R.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss,SSS} %p %t %c{2}: %m%n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
log4j.rootLogger=WARN, R | ||
|
||
log4j.appender.R=org.apache.log4j.RollingFileAppender | ||
log4j.appender.R.File=/var/log/rubix/lds.log | ||
log4j.appender.R.MaxFileSize=10MB | ||
log4j.appender.R.MaxBackupIndex=2 | ||
log4j.appender.R.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.R.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss,SSS} %p %t %c{2}: %m%n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash -e | ||
|
||
d=`dirname $0` | ||
d=`cd "$d"; pwd` | ||
|
||
RUN_DIR=/var/run/rubix | ||
PID_FILE=${RUN_DIR}/bks.pid | ||
PID_FILE_2=${RUN_DIR}/lts.pid | ||
MONITRC_FILE=/etc/monit.d/bks.cfg | ||
LOG4J_FILE=/etc/rubix/log4j.properties | ||
LOG4J_FILE_LDS=/etc/rubix/log4j_lds.properties | ||
|
||
LOG_DIR=/var/logs/rubix | ||
LOG_FILE=${LOG_DIR}/bks.log | ||
LOG_FILE_LDS=${LOG_DIR}/lds.log | ||
|
||
# increase mmap system limit | ||
sudo sysctl -w vm.max_map_count=200000 | ||
|
||
usage() { | ||
echo "Usage: $0" | ||
echo "$1" | ||
echo "start and stop the Cache BookKeeper Server." | ||
echo "$0 [start|stop]" | ||
exit $2 | ||
} | ||
|
||
start() { | ||
export HADOOP_OPTS="-Dlog4j.configuration=file://${LOG4J_FILE}" | ||
# Set the fs impls as CachingNativeS3FileSystem for book-keeper. | ||
ulimit -n 100000 | ||
nohup /usr/lib/hadoop2/bin/hadoop jar /usr/lib/rubix/lib/rubix-bookkeeper-*.jar com.qubole.rubix.bookkeeper.BookKeeperServer & | ||
|
||
PID=$! | ||
echo $PID > ${PID_FILE} | ||
|
||
echo "Starting Cache BookKeeper server with pid `cat ${PID_FILE}`" | ||
export HADOOP_OPTS="-Dlog4j.configuration=file://${LOG4J_FILE_LDS}" | ||
nohup /usr/lib/hadoop2/bin/hadoop jar /usr/lib/rubix/lib/rubix-bookkeeper-*.jar com.qubole.rubix.bookkeeper.LocalDataTransferServer & | ||
PIDL=$! | ||
echo $PIDL > ${PID_FILE_2} | ||
echo "Starting Local Transfer server with pid $PIDL" | ||
sleep 1 | ||
} | ||
|
||
stop() { | ||
kill -9 `cat ${PID_FILE}` | ||
kill -9 `cat ${PID_FILE_2}` | ||
rm -f ${PID_FILE} | ||
rm -f ${PID_FILE_2} | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
cmd=$1 | ||
|
||
case "$cmd" in | ||
start) start;; | ||
stop) stop;; | ||
restart) restart;; | ||
help) usage "" 0;; | ||
*) usage "ERROR: Incorrect arguments" 1;; | ||
esac | ||
|
||
exit 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cp /usr/lib/rubix/bin/rubix.service /etc/init.d |