Quantcast
Channel: Active questions tagged 22.04 - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4427

How to open port on wsl2 ubuntu of windows 11

$
0
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=forkingUser=josephGroup=josephExecStart=/home/joseph/flink/bin/start-cluster.shExecStop=/home/joseph/flink/bin/stop-cluster.shRestart=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 -tnlActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         Statetcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTENtcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTENtcp6       0      0 127.0.0.1:8081          :::*                    LISTENtcp6       0      0 :::22                   :::*                    LISTENtcp6       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!


Viewing all articles
Browse latest Browse all 4427

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>