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!
curl
?ufw
really in play here? Usually it isn't running (and doesn't have much purpose in running) under WSL.