You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Spongebob (Jira)" <ji...@apache.org> on 2023/06/12 09:15:00 UTC

[jira] [Created] (FLINK-32308) RestClusterClient submit job to remote cluster

Spongebob created FLINK-32308:
---------------------------------

             Summary: RestClusterClient submit job to remote cluster
                 Key: FLINK-32308
                 URL: https://issues.apache.org/jira/browse/FLINK-32308
             Project: Flink
          Issue Type: Bug
          Components: Runtime / REST
            Reporter: Spongebob


I just used `RestClusterClient` submit job to remote cluster, but out of my expectation it submitted to local cluster instead. Could you help with me
{code:java}
String host = "x.x.x.x";
int port = 8081;
Configuration flinkConfiguration = new Configuration();
flinkConfiguration.setString(JobManagerOptions.ADDRESS, host);
flinkConfiguration.setInteger(JobManagerOptions.PORT, 6123);
flinkConfiguration.setInteger(RestOptions.PORT, port);

RestClusterClient<StandaloneClusterId> clusterClient = new RestClusterClient<>(flinkConfiguration, StandaloneClusterId.getInstance());
String s = clusterClient.getWebInterfaceURL();
List<URL> extraJars = new ArrayList<>();
extraJars.add(new File("C:\\Users\\extend.jar").toURI().toURL());
PackagedProgram packagedProgram = PackagedProgram.newBuilder()
        .setConfiguration(flinkConfiguration)
        .setJarFile(new File("F:\\data.jar"))
        .setEntryPointClassName("MyApplication")
        .setUserClassPaths(extraJars)
        .build();
JobID jobID = JobID.generate();
JobGraph jobGraph = PackagedProgramUtils.createJobGraph(packagedProgram, flinkConfiguration, 2, jobID, false);
clusterClient.submitJob(jobGraph);
System.out.println(jobID); {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)