diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index eaf7cdc94b8..6b7f83148e6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -253,6 +253,8 @@ Trunk (Unreleased) HDFS-6981. Fix DN upgrade with layout version change. (Arpit Agarwal) + HDFS-7204. balancer doesn't run as a daemon (aw) + Release 2.7.0 - UNRELEASED diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs index e88ae08e192..67e82f19880 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs @@ -83,6 +83,7 @@ shift case ${COMMAND} in balancer) + daemon="true" CLASS=org.apache.hadoop.hdfs.server.balancer.Balancer hadoop_debug "Appending HADOOP_BALANCER_OPTS onto HADOOP_OPTS" HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_BALANCER_OPTS}" diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-balancer.sh b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-balancer.sh index a116502fc75..321f9c96908 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-balancer.sh +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-balancer.sh @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -function usage +function hadoop_usage { echo "Usage: start-balancer.sh [--config confdir] [-policy ] [-threshold ]" } @@ -42,4 +42,4 @@ fi # Start balancer daemon. -exec "${bin}/hadoop-daemon.sh" --config "${HADOOP_CONF_DIR}" start balancer "$@" +exec "${HADOOP_HDFS_HOME}/bin/hdfs" --config "${HADOOP_CONF_DIR}" --daemon start balancer "$@" diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-balancer.sh b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-balancer.sh index 718f8674369..da25d469d9e 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-balancer.sh +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-balancer.sh @@ -43,4 +43,4 @@ fi # Stop balancer daemon. # Run this on the machine where the balancer is running -"${bin}/hadoop-daemon.sh" --config "${HADOOP_CONF_DIR}" stop balancer +exec "${HADOOP_HDFS_HOME}/bin/hdfs" --config "${HADOOP_CONF_DIR}" --daemon stop balancer