0

To test the network between Windows 11 localhost and WSL2 ubuntu on Windows 11, I install tomcat9 on WSL2 ubuntu

$ sudo apt install tomcat9 -y
$ sudo systemctl enable tomcat9
$ sudo systemctl start tomcat9
$ sudo systemctl status tomcat9

The installation works successfully. The localhost:8080 connection on windows 11 web browser is successful without errors. This time I try to deploy Apache Flink service in WSL2 ubuntu on Windows 11. First I download Flink 1.18.1, unzip the Flink and make link with Flink-1.18.1

$ ln -s flink-1.18.1 flink

And I make the ubuntu service file

$ nano /usr/lib/systemd/system/flink.service
    
[Unit]
Description=Flink Service
    
[Service]
Type=forking
User=joseph
Group=joseph
ExecStart=/home/joseph/flink/bin/start-cluster.sh
ExecStop=/home/joseph/flink/bin/stop-cluster.sh
    
Restart=always
    
[Install]
WantedBy=multi-user.target

The Flink service starts with no error.

$ sudo systemctl enable flink
$ sudo systemctl start flink

Finally I open the Flink default port 8081 on Ubuntu firewall.

$ sudo ufw allow 8081/tcp

But http://localhost:8081 on Windows 11 web browser can not connect the Flink service on WSL2 ubuntu even if I can find the 8081 port is open like below,

$ netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 127.0.0.1:8081          :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::8080                 :::*                    LISTEN

I can not understand the connection failure from Flink on WSL2 ubuntu. The tomcat9 is installed on WSL2 ubuntu the same way and localhost:8080 on Windows 11 brings no error. I need your advice desperately. Thanks!

4
  • Two questions. (1) What's the error you are getting from attempting to connect from Windows, (2) Have you tried to connect from inside WSL with something like curl? Commented Feb 28 at 14:52
  • Also, is ufw really in play here? Usually it isn't running (and doesn't have much purpose in running) under WSL. Commented Feb 28 at 14:54
  • I solved it. This issue is the matter of Flink configuration. I set 'rest.bind-address: 0.0.0.0' in flink-conf.yaml file and it works successfully. Thanks any any. Commented Feb 29 at 9:22
  • Good to hear - Consider putting in a self-answer to the question if you think it might be useful to others in the future. Thanks! Commented Feb 29 at 9:37

0

You must log in to answer this question.