2017-02-15 158 views
0

我正在使用Apache Flink-1.1.3進行實時流式數據分析。我的系統由消息隊列的Kafka集羣,讀取來自kafka分區的消息並對其進行一些分析的Flink集羣組成,最後我想將生成的數據轉儲到Ignite Cache中。對於我使用IgniteSink類的系統將數據匯入點火高速緩存。該版本如下:Apache Ignite中的Flink Streamer

弗林克1.1.3,
卡夫卡2.10, 點燃2.0.0

當我試圖運行它給了我下面的錯誤弗林克羣集上的工作,

Exception in thread "main" org.apache.flink.client.program.ProgramInvocationException: The program execution failed: Job execution failed. 
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:409) 
at org.apache.flink.client.program.StandaloneClusterClient.submitJob(StandaloneClusterClient.java:95) 
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:382) 
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:374) 
at org.apache.flink.streaming.api.environment.RemoteStreamEnvironment.executeRemotely(RemoteStreamEnvironment.java:209) 
at org.apache.flink.streaming.api.environment.RemoteStreamEnvironment.execute(RemoteStreamEnvironment.java:173) 
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1429) 
at flink_ignite_sink_remote.main(flink_ignite_sink_remote.java:77) 
Caused by: org.apache.flink.runtime.client.JobExecutionException: Job execution failed. 
at org.apache.flink.runtime.jobmanager.JobManager$$anonfun$handleMessage$1$$anonfun$applyOrElse$8.apply$mcV$sp(JobManager.scala:822) 
at org.apache.flink.runtime.jobmanager.JobManager$$anonfun$handleMessage$1$$anonfun$applyOrElse$8.apply(JobManager.scala:768) 
at org.apache.flink.runtime.jobmanager.JobManager$$anonfun$handleMessage$1$$anonfun$applyOrElse$8.apply(JobManager.scala:768) 
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) 
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) 
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) 
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401) 
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) 
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253) 
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346) 
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) 
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) 
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.ignite.sink.flink.IgniteSink$SinkContext$Holder 
at org.apache.ignite.sink.flink.IgniteSink$SinkContext.getStreamer(IgniteSink.java:201) 
at org.apache.ignite.sink.flink.IgniteSink$SinkContext.access$100(IgniteSink.java:175) 
at org.apache.ignite.sink.flink.IgniteSink.invoke(IgniteSink.java:165) 
at org.apache.flink.streaming.api.operators.StreamSink.processElement(StreamSink.java:39) 
at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:373) 
at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:358) 
at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:346) 
at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:329) 
at org.apache.flink.streaming.api.operators.TimestampedCollector.collect(TimestampedCollector.java:51) 
at flink_ignite_sink_remote$Splitter.flatMap(flink_ignite_sink_remote.java:177) 
at flink_ignite_sink_remote$Splitter.flatMap(flink_ignite_sink_remote.java:1) 
at org.apache.flink.streaming.api.operators.StreamFlatMap.processElement(StreamFlatMap.java:48) 
at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:373) 
at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:358) 
at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:346) 
at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:329) 
at org.apache.flink.streaming.api.operators.StreamSource$NonTimestampContext.collect(StreamSource.java:161) 
at org.apache.flink.streaming.connectors.kafka.internals.AbstractFetcher.emitRecord(AbstractFetcher.java:225) 
at org.apache.flink.streaming.connectors.kafka.internal.Kafka09Fetcher.run(Kafka09Fetcher.java:253) 
at java.lang.Thread.run(Thread.java:745) 

我已將Ignite-Flink的所有庫加入到我的項目中,但我得到了java.lang.NoClassDefFoundError錯誤。

+0

可以運行在本地弗林克同樣的工作設置並確認您是否觀察到相同的錯誤?所有Ignite sink庫都存在於類路徑中。 – samaitra

回答

0

當你與弗林克從事的工作,您部署在弗林克集羣,你有兩個選擇:

  1. 生成與所有的依賴關係中捆綁一個jar文件和部署罐子
  2. 所有的依賴關係添加到您的弗林克服務器的類路徑中,所以它可以找到那些依賴出來的jar文件。

你的問題看起來像你沒有生成一個jar文件,裏面的所有依賴關係,這些依賴關係不在fink服務器的類路徑中。

嘗試運行以下MVN命令生成您的罐子:

mvn clean package -Pbuild-jar

它可以生成多個罐子,挑肥罐子(較大)