flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timo Walther <twal...@apache.org>
Subject Re: Submitting jobs via Java code
Date Thu, 18 Jan 2018 08:39:06 GMT
Hi Luigi,

can you try to load an entire configuration file via 
GlobalConfiguration.loadConfiguration(flinkConfigDir). Maybe you tell us 
a little bit what you want to achieve?

Is the programmatic submission a requirement for you? Did you consider 
using the RemoteStreamEnvironment?

Regards,
Timo


Am 1/17/18 um 5:08 PM schrieb Luigi Sgaglione:
> Hi,
>
> I am a beginner in Flink and I'm trying to deploy a simple example 
> using a java client in a remote Flink server (1.4.0).
>
> I'm using org.apache.flink.client.program.Client
>
> this is the used code:
>
>     Configuration config = new Configuration();
>     config.setString("jobmanager.rpc.address", "192.168.149.130");
>     config.setInteger("jobmanager.rpc.port", 6123);
>
>     Client c = new Client(config);
>
>     PackagedProgram prg = new PackagedProgram(new
>     File("target/Test-1.jar"));
>     c.runDetached(prg, 1);
>
>
> but when I try to deploy the jar I receive the following error:
>
> 16:03:20,035 INFO  org.apache.flink.client.program.Client             
>           - Looking up JobManager
> Exception in thread "main" 
> org.apache.flink.client.program.ProgramInvocationException: *Failed to 
> retrieve the JobManager gateway.*
> at org.apache.flink.client.program.Client.runDetached(Client.java:380)
> at org.apache.flink.client.program.Client.runDetached(Client.java:355)
> at org.apache.flink.client.program.Client.runDetached(Client.java:340)
> at 
> org.apache.flink.client.program.ContextEnvironment.execute(ContextEnvironment.java:74)
> at 
> org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:804)
> at org.apache.flink.api.java.DataSet.collect(DataSet.java:410)
> at org.apache.flink.api.java.DataSet.print(DataSet.java:1495)
> at flink.Job.main(Job.java:67)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at 
> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:497)
> at 
> org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:395)
> at org.apache.flink.client.program.Client.runDetached(Client.java:279)
> at flink.DeployJob.main(DeployJob.java:24)
> Caused by: 
> org.apache.flink.runtime.leaderretrieval.LeaderRetrievalException: 
> *Could not retrieve the leader gateway*
> at 
> org.apache.flink.runtime.util.LeaderRetrievalUtils.retrieveLeaderGateway(LeaderRetrievalUtils.java:102)
> at 
> org.apache.flink.client.program.Client.getJobManagerGateway(Client.java:567)
> at org.apache.flink.client.program.Client.runDetached(Client.java:378)
> ... 15 more
> Caused by: java.util.concurrent.TimeoutException: Futures timed out 
> after [100000 milliseconds]
> at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)
> at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223)
> at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:116)
> at 
> scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53)
> at scala.concurrent.Await$.result(package.scala:116)
> at scala.concurrent.Await.result(package.scala)
> at 
> org.apache.flink.runtime.util.LeaderRetrievalUtils.retrieveLeaderGateway(LeaderRetrievalUtils.java:100)
> ... 17 more
>
>
>
> Maybe I missed some configuration of the client.
> Can you help me to solve the problem?
>
> Thanks



Mime
View raw message