Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2016 15:19
Show Gist options
  • Save anonymous/b5f795fccbaa1c2f1db49a1cf9903412 to your computer and use it in GitHub Desktop.
Save anonymous/b5f795fccbaa1c2f1db49a1cf9903412 to your computer and use it in GitHub Desktop.
Apache Hadoop (local mode) without SSH
cd ~/hadoop/sbin/
# save old scripts
mv start-dfs.sh start-dfs.sh.orig
mv start-yarn.sh start-yarn.sh.orig
mv stop-dfs.sh stop-dfs.sh.orig
mv stop-yarn.sh stop-yarn.sh.orig
touch start-dfs.sh && chmod +x start-dfs.sh
touch start-yarn.sh && chmod +x start-yarn.sh
touch stop-dfs.sh && chmod +x stop-dfs.sh
touch stop-yarn.sh && chmod +x stop-yarn.sh
# see remaining part of the gist for the content of these files...
#!/usr/bin/env bash
echo "starting dfs daemons"
hadoop-daemon.sh --config ~/hadoop/etc/hadoop/ start namenode
hadoop-daemon.sh --config ~/hadoop/etc/hadoop/ start secondarynamenode
hadoop-daemon.sh --config ~/hadoop/etc/hadoop/ start datanode
# eof
#!/usr/bin/env bash
echo "starting yarn daemons"
yarn-daemon.sh --config ~/hadoop/etc/hadoop/ start resourcemanager
yarn-daemon.sh --config ~/hadoop/etc/hadoop/ start nodemanager
# eof
#!/usr/bin/env bash
echo "stopping dfs daemons"
hadoop-daemon.sh --config ~/hadoop/etc/hadoop/ stop namenode
hadoop-daemon.sh --config ~/hadoop/etc/hadoop/ stop secondarynamenode
hadoop-daemon.sh --config ~/hadoop/etc/hadoop/ stop datanode
# eof
#!/usr/bin/env bash
echo "stopping yarn daemons"
yarn-daemon.sh --config ~/hadoop/etc/hadoop/ stop resourcemanager
yarn-daemon.sh --config ~/hadoop/etc/hadoop/ stop nodemanager
# eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment