hiveSql解析DolphinScheduler调度系统7位crontab表达式

这篇具有很好参考价值的文章主要介绍了hiveSql解析DolphinScheduler调度系统7位crontab表达式。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

背景

先说下我们数仓大致的数据链路。

各个业务系统的数据库 -> hive -> doris -> 报表/邮件/系统

hive里ods层几乎所有的数据都依赖于从业务库拉取,但是偶尔也难以避免的会遇到拉取失败或者集群(主要是业务库)宕机的情况,导致ods层数据大批量的拉取失败,从而影响到dwd层、dws层、ads层等数以千计的hive表,进而影响到数据。每当遇到宕机的情况我们的解决方案是——重新拉取数据后把失败的工作流从后往前一个个重跑,一上午甚至大半天的时间就这么过去了,手累,心也累。

最主要的问题在于,各个DS工作流之前的顺序是不能搞错的,否则还需要重跑。所以单纯按照工作流失败的顺序来执行,不仅麻烦且容易出错。

于是我们迫切地需要一个工作流的执行顺序表,但是问题是——现有的很多库或者是工具都不能解析DS的crontab表达式,因为它是7位的,比如 :hiveSql解析DolphinScheduler调度系统7位crontab表达式,sql,hive,大数据,数据仓库0 0 0 * * ? *  表示每年的每个月的每天的0时0分0秒执行一次。然而现有的一些库,如python中的corniter都不能解析7位的表达式,

hiveSql解析DolphinScheduler调度系统7位crontab表达式,sql,hive,大数据,数据仓库

也试过一些在线工具,比如在线crontab表达式执行时间计算工具_蛙蛙工具,但是人家也说了hiveSql解析DolphinScheduler调度系统7位crontab表达式,sql,hive,大数据,数据仓库

仅支持5位的crontab表达式。

想来想去最终还是决定用hive sql来解决这个问题,手动实现一个sql的crontab表达式解析。(有种回到大学做算法题的感觉)。

大致思路

1、通过对秒、分、时、月天、月、周天、年七个维度进行分别解析,获取每个表达式在每个维度上的执行时间;

2、然后再通过周天、月天过滤只取今天执行的crontab表达式,再通过时分秒获取具体执行时间,这样就获取了每个crontab表达式在今天的执行时间;

3、最后用DS的调度定义表关联计算结果,即可获得所有工作流在今日的执行时间。

具体代码

set hive.exec.dynamici.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
with tmp_current_date_each_process_crontab as (
    select distinct crontab
    from bak_dolphinscheduler.t_ds_schedules
), tmp_current_date_each_process_hour as (
    select
        crontab,
        cast(t.hour as int) hour
    from
    (
        select
            crontab,
            split(crontab,' ')[2] hours
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[2] rlike ','
    )t lateral view explode(split(hours,',')) t as hour

    union all
    -- part_2,通过斜杠分隔:
    select
        crontab,
        cast(tmp.start_hour+t.pos as int) as hour
    from
    (
        select
            crontab,
            split(split(crontab,' ')[2],'/')[0] start_hour,
            split(split(crontab,' ')[2],'/')[1] separator_hour
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[2] rlike '/'
    ) tmp
    lateral view posexplode(split(space(cast(23-start_hour as int)), '')) t as pos, val
    where split(cast(pos/separator_hour as string),'\\.')[1]='0'

    union all
    -- part_3,通过横杠分隔:
    select
        crontab,
        cast(tmp.start_hour+t.pos as int) as hour
    from
    (
        select
            crontab,
            split(split(crontab,' ')[2],'-')[0] start_hour,
            split(split(crontab,' ')[2],'-')[1] end_hour
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[2] rlike '-'
    ) tmp
    lateral view posexplode(split(space(cast(end_hour-start_hour as int)), '')) t as pos, val

    union all
    -- part_4,每一小时
    select
        crontab,
        cast(t.pos as int) as hour
    from
    (
        select distinct
            crontab
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[2] = '*'
    )t lateral view posexplode(split(space(23), '')) t as pos, val

    union all
    -- part_5,指定小时
    select
        crontab,
        cast(hour as int) hour
    from
    (
        select distinct crontab,split(crontab,' ')[2] hour
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[2] not rlike '\\*|\\?|/|,|-'
    )t
) ,tmp_current_date_each_process_minute as (
    -- part_1,通过逗号分隔:
    select
        crontab,
        cast(t.minute as int) minute
    from
    (
        select
            crontab,
            split(crontab,' ')[1] minutes
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[1] rlike ','
    )t lateral view explode(split(minutes,',')) t as minute

    union all
    -- part_2,通过斜杠分隔:
    select
        crontab,
        cast(tmp.start_minute+t.pos as int) as minute
    from
    (
        select
            crontab,
            split(split(crontab,' ')[1],'/')[0] start_minute,
            split(split(crontab,' ')[1],'/')[1] separator_minute
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[1] rlike '/'
    ) tmp
    lateral view posexplode(split(space(cast(59-start_minute as int)), '')) t as pos, val
    where split(cast(pos/separator_minute as string),'\\.')[1]='0'

    union all
    -- part_3,通过横杠分隔:
    select
        crontab,
        cast(tmp.start_minute+t.pos as int) as minute
    from
    (
        select
            crontab,
            split(split(crontab,' ')[1],'-')[0] start_minute,
            split(split(crontab,' ')[1],'-')[1] end_minute
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[1] rlike '-'
    ) tmp
    lateral view posexplode(split(space(cast(end_minute-start_minute as int)), '')) t as pos, val

    union all
    -- part_4,每一分钟
    select
        crontab,
        cast(t.pos as int) as minute
    from
    (
        select distinct
            crontab
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[1] = '*'
    )t lateral view posexplode(split(space(59), '')) t as pos, val

    union all
    -- part_5,指定分钟
    select
        crontab,
        cast(minute as int) minute
    from
    (
        select distinct crontab,split(crontab,' ')[1] minute
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[1] not rlike '\\*|\\?|/|,|-'
    )t
), tmp_current_date_each_process_second as (
    -- part_1,通过逗号分隔:
    select
        crontab,
        cast(t.second as int) second
    from
    (
        select
            crontab,
            split(crontab,' ')[0] seconds
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[0] rlike ','
    )t lateral view explode(split(seconds,',')) t as second

    union all
    -- part_2,通过斜杠分隔:
    select
        crontab,
        cast(tmp.start_second+t.pos as int) as second
    from
    (
        select
            crontab,
            split(split(crontab,' ')[0],'/')[0] start_second,
            split(split(crontab,' ')[0],'/')[1] separator_second
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[0] rlike '/'
    ) tmp
    lateral view posexplode(split(space(cast(59-start_second as int)), '')) t as pos, val
    where split(cast(pos/separator_second as string),'\\.')[1]='0'

    union all
    -- part_3,通过横杠分隔:
    select
        crontab,
        cast(tmp.start_second+t.pos as int) as second
    from
    (
        select
            crontab,
            split(split(crontab,' ')[0],'-')[0] start_second,
            split(split(crontab,' ')[0],'-')[1] end_second
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[0] rlike '-'
    ) tmp
    lateral view posexplode(split(space(cast(end_second-start_second as int)), '')) t as pos, val

    union all
    -- part_4,每一秒
    select
        crontab,
        cast(t.pos as int) as second
    from
    (
        select distinct
            crontab
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[0] = '*'
    )t lateral view posexplode(split(space(59), '')) t as pos, val

    union all
    -- part_5,指定秒
    select
        crontab,
        cast(second as int ) second
    from
    (
        select distinct crontab,split(crontab,' ')[0] second
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[0] not rlike '\\*|\\?|/|,|-'
    )t
), tmp_current_date_each_process_crontab_week_trans as (
    select distinct crontab original_exp,replace(replace(replace(replace(replace(replace(replace(crontab,'SUN','1'),'MON','2'),'TUE','3'),'WED','4'),'THU','5'),'FRI','6'),'SAT','7') crontab
    from tmp_current_date_each_process_crontab
), tmp_current_date_each_process_weekday as (
    select
        original_exp crontab,
        cast(week as int) weekday
    from
    (
        select
            crontab,original_exp,
            split(crontab,' ')[5] weeks
        from
        (
            select crontab, original_exp
            from tmp_current_date_each_process_crontab_week_trans
        )t where split(crontab,' ')[3] = '?'
                and split(crontab,' ')[5] rlike ','
    )t lateral view explode(split(weeks,',')) t as week

    union all
    -- part_1_2,通过斜杠分隔:
    select
        original_exp crontab,
        cast(tmp.start_week+t.pos as int) as weekday
    from
    (
        select
            crontab,original_exp,
            split(split(crontab,' ')[5],'/')[0] start_week,
            split(split(crontab,' ')[5],'/')[1] separator_week
        from
        (
            select crontab, original_exp
            from tmp_current_date_each_process_crontab_week_trans
        )t where split(crontab,' ')[3] = '?' and split(crontab,' ')[5] rlike '/'
    ) tmp
    lateral view posexplode(split(space(cast(7-start_week as int)), '')) t as pos, val
    where split(cast(pos/separator_week as string),'\\.')[1]='0'

    union all
    -- part_1_3,通过横杠分隔:
    select
        crontab,
        cast(tmp.start_week+t.pos as int) weekday
    from
    (
        select
            crontab,
            split(split(crontab,' ')[5],'-')[0] start_week,
            split(split(crontab,' ')[5],'-')[1] end_week
        from
        (
            select crontab
            from tmp_current_date_each_process_crontab_week_trans
        )t where split(crontab,' ')[3] = '?' and split(crontab,' ')[5] rlike '-'
    ) tmp
    lateral view posexplode(split(space(cast(end_week-start_week as int)), '')) t as pos, val

    union all
    -- part_1_4,每一周天,理论上其实不会有这种情况
    select
        crontab,
        cast(t.pos+1 as int) as weekday
    from
    (
        select crontab, original_exp
        from tmp_current_date_each_process_crontab_week_trans
        where split(original_exp,' ')[3] = '?' and split(original_exp,' ')[5] = '*'
    )t lateral view posexplode(split(space(6), '')) t as pos, val

    union all
    -- part_1_5,指定星期
    select
        crontab,
        cast(split(crontab,' ')[5] as int) weekday
    from
    (
        select crontab
        from tmp_current_date_each_process_crontab_week_trans
        where split(original_exp,' ')[5] not rlike '\\*|\\?|/|,|-'
    )t
), tmp_current_date_each_process_monthday as (
    -- part_2_1,通过逗号分隔:
    select
        crontab,
        cast(day as int) monthday
    from
    (
        select
            crontab,
            split(crontab,' ')[3] days
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[3] <> '?'
                and split(crontab,' ')[3] rlike ','
    )t lateral view explode(split(days,',')) t as day

    union all
    -- part_2_2,通过斜杠分隔:
    select
        crontab,
        cast(tmp.start_day+t.pos as int) as monthday
    from
    (
        select
            crontab,
            split(split(crontab,' ')[3],'/')[0] start_day,
            split(split(crontab,' ')[3],'/')[1] separator_day
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[3] <> '?' and split(crontab,' ')[3] rlike '/'
    ) tmp
    lateral view posexplode(split(space(cast(dayofmonth(last_day(current_date()))-start_day as int)), '')) t as pos, val
    where split(cast(pos/separator_day as string),'\\.')[1]='0'

    union all
    -- part_2_3,通过横杠分隔:
    select
        crontab,
        cast(tmp.start_day+t.pos as int) as monthday
    from
    (
        select
            crontab,
            split(split(crontab,' ')[3],'-')[0] start_day,
            split(split(crontab,' ')[3],'-')[1] end_day
        from
        (
            select distinct crontab
            from tmp_current_date_each_process_crontab
        )t where split(crontab,' ')[3] <> '?' and split(crontab,' ')[3] rlike '-'
    ) tmp
    lateral view posexplode(split(space(cast(end_day-start_day as int)), '')) t as pos, val

    union all
    -- part_2_4,每一月天
    select
        crontab,
        cast(t.pos+1 as int) as monthday
    from
    (
        select distinct crontab
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[3] = '*'
    )t lateral view posexplode(split(space(dayofmonth(last_day(current_date()))-1), '')) t as pos, val

    union all
    -- part_2_5,指定天
    select
        crontab,
        cast(day as int) monthday
    from
    (
        select distinct crontab,split(crontab,' ')[3] day
        from tmp_current_date_each_process_crontab
        where split(crontab,' ')[3] not rlike '\\*|\\?|/|,|-'
    )t
), tmp_current_date_each_process_crontab_month_trans as (
    select distinct crontab original_exp, replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(crontab,'JAN','1'),'FEB','2'),'MAR','3'),'APR','4'),'MAY','5'),'JUN','6'),'JUL','7'),'AUG','8'),'SEP','9'),'OCT','10'),'NOV','11'),'DEC','12') crontab
    from tmp_current_date_each_process_crontab
), tmp_current_date_each_process_month as (
    -- part_1,通过逗号分隔:
    select
        original_exp crontab,
        cast(month as int) month
    from
    (
        select
            crontab,original_exp,
            split(crontab,' ')[4] months
        from
        (
            select crontab, original_exp
            from tmp_current_date_each_process_crontab_month_trans
        )t where split(crontab,' ')[4] not rlike '\\*|\\?'
               and split(crontab,' ')[4] rlike ','
    )t lateral view explode(split(months,',')) t as month

    union all
    -- part_2,通过斜杠分隔:
    select
        original_exp crontab,
        cast(tmp.start_month+t.pos as int) as month
    from
    (
        select
            crontab,original_exp,
            split(split(crontab,' ')[4],'/')[0] start_month,
            split(split(crontab,' ')[4],'/')[1] separator_month
        from
        (
            select crontab, original_exp
            from tmp_current_date_each_process_crontab_month_trans
        )t where split(crontab,' ')[4] not rlike '\\*|\\?'
               and split(crontab,' ')[4] rlike '/'
    ) tmp
    lateral view posexplode(split(space(cast(12-start_month as int)), '')) t as pos, val
    where split(cast(pos/separator_month as string),'\\.')[1]='0'

    union all
    -- part_3,通过横杠分隔:
    select
        original_exp crontab,
        cast(tmp.start_month+t.pos as int) as month
    from
    (
        select
            crontab,original_exp,
            split(split(crontab,' ')[4],'-')[0] start_month,
            split(split(crontab,' ')[4],'-')[1] end_month
        from
        (
            select crontab, original_exp
            from tmp_current_date_each_process_crontab_month_trans
        )t where split(crontab,' ')[4] not rlike '\\*|\\?'
               and split(crontab,' ')[4] rlike '-'
    ) tmp
    lateral view posexplode(split(space(cast(end_month-start_month as int)), '')) t as pos, val

    union all
    -- part_4,每一月
    select
        original_exp crontab,
        cast(t.pos+1 as int) as month
    from
    (
        select crontab, original_exp
        from tmp_current_date_each_process_crontab_month_trans
        where split(original_exp,' ')[4] = '*'
    )t lateral view posexplode(split(space(11), '')) t as pos, val

    union all
    -- part_5,指定月
    select
        original_exp crontab,
        cast(split(crontab,' ')[4] as int) month
    from
    (
        select crontab, original_exp
        from tmp_current_date_each_process_crontab_month_trans
        where split(original_exp,' ')[4] not rlike '\\*|\\?|/|,|-'
    )t
), tmp_current_date_each_process_scheduler_list_today as (
    select
        a.crontab,
        b.monthday,
        b.weekday,
        d.month
    from
    (
        select crontab
        from tmp_current_date_each_process_crontab
    )a
    inner join
    (
        select
            crontab,
            concat_ws(',',collect_set(cast(monthday as string))) monthday,
            concat_ws(',',collect_set(cast(weekday as string))) weekday
        from
        (
            -- 按月天筛选
            select crontab,monthday,null weekday
            from tmp_current_date_each_process_monthday
            where cast(day(current_date()) as int)=cast(monthday as int)
            group by crontab, monthday
            union all
            -- 按周天筛选
            select crontab,day(current_date()) monthday,weekday
            from tmp_current_date_each_process_weekday
            where cast(dayofweek(current_date()) as int)=cast(weekday as int)
            group by crontab, weekday
        )t group by crontab
    )b on a.crontab=b.crontab
    inner join
    (-- 按月筛选
        select crontab,month
        from tmp_current_date_each_process_month
        where cast(month(current_date()) as int)=cast(month as int)
        group by crontab,month
    )d on a.crontab=d.crontab
), tmp_current_date_each_process_scheduler_time_today as (
    select
        a.crontab,
        month,
        monthday,
        weekday,
        hour,
        minute,
        second,
        concat(year(current_date()),'-',month,'-',monthday,' ',hour,':',minute,':',second) scheduler_time,
        from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') etl_time
    from
    (
        select crontab,
               case when monthday<10 then concat('0',monthday) else monthday end monthday,
               case when weekday<10 then concat('0',weekday) else weekday end  weekday,
               case when month<10 then concat('0',month) else month end month
        from tmp_current_date_each_process_scheduler_list_today
    )a
    left join
    (   -- 获取执行的小时
        select crontab,case when hour<10 then concat('0',hour) else hour end hour
        from tmp_current_date_each_process_hour
    )b on a.crontab=b.crontab
    left join
    (   -- 获取执行的分钟
        select crontab,case when minute<10 then concat('0',minute) else minute end minute
        from tmp_current_date_each_process_minute
    )c on a.crontab=c.crontab
    left join
    (   -- 获取执行的秒
        select crontab,case when second<10 then concat('0',second) else second end second
        from tmp_current_date_each_process_second
    )d on a.crontab=d.crontab
)
insert overwrite table dwd.dwd_dolphinscheduler_process_scheduler_time partition (d)
select
    a.code project_code,
    a.project_name,
    b.code process_code,
    b.name process_name,
    b.description process_description,
    c.crontab,
    c.month scheduler_month,
    c.monthday scheduler_monthday,
    c.weekday scheduler_weekday,
    c.hour scheduler_hour,
    c.minute scheduler_minute,
    c.second scheduler_second,
    c.scheduler_time,
    from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') etl_time,
    date_format(current_date(),'yyyyMMdd') d
from
(
    select code,name project_name
    from bak_dolphinscheduler.t_ds_project
)a
left join
(
    select code,name,description,project_code,user_id
    from bak_dolphinscheduler.t_ds_process_definition
    where release_state=1 and flag=1
)b on a.code = b.project_code
inner join
(
    select
        aa.process_definition_code,
        aa.crontab,
        bb.month, monthday, weekday, hour, minute, second,
        bb.scheduler_time
    from
    (
        select process_definition_code,crontab
        from bak_dolphinscheduler.t_ds_schedules
        where release_state=1
    )aa
    left join
    (
        select crontab, month, monthday, weekday, hour, minute, second, scheduler_time
        from tmp_current_date_each_process_scheduler_time_today
    )bb on aa.crontab=bb.crontab
)c on b.code=c.process_definition_code  ;

最终结果

 在计算完成后即可根据该分区表获取到每个工作流的当日理论执行时间,为重跑工作流提供了更清晰的执行顺序。不过现有代码其实还不够完全,比较熟悉crontab表达式的朋友应该可以注意到没有对L和W进行处理,不过已经满足我们的需求了,有需要的朋友可以在此基础上自行添加相关逻辑。后续在捋清楚工作流直接的依赖关系后再通过shell和DS提供的API即可实现整体重跑(前提是你的工作流不会因重跑导致发生问题)。

select project_name,process_name,crontab,min(scheduler_time) first_scheduler_time,max(scheduler_time) last_scheduler_time,count(distinct scheduler_time) scheduler_times
from dwd.dwd_dolphinscheduler_process_scheduler_time
where d=date_format(current_date(),'yyyyMMdd') and scheduler_time is not null and project_name='dma'
group by project_name, process_name,crontab
order by first_scheduler_time ;

hiveSql解析DolphinScheduler调度系统7位crontab表达式,sql,hive,大数据,数据仓库

附录

附上表的DDL语句和表血缘关系,其中bak_dolphinscheduler库下的表来源于dolphinscheduler的Mysql数据库。文章来源地址https://www.toymoban.com/news/detail-822130.html

CREATE TABLE dwd.dwd_dolphinscheduler_process_scheduler_time(
  `project_code` string COMMENT '项目编码', 
  `project_name` string COMMENT '项目名称', 
  `process_code` string COMMENT '工作流编码', 
  `process_name` string COMMENT '工作流名称', 
  `process_description` string COMMENT '工作流说明', 
  `crontab` string COMMENT 'cron表达式', 
  `scheduler_month` string COMMENT '调度执行-月', 
  `scheduler_monthday` string COMMENT '调度执行-日', 
  `scheduler_weekday` string COMMENT '调度执行-星期', 
  `scheduler_hour` string COMMENT '调度执行-小时', 
  `scheduler_minute` string COMMENT '调度执行-分钟', 
  `scheduler_second` string COMMENT '调度执行-秒', 
  `scheduler_time` string COMMENT '调度执行时间', 
  `etl_time` string COMMENT '计算时间'
)COMMENT '工作流每日理论调度时间分区表'
PARTITIONED BY (`d` string) 
dwd.dwd_dolphinscheduler_process_scheduler_time
hive来源表:
├─ bak_dolphinscheduler.t_ds_schedules
├─ bak_dolphinscheduler.t_ds_project
├─ bak_dolphinscheduler.t_ds_process_definition
with语句临时表:
├─ tmp_current_date_each_process_hour
├─ tmp_current_date_each_process_minute
├─ tmp_current_date_each_process_second
├─ tmp_current_date_each_process_crontab_week_trans
├─ tmp_current_date_each_process_weekday
├─ tmp_current_date_each_process_monthday
├─ tmp_current_date_each_process_crontab_month_trans
├─ tmp_current_date_each_process_month
├─ tmp_current_date_each_process_scheduler_list_today
├─ tmp_current_date_each_process_scheduler_time_today
└─ tmp_current_date_each_process_crontab

到了这里,关于hiveSql解析DolphinScheduler调度系统7位crontab表达式的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Linux 定时任务调度(crontab)

    Crontab命令用于设置周期性被执行的指令。该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行。 可以使用Crontab定时处理离线任务,比如每天凌晨2点更新数据等,经常用于系统任务调度。 一般Linux系统中都会装有Crontab,如果没有安装可以使

    2024年02月07日
    浏览(68)
  • 使用 Crontab 自动化任务调度

    在计算机工作中,我们经常需要自动执行某些任务。Crontab 是一个在 Linux 和类 Unix 系统上广泛使用的工具,它允许用户按照预定的时间表触发指定的命令和脚本。无论是备份数据、生成报告还是定期清理临时文件,Crontab 都可以帮助我们自动化这些任务,提高工作效率。 Cro

    2024年02月09日
    浏览(28)
  • Linux|CronTab 的 Cron 表达式

    经典 Cron 表达式包含 5 个位置,中间用空格分隔。其标准语法如下: 其中: [minute] 表示分钟,取值范围 [0, 59] [hour] 表示小时,取值范围 [0, 23] [day of month] 表示日期,取值范围 [0, 31] [month] 表示月份,取值范围 [1, 12] ,也可以用名称简写( Jan - Dec ) [day of week] 表示星期,取值

    2024年02月06日
    浏览(39)
  • 数仓工具——DolphinScheduler任务调度工具

    在数仓项目中,掌握一种任务调度工具是十分重要的,常用的调度工具有Azkaban和oozie,这里学习一种国产的调度工具,DolphinScheduler,综合了两种调度工具的特点而产生的。 DolphinScheduler是一个分布式、易扩展的可视化DAG工作流调度平台,致力于解决数据处理流程中错综复杂的

    2023年04月15日
    浏览(39)
  • linux-crontab每分钟定时执行/定时任务调度

    本文讲解linux上如何调用定时任务,如每分钟打印日志,每日24点执行日志切割脚本等等。 在Linux系统中,crontab命令是一个用于执行定时任务的命令, crond(crontab)是系统默认自带的定时服务 。我们可以通过编辑crontab文件来设置定时任务,使系统可以自动按照设定的时间和频率

    2024年02月06日
    浏览(49)
  • 【大数据进阶第三阶段之DolphinScheduler学习笔记】DolphinScheduler(海豚调度)的部署指南

    参考官网部署方式:https://dolphinscheduler.apache.org/zh-cn/docs/3.1.3/guide/installation/standalone 部署方式:单机部署,伪集群部署,集群部署。 如果是新手,想要体验 DolphinScheduler 的功能,推荐使用Standalone方式体检。如果你是在生产中使用,推荐使用 集群部署或者 kubernetes。 Standalone

    2024年01月22日
    浏览(37)
  • Apache DolphinScheduler:深入了解大数据调度工具

    Apache DolphinScheduler 是一个分布式易扩展的可视化DAG工作流任务调度开源系统。适用于企业级场景,提供了一个可视化操作任务、工作流和全生命周期数据处理过程的解决方案。 Apache DolphinScheduler 旨在解决复杂的大数据任务依赖关系,并为应用程序提供数据和各种 OPS 编排中的

    2024年01月22日
    浏览(41)
  • 使用 Apache DolphinScheduler 进行 EMR 任务调度

    By AWS Team 随着企业规模的扩大,业务数据的激增,我们会使用 Hadoop/Spark 框架来处理大量数据的 ETL/聚合分析作业,⽽这些作业将需要由统一的作业调度平台去定时调度。 在 Amazon EMR 中,可以使用 AWS 提供 Step Function,托管 AirFlow,以及 Apache Oozie 或 Azkaban 进行作业的调用。但随

    2024年02月16日
    浏览(35)
  • 【大数据-调度工具】dolphinscheduler安装和遇到的问题

    安装步骤按照官网安装即可 官网:DolphinScheduler | 文档中心 (apache.org) 版本:3.1.5 Q1.大文件无法上传 问题描述: 在资源中心中上传文件选择完大文件夹之后,选择确认之后确认按钮转了几圈圈之后就没反应了,对应服务器上使用ds登录的用户资源目录也没有对应的文件。 问题

    2024年02月07日
    浏览(43)
  • 开源任务调度平台dolphinscheduler部署及使用指南(未完)

    目录 一 dolphinsheduler调研 支持的任务类型: 1.1 dolphinsheduler集群部署 1.1.1 需要的环境 1.1.2 dolphinsheduler安装 可能的报错:zk正常,master或worker一段时间后挂掉 问题原因 解决办法 1.1.3 资源中心配置 1.2 参数 1.2.1 任务中可能出现的所有参数 1.2.2 内置参数 1.2.3 全局参数 1.2.4 本地参

    2023年04月19日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包