代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/hadoop-3.1 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
hdfs_dirs="/user /var/log /tmp"
mapred_dirs="/tmp/hadoop-yarn/staging /tmp/hadoop-yarn/staging/history /tmp/hadoop-yarn/staging/history/done /tmp/hadoop-yarn/staging/history/done_intermediate"
yarn_dirs="/tmp/hadoop-yarn /var/log/hadoop-yarn"
# Must be run as root
if [[ $EUID -ne 0 ]]
then
echo "This must be run as root" 1>&2
exit 1
fi
# Start the namenode if it isn't running
started=0
systemctl status hadoop-namenode > /dev/null 2>&1
rc=$?
if [[ $rc -gt 0 ]]
then
# Format the namenode if it hasn't been formatted
runuser hdfs -s /bin/bash /bin/bash -c "hdfs namenode -format -nonInteractive" > /dev/null 2>&1
if [[ $? -eq 0 ]]
then
echo "Formatted the Hadoop namenode"
fi
echo "Starting the Hadoop namenode"
systemctl start hadoop-namenode > /dev/null 2>&1
rc=$?
started=1
fi
if [[ $rc -ne 0 ]]
then
echo "The Hadoop namenode failed to start"
exit 1
fi
for dir in $hdfs_dirs $yarn_dirs $mapred_dirs
do
echo "Creating directory $dir"
runuser hdfs -s /bin/bash /bin/bash -c "hadoop fs -mkdir -p $dir" > /dev/null 2>&1
done
echo "Setting permissions on /tmp"
runuser hdfs -s /bin/bash /bin/bash -c "hadoop fs -chmod 1777 /tmp" > /dev/null 2>&1
for dir in $mapred_dirs
do
echo "Setting permissions and ownership for $dir"
runuser hdfs -s /bin/bash /bin/bash -c "hadoop fs -chown mapred:mapred $dir" > /dev/null 2>&1
runuser hdfs -s /bin/bash /bin/bash -c "hadoop fs -chmod 1777 $dir" > /dev/null 2>&1
done
for dir in $yarn_dirs
do
echo "Setting permissions and ownership for $dir"
runuser hdfs -s /bin/bash /bin/bash -c "hadoop fs -chown yarn:mapred $dir" > /dev/null 2>&1
done
# Stop the namenode if we started it
if [[ $started -gt 0 ]]
then
echo "Stopping the Hadoop namenode"
systemctl stop hadoop-namenode > /dev/null 2>&1
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。