xiaomei wu
xiaomei wu

Reputation: 21

How to run Flink job with savepoint in remote environment?

When use Flink remote environment,how to run job with savepoint?I can't find any api to apply.

Upvotes: 2

Views: 359

Answers (3)

k-sever
k-sever

Reputation: 1145

In order to run a job from a savepoint via a remote environment, you should initialize a remote environment with specified savepoint restore settings, i.e.:

SavepointRestoreSettings savepointRestoreSettings = SavepointRestoreSettings.forPath("/tmp/savepoints/savepoint-342c17", false, RestoreMode.CLAIM);
env = new RemoteStreamEnvironment(remoteHost, remotePort, Configuration.fromMap(Map.of()), new String[] {}, null, savepointRestoreSettings);
StreamTableEnvironment.create(env, settings);

Note, that this is a bit different from using a Rest API (https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/ops/rest_api/#jars-jarid-run), since in this case, the savepoint path is the path to a file from a local machine that submits the job to remote, not the savepoint path on a remote cluster.

In other words, using Rest API approach, you submit job params to remote, but the job graph is built on a remote cluster. In case of a remote environment, you are building a job graph on a client and submitting an already built job graph via rpc, so you have to read a savepoint on a client.

Upvotes: 0

axreldable
axreldable

Reputation: 164

I think you can use this command:

$ bin/flink run -s :savepointPath [:runArgs]

See docs for more information.

Upvotes: 0

Related Questions