Hi, Mark

Flink will load ui service automatically if the flink-runtime-web jars in
classpath.

So, adding the dependency of flink-runtime-web is the right way.
You need to reload the maven project after the pod.xml changed.
And check whether the classpath includes flink-runtime-web classes or not.

Best,
Weihua


On Sun, Apr 16, 2023 at 10:02 PM Mark Petronic <markpetro...@gmail.com>
wrote:

> I am learning Flink for a new project. I am trying to understand the
> development/debug environment to help me step through my code to better
> learn Flink. I am using the Intellij community edition for my IDE and Flink
> 1.17.0.
>
> I am using this simple Flink app to demonstrate my issue.
>
>
> //===========================================================================
> package streamwindowprocessor;
>
> import org.apache.flink.configuration.Configuration;
> import org.apache.flink.streaming.api.datastream.DataStream;
> import
> org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
>
> public class SimpleFlink {
>
>     public static void main(String[] args) throws Exception {
>
>         Configuration conf = new Configuration();
>         final StreamExecutionEnvironment env =
> StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(conf);
> //        final StreamExecutionEnvironment env =
> StreamExecutionEnvironment.getExecutionEnvironment();
>
>         DataStream<String> values = env.socketTextStream("localhost",
> 9999);
>         values.print();
>
>         env.execute("Alarm Stream Processor");
>     }
> }
>
> //===========================================================================
>
> Before I run this from the IDE, I start up a socket listener on a terminal:
>
> nc -lkp 9999
>
> Then I open a web browser to localhost:8081 and get this output
>
> {
>
>    - errors:
>    [
>       - "Not found: /"
>       ]
>
> }
>
> If instead, I use ./start-cluster.sh to start a standalone cluster,
> rebuild my jar using getExecutionEnvironment() and submit that same simple
> jar using ./flink.sh run <path-to-jar>, then I can open the browser to
> localhost:8081 and I do see my app running, as expected, and it processes
> strings I send via the running netcat.
>
> Someone in SO noted that you should add this dependency, which I did and
> it made no difference.
>
> <dependency>
>   <groupId>org.apache.flink</groupId>
>   <artifactId>flink-runtime-web</artifactId>
>   <version>${flink.version}</version>
> </dependency>
>
> *Can anyone help me understand why the web UI does not work
> in createLocalEnvironmentWithWebUI()?*
>
> Thanks,
> Mark
>

Reply via email to