You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by tao wang <wt...@gmail.com> on 2020/04/15 05:44:49 UTC

请问有没有什么方法可以把checkpoint打到集群外的hdfs?

现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。

但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。

谢谢!!

Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

Posted by LakeShen <sh...@gmail.com>.
Hi tao wang,

你可以在你的 flink-conf.yaml 里面配置 Checkpoint 的目录,就像楼上 Yangze 所说

state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/

Best,
LakeShen

Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午2:44写道:

> checkpoint的目录设置key为state.checkpoints.dir
>
> 你可以这样设置
> state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/
>
>
> Best,
> Yangze Guo
>
> On Wed, Apr 15, 2020 at 1:45 PM tao wang <wt...@gmail.com> wrote:
> >
> > 现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。
> >
> > 但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。
> >
> > 谢谢!!
>

Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

Posted by tao wang <wt...@gmail.com>.
多谢两位  Yangze and LakeShen,我研究一下。

Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午3:45写道:

> 1. flink会去读YARN_CONF_DIR or HADOOP_CONF_DIR这两个环境变量
> 2. 我理解这和你flink运行的集群是解耦的,只要你dir的路径不变,就会从那个dir找checkpoint恢复
>
> Best,
> Yangze Guo
>
> On Wed, Apr 15, 2020 at 3:38 PM tao wang <wt...@gmail.com> wrote:
> >
> > 多谢回复, 还有几个问题请教:
> > 1、外部集群的hdfs-site, core-site 这些怎么配置?
> > 2、另外一个角度, 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复。
> >
> > Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午2:44写道:
> >>
> >> checkpoint的目录设置key为state.checkpoints.dir
> >>
> >> 你可以这样设置
> >> state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/
> >>
> >>
> >> Best,
> >> Yangze Guo
> >>
> >> On Wed, Apr 15, 2020 at 1:45 PM tao wang <wt...@gmail.com> wrote:
> >> >
> >> > 现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。
> >> >
> >> > 但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。
> >> >
> >> > 谢谢!!
>

Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

Posted by tao wang <wt...@gmail.com>.
多谢 zhisheng , 用你的方法解决了。
做完整的savepoint的时候, hdfs 地址 用hdfs://ip:port/ 的方式访问新集群的hdfs。不用nameservice 的方式

zhisheng <zh...@gmail.com> 于2020年4月16日周四 下午4:37写道:

> > 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复
>
> 这种是不是可以先在旧集群对作业取消的时候做一次完整的 savepoint(地址填新集群的 HDFS 地址),然后在新集群的时候从 savepoint
> 启动
>
> Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午3:52写道:
>
> > 1. flink会去读YARN_CONF_DIR or HADOOP_CONF_DIR这两个环境变量
> > 2. 我理解这和你flink运行的集群是解耦的,只要你dir的路径不变,就会从那个dir找checkpoint恢复
> >
> > Best,
> > Yangze Guo
> >
> > On Wed, Apr 15, 2020 at 3:38 PM tao wang <wt...@gmail.com> wrote:
> > >
> > > 多谢回复, 还有几个问题请教:
> > > 1、外部集群的hdfs-site, core-site 这些怎么配置?
> > > 2、另外一个角度, 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复。
> > >
> > > Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午2:44写道:
> > >>
> > >> checkpoint的目录设置key为state.checkpoints.dir
> > >>
> > >> 你可以这样设置
> > >> state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/
> > >>
> > >>
> > >> Best,
> > >> Yangze Guo
> > >>
> > >> On Wed, Apr 15, 2020 at 1:45 PM tao wang <wt...@gmail.com> wrote:
> > >> >
> > >> > 现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。
> > >> >
> > >> > 但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。
> > >> >
> > >> > 谢谢!!
> >
>

Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

Posted by Yun Tang <my...@live.com>.
Hi

如果旧作业开启了incremental checkpoint,并从那边进行恢复的话,需要注意的是旧的checkpoint目录下的文件是不能删除的,这个是incremental checkpoint语义导致的,如果想要切割掉对旧目录的依赖,需要执行一次savepoint,并启动新作业从savepoint进行恢复。

祝好
唐云
________________________________
From: zhisheng <zh...@gmail.com>
Sent: Thursday, April 16, 2020 16:37
To: user-zh <us...@flink.apache.org>
Subject: Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

> 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复

这种是不是可以先在旧集群对作业取消的时候做一次完整的 savepoint(地址填新集群的 HDFS 地址),然后在新集群的时候从 savepoint
启动

Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午3:52写道:

> 1. flink会去读YARN_CONF_DIR or HADOOP_CONF_DIR这两个环境变量
> 2. 我理解这和你flink运行的集群是解耦的,只要你dir的路径不变,就会从那个dir找checkpoint恢复
>
> Best,
> Yangze Guo
>
> On Wed, Apr 15, 2020 at 3:38 PM tao wang <wt...@gmail.com> wrote:
> >
> > 多谢回复, 还有几个问题请教:
> > 1、外部集群的hdfs-site, core-site 这些怎么配置?
> > 2、另外一个角度, 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复。
> >
> > Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午2:44写道:
> >>
> >> checkpoint的目录设置key为state.checkpoints.dir
> >>
> >> 你可以这样设置
> >> state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/
> >>
> >>
> >> Best,
> >> Yangze Guo
> >>
> >> On Wed, Apr 15, 2020 at 1:45 PM tao wang <wt...@gmail.com> wrote:
> >> >
> >> > 现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。
> >> >
> >> > 但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。
> >> >
> >> > 谢谢!!
>

Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

Posted by zhisheng <zh...@gmail.com>.
> 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复

这种是不是可以先在旧集群对作业取消的时候做一次完整的 savepoint(地址填新集群的 HDFS 地址),然后在新集群的时候从 savepoint
启动

Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午3:52写道:

> 1. flink会去读YARN_CONF_DIR or HADOOP_CONF_DIR这两个环境变量
> 2. 我理解这和你flink运行的集群是解耦的,只要你dir的路径不变,就会从那个dir找checkpoint恢复
>
> Best,
> Yangze Guo
>
> On Wed, Apr 15, 2020 at 3:38 PM tao wang <wt...@gmail.com> wrote:
> >
> > 多谢回复, 还有几个问题请教:
> > 1、外部集群的hdfs-site, core-site 这些怎么配置?
> > 2、另外一个角度, 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复。
> >
> > Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午2:44写道:
> >>
> >> checkpoint的目录设置key为state.checkpoints.dir
> >>
> >> 你可以这样设置
> >> state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/
> >>
> >>
> >> Best,
> >> Yangze Guo
> >>
> >> On Wed, Apr 15, 2020 at 1:45 PM tao wang <wt...@gmail.com> wrote:
> >> >
> >> > 现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。
> >> >
> >> > 但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。
> >> >
> >> > 谢谢!!
>

Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

Posted by Yangze Guo <ka...@gmail.com>.
1. flink会去读YARN_CONF_DIR or HADOOP_CONF_DIR这两个环境变量
2. 我理解这和你flink运行的集群是解耦的,只要你dir的路径不变,就会从那个dir找checkpoint恢复

Best,
Yangze Guo

On Wed, Apr 15, 2020 at 3:38 PM tao wang <wt...@gmail.com> wrote:
>
> 多谢回复, 还有几个问题请教:
> 1、外部集群的hdfs-site, core-site 这些怎么配置?
> 2、另外一个角度, 如果我把任务迁移到另外一个集群,如何让它从老的集群的checkpoint 恢复。
>
> Yangze Guo <ka...@gmail.com> 于2020年4月15日周三 下午2:44写道:
>>
>> checkpoint的目录设置key为state.checkpoints.dir
>>
>> 你可以这样设置
>> state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/
>>
>>
>> Best,
>> Yangze Guo
>>
>> On Wed, Apr 15, 2020 at 1:45 PM tao wang <wt...@gmail.com> wrote:
>> >
>> > 现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。
>> >
>> > 但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。
>> >
>> > 谢谢!!

Re: 请问有没有什么方法可以把checkpoint打到集群外的hdfs?

Posted by Yangze Guo <ka...@gmail.com>.
checkpoint的目录设置key为state.checkpoints.dir

你可以这样设置
state.checkpoints.dir: hdfs://namenode:port/flink/checkpoints/


Best,
Yangze Guo

On Wed, Apr 15, 2020 at 1:45 PM tao wang <wt...@gmail.com> wrote:
>
> 现在有个场景, 集群上上了一些比较重要的任务,为了提高这些任务的性能,为它提供了一个专有的hdfs 集群用来存储checkpoint 。
>
> 但是现在不知道怎么配置才能让支持任务打到外部的hdfs集群。
>
> 谢谢!!