diff --git a/bin/format-database.sh b/bin/smart-init.sh similarity index 99% rename from bin/format-database.sh rename to bin/smart-init.sh index 69cd1b71023..b5589bba3a4 100755 --- a/bin/format-database.sh +++ b/bin/smart-init.sh @@ -57,4 +57,4 @@ if [ x"$?" = x"0" ]; then echo "[Success]" else echo "[Failed]" -fi \ No newline at end of file +fi diff --git a/bin/start-smart.sh b/bin/start-smart.sh index 647d7ef6892..d3f35c19bac 100755 --- a/bin/start-smart.sh +++ b/bin/start-smart.sh @@ -56,20 +56,18 @@ done SMARTSERVERS=$("${SMART_HOME}/bin/smart" getconf SmartServers 2>/dev/null) if [ "$?" != "0" ]; then - echo "${SMARTSERVERS}" - exit 1 + echo "${SMARTSERVERS}" + exit 1 fi -#if [[ -z "${SMARTSERVERS}" ]]; then -#SMARTSERVERS=$HOSTNAME -#fi - -echo "Starting SmartServers on [${SMARTSERVERS}]" - -. "${SMART_HOME}/bin/smart" \ - --remote \ - --config "${SMART_CONF_DIR}" \ - --hosts "${SMARTSERVERS}" --hostsend \ - --daemon start ${DEBUG_OPT} \ - smartserver - +if [ x"${SMARTSERVERS}" != x"" ]; then + echo "Starting SmartServers on [${SMARTSERVERS}]" + . "${SMART_HOME}/bin/smart" \ + --remote \ + --config "${SMART_CONF_DIR}" \ + --hosts "${SMARTSERVERS}" --hostsend \ + --daemon start ${DEBUG_OPT} \ + smartserver +else + echo "No SmartServers configured in 'hazelcast.xml'." +fi diff --git a/bin/stop-smart.sh b/bin/stop-smart.sh index 17d2cb36d20..ac46d5b8533 100755 --- a/bin/stop-smart.sh +++ b/bin/stop-smart.sh @@ -56,16 +56,14 @@ if [ "$?" != "0" ]; then exit 1 fi -#if [[ -z "${SMARTSERVERS}" ]]; then -#SMARTSERVERS=$HOSTNAME -#fi - -echo "Stopping SmartServers on [${SMARTSERVERS}]" - -. "${SMART_HOME}/bin/smart" \ - --remote \ - --config "${SMART_CONF_DIR}" \ - --hosts "${SMARTSERVERS}" --hostsend \ - --daemon stop ${DEBUG_OPT} \ - smartserver - +if [ x"${SMARTSERVERS}" != x"" ]; then + echo "Stopping SmartServers on [${SMARTSERVERS}]" + . "${SMART_HOME}/bin/smart" \ + --remote \ + --config "${SMART_CONF_DIR}" \ + --hosts "${SMARTSERVERS}" --hostsend \ + --daemon stop ${DEBUG_OPT} \ + smartserver +else + echo "No SmartServers configured in 'hazelcast.xml'." +fi diff --git a/smart-engine/src/main/java/org/smartdata/server/utils/tools/GetConf.java b/smart-engine/src/main/java/org/smartdata/server/utils/tools/GetConf.java new file mode 100644 index 00000000000..85e86165d69 --- /dev/null +++ b/smart-engine/src/main/java/org/smartdata/server/utils/tools/GetConf.java @@ -0,0 +1,59 @@ +/** + * 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. + */ +package org.smartdata.server.utils.tools; + +import com.hazelcast.config.ClasspathXmlConfig; + +import java.io.PrintStream; +import java.util.List; + +public class GetConf { + public static final String USAGE="USAGE: GetConf