Problem background:
When test rmi-client to server,the latter's default port was occupied,
even if we use netstat -ano|fidnstr 1099
to seek whick application has occupyied it,We get null
.
Reason
Hyper-v
because i installed wsl-v2
last night, when it get worse.
because wsl-v2
use Hyper-v
.Windows dispense some port to it,make these ports becoming reservations.So we can not find it in netstat -ano
.
Resolve
- Find the dynamic port range
netsh int ipv4 show dynamicport tcp
it including some ports that is used as reservation of Hyper-V
- Find the reserved ports
netsh interface ipv4 show excludedportrange protocol=tcp
Number 1099
is in it range.So we must avoid it.
- Update dynamicly reserved port number(adminsitrator mode)
netsh int ipv4 set dynamic tcp start=49152 num=16384
- Note:
A command can be used to remove some ports from the reserved port list
netsh int ipv4 add excludedportrange protocol=tcp startport=1430 numberofports=1
OR
turn off Hyper-v
,your WSL-v2 still working
every time launch Docker ,wsl must use service docker start
……