端口不可用:监听tcp 0.0.0.0/50070:绑定:试图以其访问权限禁止的方式访问套接字 [英] Ports are not available: listen tcp 0.0.0.0/50070: bind: An attempt was made to access a socket in a way forbidden by its access permissions

查看:252
本文介绍了端口不可用:监听tcp 0.0.0.0/50070:绑定:试图以其访问权限禁止的方式访问套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下命令启动Docker容器.

I am trying to start a docker container with the below command.

docker run -it -p 50070:50070 -p 8088:8088 -p 8080:8080 suhothayan/hadoop-spark-pig-hive:2.9.2 bash

它最终出现以下错误.

泊坞窗:来自守护程序的错误响应:端口不可用:监听tcp 0.0.0.0/50070:绑定:试图以其访问权限禁止的方式访问套接字.

docker: error response from daemon: Ports are not available: listen tcp 0.0.0.0/50070: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

据我了解,由于另一个进程使用了​​端口50070,因此发生了错误.我试图确定该过程以便使用命令提示符中的以下命令将其杀死,但是它没有给出输出也没有错误.

As I understand, the error has occurred as the port 50070 is used by another process. I've tried to identify the process in order to kill that with the below command in the command prompt, but it does not give an output nor an error.

netstat -ano | findstr :50080

推荐答案

根据Windows的Docker问题

As per Docker issue for windows https://github.com/docker/for-win/issues/3171 :

您可能在命令 netsh interface ipv4 show excludeportportrange protocol = tcp

您可以使用上面机票中提到的解决方案.

You can use solution mentioned in the above ticket.

  1. 禁用hyper-v(需要重新启动几次)

  1. Disable hyper-v (which will required a couple of restarts)

dism.exe/在线/Disable-Feature:Microsoft-Hyper-V

完成所有必需的重新启动后,保留您想要的端口,以便hyper-v不会保留它

After finishing all the required restarts, reserve the port you want so hyper-v doesn't reserve it back

netsh int ipv4添加排除的端口范围协议= tcp startport = 50070 numberofports = 1

重新启用hyper-V(需要重新启动几次)

Re-Enable hyper-V (which will require a couple of restart)

dism.exe/在线/启用功能:Microsoft-Hyper-V/全部

这篇关于端口不可用:监听tcp 0.0.0.0/50070:绑定:试图以其访问权限禁止的方式访问套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆