Skip to content

Instantly share code, notes, and snippets.

@jecyhw
Last active November 27, 2017 01:45
Show Gist options
  • Save jecyhw/fbec2a0d4aa44cf55338f6f2effb13b6 to your computer and use it in GitHub Desktop.
Save jecyhw/fbec2a0d4aa44cf55338f6f2effb13b6 to your computer and use it in GitHub Desktop.
stop-dfs.shstop-yarn.shmr-jobhistory-daemon.sh stop historyserver
#!/usr/bin/env bash
# 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.
# Stop all hadoop daemons. Run this on master node.
hadoop="${HADOOP}"
# stop hdfs daemons if hdfs is present
if [ -f "${hadoop}"/sbin/stop-dfs.sh ]; then
"${hadoop}"/sbin/stop-dfs.sh
fi
# stop yarn daemons if yarn is present
if [ -f "${hadoop}"/sbin/stop-yarn.sh ]; then
"${hadoop}"/sbin/stop-yarn.sh
fi
# stop jobhistory daemons if jobhistory is present
if [ -f "${hadoop}"/sbin/mr-jobhistory-daemon.sh ]; then
"${hadoop}"/sbin/mr-jobhistory-daemon.sh stop historyserver
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment