Details
-
Bug
-
Status: Closed
-
Not a Priority
-
Resolution: Invalid
-
1.14.5
-
None
-
None
Description
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
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);