Skip to content

Commit

Permalink
Remove secondary master
Browse files Browse the repository at this point in the history
### What changes are proposed in this pull request?

Remove secondary master

### Why are the changes needed?

Secondary Master is no longer used

### Does this PR introduce any user facing changes?

- Property key `alluxio.secondary.master.metastore.dir` is removed
			pr-link: #17823
			change-id: cid-6eabcd4e53d29aba7cea403ea8172a6af4a1328d
  • Loading branch information
apc999 authored Jul 22, 2023
1 parent d262c46 commit 4d4c7e2
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 387 deletions.
11 changes: 2 additions & 9 deletions bin/alluxio-masters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,16 @@ ALLUXIO_TASK_LOG="${ALLUXIO_LOGS_DIR}/task.log"

echo "Executing the following command on all master nodes and logging to ${ALLUXIO_TASK_LOG}: $@" | tee -a ${ALLUXIO_TASK_LOG}

N=0
HA_ENABLED=$(${BIN}/alluxio getConf ${ALLUXIO_MASTER_JAVA_OPTS} alluxio.zookeeper.enabled)
JOURNAL_TYPE=$(${BIN}/alluxio getConf ${ALLUXIO_MASTER_JAVA_OPTS} alluxio.master.journal.type | awk '{print toupper($0)}')
if [[ ${JOURNAL_TYPE} == "EMBEDDED" ]]; then
HA_ENABLED="true"
fi
for master in ${HOSTLIST[@]}; do
echo "[${master}] Connecting as ${USER}..." >> ${ALLUXIO_TASK_LOG}
if [[ ${HA_ENABLED} == "true" || ${N} -eq 0 ]]; then
nohup $(ssh_command ${master}) ${LAUNCHER} \
$"${@// /\\ }" 2>&1 | while read line; do echo "[$(date '+%F %T')][${master}] ${line}"; done >> ${ALLUXIO_TASK_LOG} &
else
nohup $(ssh_command ${master}) ${LAUNCHER} \
$"export ALLUXIO_MASTER_SECONDARY=true; ${@// /\\ }" 2>&1 | while read line; do echo "[$(date '+%F %T')][${master}] ${line}"; done >> ${ALLUXIO_TASK_LOG} &
fi
nohup $(ssh_command ${master}) ${LAUNCHER} \
$"${@// /\\ }" 2>&1 | while read line; do echo "[$(date '+%F %T')][${master}] ${line}"; done >> ${ALLUXIO_TASK_LOG} &
pids[${#pids[@]}]=$!
N=$((N+1))
done

# wait for all pids
Expand Down
36 changes: 5 additions & 31 deletions bin/alluxio-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Where ACTION is one of:
job_workers \tStart job_workers on worker nodes.
local [MOPT] [-c cache] \tStart all processes locally.
master \tStart the local master on this node.
secondary_master \tStart the local secondary master on this node.
masters \tStart masters on master nodes.
proxy \tStart the proxy on this node.
proxies \tStart proxies on master and worker nodes.
Expand Down Expand Up @@ -134,10 +133,8 @@ start_job_master() {
${LAUNCHER} "${BIN}/alluxio" format
fi

if [[ ${ALLUXIO_MASTER_SECONDARY} != "true" ]]; then
echo "Starting job master @ $(hostname -f). Logging to ${ALLUXIO_LOGS_DIR}"
(nohup ${BIN}/launch-process job_master > ${ALLUXIO_LOGS_DIR}/job_master.out 2>&1) &
fi
echo "Starting job master @ $(hostname -f). Logging to ${ALLUXIO_LOGS_DIR}"
(nohup ${BIN}/launch-process job_master > ${ALLUXIO_LOGS_DIR}/job_master.out 2>&1) &
}

start_job_masters() {
Expand Down Expand Up @@ -172,17 +169,8 @@ start_master() {
fi
fi

if [[ ${ALLUXIO_MASTER_SECONDARY} == "true" ]]; then
if [[ `${LAUNCHER} ${BIN}/alluxio getConf ${ALLUXIO_MASTER_JAVA_OPTS} alluxio.master.journal.type` == "EMBEDDED" ]]; then
echo "Secondary master is not supported for journal type: EMBEDDED"
exit 1
fi
echo "Starting secondary master @ $(hostname -f). Logging to ${ALLUXIO_LOGS_DIR}"
(nohup ${BIN}/launch-process secondary_master > ${ALLUXIO_LOGS_DIR}/secondary_master.out 2>&1) &
else
echo "Starting master @ $(hostname -f). Logging to ${ALLUXIO_LOGS_DIR}"
(JOURNAL_BACKUP="${journal_backup}" nohup ${BIN}/launch-process master > ${ALLUXIO_LOGS_DIR}/master.out 2>&1) &
fi
echo "Starting master @ $(hostname -f). Logging to ${ALLUXIO_LOGS_DIR}"
(JOURNAL_BACKUP="${journal_backup}" nohup ${BIN}/launch-process master > ${ALLUXIO_LOGS_DIR}/master.out 2>&1) &
}

start_masters() {
Expand Down Expand Up @@ -445,7 +433,7 @@ main() {

if [[ "${killonstart}" != "no" ]]; then
case "${ACTION}" in
all | local | master | masters | secondary_master | job_master | job_masters | proxy | proxies | worker | workers | job_worker | job_workers )
all | local | master | masters | job_master | job_masters | proxy | proxies | worker | workers | job_worker | job_workers )
stop ${ACTION}
sleep 1
;;
Expand Down Expand Up @@ -488,14 +476,6 @@ main() {
${LAUNCHER} ${BIN}/alluxio formatWorker
fi
start_master
ALLUXIO_MASTER_SECONDARY=true
# We only start a secondary master when using a UFS journal.
local journal_type=$(${BIN}/alluxio getConf ${ALLUXIO_MASTER_JAVA_OPTS} \
alluxio.master.journal.type | awk '{print toupper($0)}')
if [[ ${journal_type} == "UFS" ]]; then
start_master
fi
ALLUXIO_MASTER_SECONDARY=false
start_job_master
sleep 2
start_worker "${MOPT}"
Expand All @@ -517,12 +497,6 @@ main() {
master)
start_master "${FORMAT}"
;;
secondary_master)
ALLUXIO_MASTER_SECONDARY=true
async=true # there does not exist a monitor process for secondary_master
start_master
ALLUXIO_MASTER_SECONDARY=false
;;
masters)
start_masters
;;
Expand Down
18 changes: 2 additions & 16 deletions bin/alluxio-stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Where component is one of:
job_workers \tStop job workers on worker nodes.
local [-c cache] \tStop all processes locally.
master \tStop local primary master.
secondary_master \tStop local secondary master.
masters \tStop masters on master nodes.
proxy \tStop local proxy.
proxies \tStop proxies on master and worker nodes.
Expand Down Expand Up @@ -88,13 +87,8 @@ stop_job_workers() {
}

stop_master() {
if [[ ${ALLUXIO_MASTER_SECONDARY} == "true" ]]; then
generate_kill_command "alluxio.master.AlluxioSecondaryMaster"
${LAUNCHER} "${KILL_COMMAND[@]}"
else
generate_kill_command "alluxio.master.AlluxioMaster"
${LAUNCHER} "${KILL_COMMAND[@]}"
fi
generate_kill_command "alluxio.master.AlluxioMaster"
${LAUNCHER} "${KILL_COMMAND[@]}"
}

stop_masters() {
Expand Down Expand Up @@ -208,9 +202,6 @@ case "${WHAT}" in
stop_job_worker
stop_job_master
stop_worker
ALLUXIO_MASTER_SECONDARY=true
stop_master
ALLUXIO_MASTER_SECONDARY=false
stop_master
;;
job_master)
Expand All @@ -228,11 +219,6 @@ case "${WHAT}" in
master)
stop_master
;;
secondary_master)
ALLUXIO_MASTER_SECONDARY=true
stop_master
ALLUXIO_MASTER_SECONDARY=false
;;
masters)
stop_masters
;;
Expand Down
23 changes: 1 addition & 22 deletions bin/launch-process
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ desired process in the foreground. It is recommended to use alluxio-start.sh
unless you know what you are doing.
"
USAGE+="
<process name> One of: master, secondary_master, job_master, worker,
<process name> One of: master, job_master, worker,
job_worker, proxy"
USAGE+="
Expand Down Expand Up @@ -60,7 +60,6 @@ contains() {
# The variables that should be set after running this function:
# - ALLUXIO_JAVA_OPTS
# - ALLUXIO_MASTER_JAVA_OPTS
# - ALLUXIO_SECONDARY_MASTER_JAVA_OPTS
# - ALLUXIO JOB_MASTER_JAVA_OPTS
# - ALLUXIO_WORKER_JAVA_OPTS
# - ALLUXIO_JOB_WORKER_JAVA_OPTS
Expand Down Expand Up @@ -140,19 +139,6 @@ launch_master() {
"alluxio.master.AlluxioMaster"
}

# Launch a secondary master process
launch_secondary_master() {
# use a default Xmx value for the master
local contain_xmx="$(contains "${ALLUXIO_SECONDARY_MASTER_JAVA_OPTS}" "Xmx")"
local contain_max_percentage="$(contains "${ALLUXIO_SECONDARY_MASTER_JAVA_OPTS}" "MaxRAMPercentage")"
if [[ "${contain_xmx}" -eq "0" ]] && [[ "${contain_max_percentage}" -eq "0" ]]; then
ALLUXIO_SECONDARY_MASTER_JAVA_OPTS+=" -Xmx8g "
fi
launch_process "${ALLUXIO_SECONDARY_MASTER_ATTACH_OPTS}" \
"${ALLUXIO_SECONDARY_MASTER_JAVA_OPTS}" \
"alluxio.master.AlluxioSecondaryMaster"
}

# Launch a job master process
launch_job_master() {
launch_process "${ALLUXIO_JOB_MASTER_ATTACH_OPTS}" \
Expand Down Expand Up @@ -227,10 +213,6 @@ main() {
logger_var_name="ALLUXIO_MASTER_LOGGER"
logger_var_value="MASTER_LOGGER"
;;
secondary_master)
logger_var_name="ALLUXIO_SECONDARY_MASTER_LOGGER"
logger_var_value="SECONDARY_MASTER_LOGGER"
;;
job_master)
logger_var_name="ALLUXIO_JOB_MASTER_LOGGER"
logger_var_value="JOB_MASTER_LOGGER"
Expand Down Expand Up @@ -268,9 +250,6 @@ main() {
master)
launch_master
;;
secondary_master)
launch_secondary_master
;;
job_master)
launch_job_master
;;
Expand Down
4 changes: 0 additions & 4 deletions conf/alluxio-env.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@
# E.g. "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=60001"
# ALLUXIO_MASTER_ATTACH_OPTS

# Configuring remote debugging for Alluxio secondary master process. (Default: "")
# E.g. "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=60010"
# ALLUXIO_SECONDARY_MASTER_ATTACH_OPTS

# Configuring remote debugging for Alluxio job master process. (Default: "")
# E.g. "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=60002"
# ALLUXIO_JOB_MASTER_ATTACH_OPTS
Expand Down
8 changes: 0 additions & 8 deletions conf/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ log4j.appender.MASTER_LOGGER.MaxBackupIndex=100
log4j.appender.MASTER_LOGGER.layout=org.apache.log4j.PatternLayout
log4j.appender.MASTER_LOGGER.layout.ConversionPattern=%d{ISO8601} %-5p [%t](%F:%L) - %m%n

# Appender for Master
log4j.appender.SECONDARY_MASTER_LOGGER=org.apache.log4j.RollingFileAppender
log4j.appender.SECONDARY_MASTER_LOGGER.File=${alluxio.logs.dir}/secondary_master.log
log4j.appender.SECONDARY_MASTER_LOGGER.MaxFileSize=10MB
log4j.appender.SECONDARY_MASTER_LOGGER.MaxBackupIndex=100
log4j.appender.SECONDARY_MASTER_LOGGER.layout=org.apache.log4j.PatternLayout
log4j.appender.SECONDARY_MASTER_LOGGER.layout.ConversionPattern=%d{ISO8601} %-5p [%t](%F:%L) - %m%n

# Appender for Master audit
log4j.appender.MASTER_AUDIT_LOGGER=org.apache.log4j.RollingFileAppender
log4j.appender.MASTER_AUDIT_LOGGER.File=${alluxio.logs.dir}/master_audit.log
Expand Down
2 changes: 0 additions & 2 deletions docs/_data/table/en/env_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
description: Additional classpath entries for Alluxio processes. Empty by default.
- name: ALLUXIO_MASTER_ATTACH_OPTS
description: Additional Java VM options to apply when attaching a debugger to Alluxio master.
- name: ALLUXIO_SECONDARY_MASTER_ATTACH_OPTS
description: Additional Java VM options to apply when attaching a debugger to Alluxio secondary master.
- name: ALLUXIO_JOB_MASTER_ATTACH_OPTS
description: Additional Java VM options to apply when attaching a debugger to Alluxio job master.
- name: ALLUXIO_WORKER_ATTACH_OPTS
Expand Down
16 changes: 1 addition & 15 deletions dora/core/common/src/main/java/alluxio/conf/PropertyKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -4206,18 +4206,6 @@ public String toString() {
.setDefaultValue(1000)
.build();

//
// Secondary master related properties
//
public static final PropertyKey SECONDARY_MASTER_METASTORE_DIR =
stringBuilder(Name.SECONDARY_MASTER_METASTORE_DIR)
.setDefaultValue(format("${%s}/secondary-metastore", Name.WORK_DIR))
.setDescription(
"The secondary master metastore work directory. Only some metastores need disk.")
.setConsistencyCheckLevel(ConsistencyCheckLevel.WARN)
.setScope(Scope.SERVER)
.build();

//
// File system master related properties
//
Expand Down Expand Up @@ -8821,10 +8809,8 @@ public static final class Name {
"alluxio.master.throttle.filesystem.rpc.queue.size.limit";

//
// Secondary master related properties
// Standby master related properties
//
public static final String SECONDARY_MASTER_METASTORE_DIR =
"alluxio.secondary.master.metastore.dir";
public static final String STANDBY_MASTER_METRICS_SINK_ENABLED =
"alluxio.standby.master.metrics.sink.enabled";
public static final String STANDBY_MASTER_WEB_ENABLED =
Expand Down

This file was deleted.

Loading

0 comments on commit 4d4c7e2

Please sign in to comment.