#Author: DZH
#Date: 2023
#Desc: 测试(数据从StarRocks 落地CSV 文件)
##############################################
export LANG=zh_CN.UTF-8
# 按行读取配置文件内容
FILE=/data/strks_pro_ps/conf/strks.conf
DBlink=""
# 获取配置文件进行FE集群状态判断
while read line
do
State_Fe=`echo $line|awk -F "|" '{print $1}'`
# 判断FE是否正常(返回OK 正常其他都是异常)
Fe=`echo ${State_Fe} |awk '{run=$0;system(run)}' |grep -Po '"status":(.+?),' |grep -Po '(OK)'`
# echo ${Fe}
# Fe状态正常,获取正常链接
if [ "${Fe}" == "OK" ];then
DBlink=`echo $line|awk -F "|" '{print $2}'`
break
fi
done < $FILE
#DBlink=$(cat /data/strks_pro_ps/conf/strks.conf)
EXE_STSQL="${DBlink} "
#获取当前路径
#path=$(cd $(dirname $0);pwd)
#SQL1=" -- 测试select now();";
#
LAB_TIME=`date +%Y%m%d%H%M%S`
echo ${LAB_TIME}
SQL2="select * from dwd.dwd_pbm_ins_drug_apply;";
#$EXE_STSQL "${SQL1}"
#$EXE_STSQL "${SQL2}" > /data/strks_pro_ps/pro_ps/log/pro_dwd_pbm_ins_drug_apply_log.log
$EXE_STSQL "${SQL2}" > /home/dzh/Star_export.csv
09-06
433
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-01
3628
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-13
1226
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-27
1751
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-17
798
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-02
1692
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-28
1042
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-09
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)