Re: Web UI not working with createLocalEnvironmentWithWebUI()
Problem is with dependencies in pom.xml file , adding required dependencies solved my problem. On Mon, 17 Apr 2023, 8:06 am Weihua Hu, wrote: > 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 > 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 values = env.socketTextStream("localhost", >> ); >> 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 >> >> 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 , 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. >> >> >> org.apache.flink >> flink-runtime-web >> ${flink.version} >> >> >> *Can anyone help me understand why the web UI does not work >> in createLocalEnvironmentWithWebUI()?* >> >> Thanks, >> Mark >> >
Re: Web UI not working with createLocalEnvironmentWithWebUI()
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 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 values = env.socketTextStream("localhost", > ); > 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 > > 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 , 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. > > > org.apache.flink > flink-runtime-web > ${flink.version} > > > *Can anyone help me understand why the web UI does not work > in createLocalEnvironmentWithWebUI()?* > > Thanks, > Mark >
Web UI not working with createLocalEnvironmentWithWebUI()
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 values = env.socketTextStream("localhost", ); 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 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 , 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. org.apache.flink flink-runtime-web ${flink.version} *Can anyone help me understand why the web UI does not work in createLocalEnvironmentWithWebUI()?* Thanks, Mark