问题描述
我在Windows 10中使用Docker(使用最新版本的Docker Desktop-也是Docker的初学者)。我下载了Docker的最新HDP,解压缩该文件夹并在其中执行脚本“ sh docker-deploy-hdp30.sh” Git Bash我收到端口50079的错误,如下面的屏幕快照所示。我没有其他容器,只有这个。端口50079没有活动的连接。
即使上面概述了此端口错误,我也可以启动HDP容器(如下所示),并且可以访问外壳程序(甚至运行Apache Pig),但无法通过Google Chrome浏览器访问端口8080和1080等(我检查了Edge和Firefox,但效果不佳)。例如,当我键入127.0.0.1:8080时,它说连接被拒绝。此外,我无法在Docker中启动sandBox-proxy。请您帮我解决端口问题。
解决方法
如果出现docker error response from daemon ports are not available ... An attempt was made to access a socket in a way forbidden by its access permissions
错误,则应首先执行netsh interface ipv4 show excludedportrange protocol=tcp
并检查所需端口是否在其中一个范围内。如果在范围内,则适用于Windows的Docker和Hyper-V将负责上述所有排除的端口范围。
以this为基础的命令也许可以解决您的问题。对于步骤1和3,您需要在PowerShell中以管理员身份运行它。
1-Disable hyper-v with this command(which will required a couple of restarts)
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
2-When you finish all the required restarts,reserve the port you want so hyper-v doesn't reserve it back
netsh int ipv4 add excludedportrange protocol=tcp startport=50079 numberofports=1
3-Re-Enable hyper-V (which will require a couple of restart)
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
所有重新启动后,运行命令,您的容器可能会工作。