title: Which ports should I open in firewall on nodes with Apach Flink?
body: <p>When I try to run my flow on Apache Flink standalone cluster I see the following exception:</p>
  
  <pre><code>java.lang.IllegalStateException: Update task on instance aaa0859f6af25decf1f5fc1821ffa55d @ app-2 - 4 slots - URL: akka.tcp://flink@192.168.38.98:46369/user/taskmanager failed due to:
      at org.apache.flink.runtime.executiongraph.Execution$6.onFailure(Execution.java:954)
      at akka.dispatch.OnFailure.internal(Future.scala:228)
      at akka.dispatch.OnFailure.internal(Future.scala:227)
      at akka.dispatch.japi$CallbackBridge.apply(Future.scala:174)
      at akka.dispatch.japi$CallbackBridge.apply(Future.scala:171)
      at scala.PartialFunction$class.applyOrElse(PartialFunction.scala:123)
      at scala.runtime.AbstractPartialFunction.applyOrElse(AbstractPartialFunction.scala:28)
      at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:136)
      at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:134)
      at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
      at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
      at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
      at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
      at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
      at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
  Caused by: akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka.tcp://flink@192.168.38.98:46369/user/taskmanager#1804590378]] after [10000 ms]
      at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:333)
      at akka.actor.Scheduler$$anon$7.run(Scheduler.scala:117)
      at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:599)
      at scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:109)
      at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:597)
      at akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(Scheduler.scala:467)
      at akka.actor.LightArrayRevolverScheduler$$anon$8.executeBucket$1(Scheduler.scala:419)
      at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:423)
      at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>Seems like port 46369 blocked by firewall. It is true because I read <a href="https://ci.apache.org/projects/flink/flink-docs-master/setup/config.html" rel="nofollow">configuration section</a> and open these ports only:</p>
  
  <pre><code>6121:
    comment: Apache Flink TaskManager (Data Exchange)
  6122:
    comment: Apache Flink TaskManager (IPC)
  6123:
    comment: Apache Flink JobManager
  6130:
    comment: Apache Flink JobManager (BLOB Server)
  8081:
    comment: Apache Flink JobManager (Web UI)
  </code></pre>
  
  <p>The same ports described in <code>flink-conf.yaml</code>:</p>
  
  <pre><code>jobmanager.rpc.address: app-1.stag.local
  jobmanager.rpc.port: 6123
  jobmanager.heap.mb: 1024
  
  taskmanager.heap.mb: 2048
  taskmanager.numberOfTaskSlots: 4
  taskmanager.memory.preallocate: false
  
  blob.server.port: 6130
  
  parallelism.default: 4
  
  jobmanager.web.port: 8081
  
  state.backend: jobmanager
  
  restart-strategy: none
  restart-strategy.fixed-delay.attempts: 2
  restart-strategy.fixed-delay.delay: 60s
  </code></pre>
  
  <p>So, I have two questions:</p>
  
  <ol>
  <li>This exception related to blocked ports. Right?</li>
  <li>Which ports should I open on firewall for standalone Apache Flink cluster?</li>
  </ol>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>I found configuration problem in <code>masters</code> and <code>slaves</code> files (I skip new line separators between hosts described in these files). I fixed it and now I see other exceptions:</p>
  
  <ul>
  <li><a href="https://gist.github.com/maxd/9859eb8c4bcfb62b53b0" rel="nofollow">flink--taskmanager-0-app-1.stag.local.log</a></li>
  <li><a href="https://gist.github.com/maxd/cd5073b8b635d2ab149e" rel="nofollow"> flink--taskmanager-0-app-2.stag.local.log
  </a></li>
  </ul>
  
  <p>I have 2 nodes:</p>
  
  <ul>
  <li>app-1.stag.local (with running job and task managers)</li>
  <li>app-2.stag.local (with running task manager)</li>
  </ul>
  
  <p>As you can see from these logs the app-1.stag.local task manager can't connect to other task manager:</p>
  
  <blockquote>
    <p>java.io.IOException: Connecting the channel failed: Connecting to remote task manager + 'app-2.stag.local/192.168.38.98:35806' has failed. This might indicate that the remote task manager has been lost.</p>
  </blockquote>
  
  <p>but app-2.stag.local has open port:</p>
  
  <blockquote>
    <p>2016-03-18 16:24:14,347 INFO  org.apache.flink.runtime.io.network.netty.NettyServer         - Successful initialization (took 39 ms). Listening on SocketAddress /192.168.38.98:35806</p>
  </blockquote>
  
  <p>So, I think problem related to firewall but I don't understand where I can configure this port (or range of ports) in Apache Flink.</p>