浏览代码

HADOOP-2930. Make {start,stop}-balancer.sh work even if hadoop-daemon.sh isn't in the PATH. Contributed by Spiros Papadimitriou.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@653634 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 17 年之前
父节点
当前提交
4fef260756
共有 3 个文件被更改,包括 13 次插入2 次删除
  1. 3 0
      CHANGES.txt
  2. 5 1
      bin/start-balancer.sh
  3. 5 1
      bin/stop-balancer.sh

+ 3 - 0
CHANGES.txt

@@ -162,6 +162,9 @@ Trunk (unreleased changes)
     HADOOP-3335. Prevent the libhdfs build from deleting the wrong
     files on make clean. (cutting via omalley)
 
+    HADOOP-2930. Make {start,stop}-balancer.sh work even if hadoop-daemon.sh
+    is not in the PATH. (Spiros Papadimitriou via hairong)
+
 Release 0.17.0 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 5 - 1
bin/start-balancer.sh

@@ -15,7 +15,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
+
+. "$bin"/hadoop-config.sh
 
 # Start balancer daemon.
 
-hadoop-daemon.sh start balancer $@
+"$bin"/hadoop-daemon.sh --config $HADOOP_CONF_DIR start balancer $@

+ 5 - 1
bin/stop-balancer.sh

@@ -15,8 +15,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
+
+. "$bin"/hadoop-config.sh
 
 # Stop balancer daemon.
 # Run this on the machine where the balancer is running
 
-hadoop-daemon.sh stop balancer
+"$bin"/hadoop-daemon.sh --config $HADOOP_CONF_DIR stop balancer