You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by "Sofya T. Irwin" <so...@gmail.com> on 2023/03/29 21:45:11 UTC

Is MiniClusterWithClientResource expected to have a UI?

Hi,

I'm experimenting with the MiniClusterWithClientResource, below, and when I
print out the URL I'm not able to access a UI. Is
the MiniClusterWithClientResource expected to provide a UI?

Thanks
-Sofya

https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/dev/datastream/testing/#junit-rule-miniclusterwithclientresource


    public static MiniClusterWithClientResource flinkCluster =
        new MiniClusterWithClientResource(
             new MiniClusterResourceConfiguration.Builder()
                 .setNumberSlotsPerTaskManager(2)
                 .setNumberTaskManagers(1)
                 .build());

        ClusterClient<?> clusterClient = flinkCluster.getClusterClient();
        RestClusterClient<?> restClusterClient =
flinkCluster.getRestClusterClient();
        String URL = clusterClient.getWebInterfaceURL();
        String URL2 = restClusterClient.getWebInterfaceURL();
        System.out.println("URL " + URL); // Provided URL is not accessible

Re: Is MiniClusterWithClientResource expected to have a UI?

Posted by Weihua Hu <hu...@gmail.com>.
Hi, Sofya

The MiniClusterWithClientResource does not provide UI by default.
But you can enable it by adding flink-runtime-web dependency to do some
debug.


Add this dependency to your pom.xml. And flink will load the web ui
automatically.

<dependency>
   <groupId>org.apache.flink</groupId>
   <artifactId>flink-runtime-web</artifactId>
   <version>${project.version}</version>
   <scope>test</scope>
</dependency>


Best,
Weihua


On Thu, Mar 30, 2023 at 5:47 AM Sofya T. Irwin <so...@gmail.com> wrote:

> Hi,
>
> I'm experimenting with the MiniClusterWithClientResource, below, and when
> I print out the URL I'm not able to access a UI. Is
> the MiniClusterWithClientResource expected to provide a UI?
>
> Thanks
> -Sofya
>
>
> https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/dev/datastream/testing/#junit-rule-miniclusterwithclientresource
>
>
>     public static MiniClusterWithClientResource flinkCluster =
>         new MiniClusterWithClientResource(
>              new MiniClusterResourceConfiguration.Builder()
>                  .setNumberSlotsPerTaskManager(2)
>                  .setNumberTaskManagers(1)
>                  .build());
>
>         ClusterClient<?> clusterClient = flinkCluster.getClusterClient();
>         RestClusterClient<?> restClusterClient =
> flinkCluster.getRestClusterClient();
>         String URL = clusterClient.getWebInterfaceURL();
>         String URL2 = restClusterClient.getWebInterfaceURL();
>         System.out.println("URL " + URL); // Provided URL is not accessible
>
>
>
>
>