Updates shell scripts and logs to use manager (#1871)
diff --git a/assemble/bin/accumulo-cluster b/assemble/bin/accumulo-cluster
index 2b020e7..8dd6ec0 100755
--- a/assemble/bin/accumulo-cluster
+++ b/assemble/bin/accumulo-cluster
@@ -57,37 +57,37 @@
exit 1
fi
- unset master1
- if [[ -f "${conf}/masters" ]]; then
- master1=$(egrep -v '(^#|^\s*$)' "${conf}/masters" | head -1)
+ unset manager1
+ if [[ -f "${conf}/$manager_file" ]]; then
+ manager1=$(egrep -v '(^#|^\s*$)' "${conf}/$manager_file" | head -1)
fi
if [[ -z "${monitor}" ]] ; then
- monitor=$master1
+ monitor=$manager1
if [[ -f "${conf}/monitor" ]]; then
monitor=$(egrep -v '(^#|^\s*$)' "${conf}/monitor" | head -1)
fi
if [[ -z "${monitor}" ]] ; then
echo "Could not infer a Monitor role. You need to either define \"${conf}/monitor\","
- echo "or make sure \"${conf}/masters\" is non-empty."
+ echo "or make sure \"${conf}/$manager_file\" is non-empty."
exit 1
fi
fi
if [[ ! -f "${conf}/tracers" ]]; then
- if [[ -z "${master1}" ]] ; then
+ if [[ -z "${manager1}" ]] ; then
echo "Could not find a master node to use as a default for the tracer role."
- echo "Either set up \"${conf}/tracers\" or make sure \"${conf}/masters\" is non-empty."
+ echo "Either set up \"${conf}/tracers\" or make sure \"${conf}/$manager_file\" is non-empty."
exit 1
else
- echo "$master1" > "${conf}/tracers"
+ echo "$manager1" > "${conf}/tracers"
fi
fi
if [[ ! -f "${conf}/gc" ]]; then
- if [[ -z "${master1}" ]] ; then
- echo "Could not infer a GC role. You need to either set up \"${conf}/gc\" or make sure \"${conf}/masters\" is non-empty."
+ if [[ -z "${manager1}" ]] ; then
+ echo "Could not infer a GC role. You need to either set up \"${conf}/gc\" or make sure \"${conf}/$manager_file\" is non-empty."
exit 1
else
- echo "$master1" > "${conf}/gc"
+ echo "$manager1" > "${conf}/gc"
fi
fi
}
@@ -147,8 +147,8 @@
start_tservers
fi
- for host in $(egrep -v '(^#|^\s*$)' "${conf}/masters"); do
- start_service "$host" master
+ for host in $(egrep -v '(^#|^\s*$)' "${conf}/$manager_file"); do
+ start_service "$host" manager
done
for host in $(egrep -v '(^#|^\s*$)' "${conf}/gc"); do
@@ -173,8 +173,8 @@
done
for host in $local_hosts; do
- if grep -q "^${host}\$" "${conf}/masters"; then
- start_service "$host" master
+ if grep -q "^${host}\$" "${conf}/$manager_file"; then
+ start_service "$host" manager
break
fi
done
@@ -235,7 +235,7 @@
function kill_all() {
echo "Killing Accumulo cluster..."
- for master in $(grep -v '^#' "${conf}/masters"); do
+ for master in $(grep -v '^#' "${conf}/$manager_file"); do
kill_service "$master" master
done
@@ -275,8 +275,8 @@
# Look for processes not killed by 'admin stopAll'
for end_cmd in "stop" "kill" ; do
- for master in $(grep -v '^#' "${conf}/masters"); do
- end_service "$master" master $end_cmd
+ for manager in $(grep -v '^#' "${conf}/$manager_file"); do
+ end_service "$manager" manager $end_cmd
done
for gc in $(grep -v '^#' "${conf}/gc"); do
@@ -340,10 +340,16 @@
accumulo_cmd="${bin}/accumulo"
SSH='ssh -qnf -o ConnectTimeout=2'
+ manager_file="managers"
+ if [[ ! -f "$conf/$manager_file" && -f "$conf/masters" ]]; then
+ echo "WARN : Use of 'masters' file is deprecated; use 'managers' file instead."
+ manager_file="masters"
+ fi
+
case "$1" in
create-config)
echo "localhost" > "$conf/gc"
- echo "localhost" > "$conf/masters"
+ echo "localhost" > "$conf/managers"
echo "localhost" > "$conf/monitor"
echo "localhost" > "$conf/tracers"
echo "localhost" > "$conf/tservers"
diff --git a/assemble/bin/accumulo-service b/assemble/bin/accumulo-service
index 95696b8..fd7d070 100755
--- a/assemble/bin/accumulo-service
+++ b/assemble/bin/accumulo-service
@@ -25,7 +25,8 @@
Services:
gc Accumulo garbage collector
monitor Accumulo monitor
- master Accumulo master
+ manager Accumulo manager
+ master Accumulo master (Deprecated)
tserver Accumulo tserver
tracer Accumulo tracter
@@ -67,7 +68,7 @@
fi
echo "Starting $service on $host"
- if [[ $service == "master" ]]; then
+ if [[ $service == "manager" ]]; then
"${bin}/accumulo" org.apache.accumulo.master.state.SetGoalState NORMAL
fi
@@ -137,9 +138,15 @@
host=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
fi
service="$1"
+
+ if [[ $service == "master" ]]; then
+ echo "WARN : Use of 'master' service name is deprecated; use 'manager' instead."
+ service="manager"
+ fi
+
pid_file="${ACCUMULO_PID_DIR}/accumulo-${service}${ACCUMULO_SERVICE_INSTANCE}.pid"
case "$service" in
- gc|master|monitor|tserver|tracer)
+ gc|manager|monitor|tserver|tracer)
if [[ -z $2 ]]; then
invalid_args "<command> cannot be empty"
fi
diff --git a/assemble/conf/accumulo-env.sh b/assemble/conf/accumulo-env.sh
index e2cea10..3161b8b 100644
--- a/assemble/conf/accumulo-env.sh
+++ b/assemble/conf/accumulo-env.sh
@@ -20,7 +20,7 @@
## Before accumulo-env.sh is loaded, these environment variables are set and can be used in this file:
-# cmd - Command that is being called such as tserver, master, etc.
+# cmd - Command that is being called such as tserver, manager, etc.
# basedir - Root of Accumulo installation
# bin - Directory containing Accumulo scripts
# conf - Directory containing Accumulo configuration
@@ -79,7 +79,7 @@
## JVM options set for individual applications
case "$cmd" in
- master) JAVA_OPTS=("${JAVA_OPTS[@]}" '-Xmx512m' '-Xms512m') ;;
+ manager|master) JAVA_OPTS=("${JAVA_OPTS[@]}" '-Xmx512m' '-Xms512m') ;;
monitor) JAVA_OPTS=("${JAVA_OPTS[@]}" '-Xmx256m' '-Xms256m') ;;
gc) JAVA_OPTS=("${JAVA_OPTS[@]}" '-Xmx256m' '-Xms256m') ;;
tserver) JAVA_OPTS=("${JAVA_OPTS[@]}" '-Xmx768m' '-Xms768m') ;;
@@ -95,7 +95,7 @@
)
case "$cmd" in
- monitor|gc|master|tserver|tracer)
+ monitor|gc|manager|master|tserver|tracer)
JAVA_OPTS=("${JAVA_OPTS[@]}" "-Dlog4j.configurationFile=log4j2-service.properties")
;;
*)
diff --git a/server/manager/src/main/java/org/apache/accumulo/master/ManagerExecutable.java b/server/manager/src/main/java/org/apache/accumulo/master/ManagerExecutable.java
new file mode 100644
index 0000000..e4d2e33
--- /dev/null
+++ b/server/manager/src/main/java/org/apache/accumulo/master/ManagerExecutable.java
@@ -0,0 +1,48 @@
+/*
+ * 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.apache.accumulo.master;
+
+import org.apache.accumulo.start.spi.KeywordExecutable;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(KeywordExecutable.class)
+public class ManagerExecutable implements KeywordExecutable {
+
+ @Override
+ public String keyword() {
+ return "manager";
+ }
+
+ @Override
+ public UsageGroup usageGroup() {
+ return UsageGroup.PROCESS;
+ }
+
+ @Override
+ public String description() {
+ return "Starts Accumulo Manager";
+ }
+
+ @Override
+ public void execute(final String[] args) throws Exception {
+ Master.main(args);
+ }
+
+}
diff --git a/server/manager/src/main/java/org/apache/accumulo/master/MasterExecutable.java b/server/manager/src/main/java/org/apache/accumulo/master/MasterExecutable.java
index a2a4461..8de1cc6 100644
--- a/server/manager/src/main/java/org/apache/accumulo/master/MasterExecutable.java
+++ b/server/manager/src/main/java/org/apache/accumulo/master/MasterExecutable.java
@@ -37,7 +37,7 @@
@Override
public String description() {
- return "Starts Accumulo master";
+ return "Starts Accumulo master (Deprecated)";
}
@Override
diff --git a/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java b/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
index 2fe91ee..f7958da 100644
--- a/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
@@ -40,6 +40,7 @@
import org.apache.accumulo.core.util.Version;
import org.apache.accumulo.gc.GCExecutable;
import org.apache.accumulo.gc.SimpleGarbageCollector;
+import org.apache.accumulo.master.ManagerExecutable;
import org.apache.accumulo.master.Master;
import org.apache.accumulo.master.MasterExecutable;
import org.apache.accumulo.minicluster.MiniAccumuloRunner;
@@ -110,6 +111,7 @@
expectSet.put("info", Info.class);
expectSet.put("init", Initialize.class);
expectSet.put("login-info", LoginProperties.class);
+ expectSet.put("manager", ManagerExecutable.class);
expectSet.put("master", MasterExecutable.class);
expectSet.put("minicluster", MiniClusterExecutable.class);
expectSet.put("monitor", MonitorExecutable.class);