假如遇到以上这个问题,就是hdfs有问题,可以在hdfs上添加一个配置:
以上这个问题常见于以下sql语句:
insert into table aaaa
select * from bbbb
方案如下:
hadoop中的hdfs-site.xml
<property>
<name>fs.hdfs.impl.disable.cache</name>
<value>true</value>
</property>
记得分发给其他集群节点:
xsync.sh hdfs-site.xml
这里的xsync.sh是自己写分发脚本:
xsync.sh
#!/bin/bash
#1 获取输入参数个数,如果没有参数,直接退出
pcount=$#
if [ $pcount -lt 1 ]
then
echo No Enough Arguement!
exit;
fi
#2. 遍历集群所有机器
for host in bigdata02 bigdata03
do
echo ==================== $host ====================
#3. 递归遍历所有目录
for file in $@
do
#4 判断文件是否存在
if [ -e $file ]
then
#5. 获取全路径
pdir=$(cd -P $(dirname $file); pwd)
echo pdir=$pdir
#6. 获取当前文件的名称
fname=$(basename $file)
echo fname=$fname
#7. 通过ssh执行命令:在$host主机上递归创建文件夹(如果存在该文件夹)
ssh $host "source /etc/profile;mkdir -p $pdir"
#8. 远程同步文件至$host主机的$USER用户的$pdir文件夹下
rsync -av $pdir/$fname $USER@$host:$pdir
else
echo $file Does Not Exists!
fi
done
done
然后重启hdfs:
停止
stop-dfs.sh
启动
start-dfs.sh
重启元数据:
hive-server-manager.sh stop metastore
然后重启thrift服务:
先停止thriftserver服务
stop-thriftserver.sh stop
再重新启动:
/opt/installs/spark/sbin/start-thriftserver.sh --hiveconf hive.server2.thrift.port=10001 --hiveconf hive.server2.thrift.bind.host=bigdata01 --master yarn --conf spark.sql.shuffle.partitions=2