Adding blur console scripts for console startup and shurtdown.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/198cca0e Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/198cca0e Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/198cca0e Branch: refs/heads/apache-blur-0.2 Commit: 198cca0e70ff5bb78260144c86b480361dcbdb53 Parents: a088c1c Author: Aaron McCurry <[email protected]> Authored: Thu Jun 19 18:51:38 2014 -0400 Committer: Aaron McCurry <[email protected]> Committed: Thu Jun 19 18:51:38 2014 -0400 ---------------------------------------------------------------------- distribution/src/main/scripts/bin/consoles.sh | 34 +++++++++++++++++++ .../main/scripts/bin/start-console-server.sh | 35 ++++++++++++++++++++ .../src/main/scripts/bin/start-console.sh | 35 -------------------- .../src/main/scripts/bin/start-consoles.sh | 24 ++++++++++++++ .../src/main/scripts/bin/stop-console-server.sh | 33 ++++++++++++++++++ .../src/main/scripts/bin/stop-console.sh | 33 ------------------ .../src/main/scripts/bin/stop-consoles.sh | 24 ++++++++++++++ pom.xml | 1 + 8 files changed, 151 insertions(+), 68 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/distribution/src/main/scripts/bin/consoles.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/bin/consoles.sh b/distribution/src/main/scripts/bin/consoles.sh new file mode 100755 index 0000000..61e4f7c --- /dev/null +++ b/distribution/src/main/scripts/bin/consoles.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bin=`dirname "$0"` +bin=`cd "$bin"; pwd` + +. "$bin"/blur-config.sh + +export HOSTLIST="${BLUR_HOME_CONF}/consoles" + +for console in `cat "$HOSTLIST"|sed "s/#.*$//;/^$/d"`; do + ssh $BLUR_SSH_OPTS $console $"${@// /\\ }" \ + 2>&1 | sed "s/^/$console: /" & + if [ "$BLUR_CONSOLE_SLEEP" != "" ]; then + sleep $BLUR_CONSOLE_SLEEP + fi +done + +wait + http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/distribution/src/main/scripts/bin/start-console-server.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/bin/start-console-server.sh b/distribution/src/main/scripts/bin/start-console-server.sh new file mode 100755 index 0000000..d94a6ee --- /dev/null +++ b/distribution/src/main/scripts/bin/start-console-server.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bin=`dirname "$0"` +bin=`cd "$bin"; pwd` + +. "$bin"/blur-config.sh + +PID_FILE=$BLUR_HOME/pids/console.pid + +if [ -f $PID_FILE ]; then + if kill -0 `cat $PID_FILE` > /dev/null 2>&1; then + echo Console already running as process `cat $PID_FILE`. Stop it first. + exit 0 + fi +fi + +PROC_NAME=console-$HOSTNAME +nohup "$JAVA_HOME"/bin/java -Dblur.name=$PROC_NAME -Djava.library.path=$JAVA_LIBRARY_PATH -Dblur-console $BLUR_CONSOLE_JVM_OPTIONS -Dblur.logs.dir=$BLUR_LOGS -Dblur.log.file=blur-$USER-$PROC_NAME -cp $BLUR_CLASSPATH org.apache.blur.console.Main > "$BLUR_LOGS/blur-$USER-$PROC_NAME.out" 2>&1 < /dev/null & +echo $! > $PID_FILE +echo Console starting as process `cat $PID_FILE`. http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/distribution/src/main/scripts/bin/start-console.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/bin/start-console.sh b/distribution/src/main/scripts/bin/start-console.sh deleted file mode 100755 index d94a6ee..0000000 --- a/distribution/src/main/scripts/bin/start-console.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -bin=`dirname "$0"` -bin=`cd "$bin"; pwd` - -. "$bin"/blur-config.sh - -PID_FILE=$BLUR_HOME/pids/console.pid - -if [ -f $PID_FILE ]; then - if kill -0 `cat $PID_FILE` > /dev/null 2>&1; then - echo Console already running as process `cat $PID_FILE`. Stop it first. - exit 0 - fi -fi - -PROC_NAME=console-$HOSTNAME -nohup "$JAVA_HOME"/bin/java -Dblur.name=$PROC_NAME -Djava.library.path=$JAVA_LIBRARY_PATH -Dblur-console $BLUR_CONSOLE_JVM_OPTIONS -Dblur.logs.dir=$BLUR_LOGS -Dblur.log.file=blur-$USER-$PROC_NAME -cp $BLUR_CLASSPATH org.apache.blur.console.Main > "$BLUR_LOGS/blur-$USER-$PROC_NAME.out" 2>&1 < /dev/null & -echo $! > $PID_FILE -echo Console starting as process `cat $PID_FILE`. http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/distribution/src/main/scripts/bin/start-consoles.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/bin/start-consoles.sh b/distribution/src/main/scripts/bin/start-consoles.sh new file mode 100755 index 0000000..fac7763 --- /dev/null +++ b/distribution/src/main/scripts/bin/start-consoles.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bin=`dirname "$0"` +bin=`cd "$bin"; pwd` + +. "$bin"/blur-config.sh + +$BLUR_HOME/bin/consoles.sh $BLUR_HOME/bin/start-console-server.sh + http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/distribution/src/main/scripts/bin/stop-console-server.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/bin/stop-console-server.sh b/distribution/src/main/scripts/bin/stop-console-server.sh new file mode 100755 index 0000000..4de1454 --- /dev/null +++ b/distribution/src/main/scripts/bin/stop-console-server.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bin=`dirname "$0"` +bin=`cd "$bin"; pwd` + +. "$bin"/blur-config.sh + +PID_FILE=$BLUR_HOME/pids/console.pid +if [ -f $PID_FILE ]; then + if kill -0 `cat $PID_FILE` > /dev/null 2>&1; then + echo Stopping Console with pid [`cat $PID_FILE`]. + kill `cat $PID_FILE` + else + echo No Console to stop + fi +else + echo No Console to stop +fi http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/distribution/src/main/scripts/bin/stop-console.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/bin/stop-console.sh b/distribution/src/main/scripts/bin/stop-console.sh deleted file mode 100755 index 4de1454..0000000 --- a/distribution/src/main/scripts/bin/stop-console.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -bin=`dirname "$0"` -bin=`cd "$bin"; pwd` - -. "$bin"/blur-config.sh - -PID_FILE=$BLUR_HOME/pids/console.pid -if [ -f $PID_FILE ]; then - if kill -0 `cat $PID_FILE` > /dev/null 2>&1; then - echo Stopping Console with pid [`cat $PID_FILE`]. - kill `cat $PID_FILE` - else - echo No Console to stop - fi -else - echo No Console to stop -fi http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/distribution/src/main/scripts/bin/stop-consoles.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/bin/stop-consoles.sh b/distribution/src/main/scripts/bin/stop-consoles.sh new file mode 100755 index 0000000..6588a40 --- /dev/null +++ b/distribution/src/main/scripts/bin/stop-consoles.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bin=`dirname "$0"` +bin=`cd "$bin"; pwd` + +. "$bin"/blur-config.sh + +$BLUR_HOME/bin/consoles.sh $BLUR_HOME/bin/stop-console-server.sh + http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/198cca0e/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 77c3375..48f2f02 100644 --- a/pom.xml +++ b/pom.xml @@ -284,6 +284,7 @@ under the License. <!-- Default configuration files used by Blur --> <exclude>**/src/main/scripts/conf/controllers</exclude> + <exclude>**/src/main/scripts/conf/consoles</exclude> <exclude>**/src/main/scripts/conf/default_zoo.cfg</exclude> <exclude>**/src/main/scripts/conf/shards</exclude> <exclude>**/src/main/scripts/conf/zookeepers</exclude>
