Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-32308

RestClusterClient submit job to remote cluster

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Not a Priority
    • Resolution: Invalid
    • 1.14.5
    • None
    • Runtime / REST
    • 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); 

      Attachments

        Activity

          People

            Unassigned Unassigned
            SpongebobZ Spongebob
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: