Docker SQL绑定:尝试以其访问权限禁止的方式访问套接字 [英] Docker SQL bind: An attempt was made to access a socket in a way forbidden by its access permissions

查看:68
本文介绍了Docker SQL绑定:尝试以其访问权限禁止的方式访问套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Docker中为SQL服务器创建容器时(带有管理员权限)时出现错误消息:

Error-message when creating container in Docker for SQL-server (with Admin-rights):


…守护程序的错误响应:驱动程序无法对端点SQL19b
上的外部
连接进行编程(cc372bb961fb8178c2461d26bf16c4232a62e01c5f48b8fcec273370506cc095):
启动userland代理时出错:监听tcp 0.0.0.0:1433:绑定:尝试
进行访问一个套接字,但其访问权限
禁止。

"… Error response from daemon: driver failed programming external connectivity on endpoint SQL19b (cc372bb961fb8178c2461d26bf16c4232a62e01c5f48b8fcec273370506cc095): Error starting userland proxy: listen tcp 0.0.0.0:1433: bind: An attempt was made to access a socket in a way forbidden by its access permissions."

摘录自日志文件:

    [21:39:17.692][ApiProxy          ][Info   ] time="2019-08-01T21:39:17+02:00" msg="proxy >> HEAD /_ping\n"
[21:39:17.696][ApiProxy          ][Info   ] time="2019-08-01T21:39:17+02:00" msg="proxy << HEAD /_ping (3.9929ms)\n"
[21:39:17.699][GoBackendProcess  ][Info   ] error CloseWrite to: The pipe is being closed.
[21:39:17.742][ApiProxy          ][Info   ] time="2019-08-01T21:39:17+02:00" msg="proxy >> DELETE /v1.40/containers/22810276e261\n"
[21:39:17.758][ApiProxy          ][Info   ] time="2019-08-01T21:39:17+02:00" msg="proxy << DELETE /v1.40/containers/22810276e261 (16.129ms)\n"
[21:39:17.759][GoBackendProcess  ][Info   ] error CloseWrite to: The pipe is being closed.
[21:39:27.866][ApiProxy          ][Info   ] time="2019-08-01T21:39:27+02:00" msg="proxy >> HEAD /_ping\n"
[21:39:27.869][ApiProxy          ][Info   ] time="2019-08-01T21:39:27+02:00" msg="proxy << HEAD /_ping (1.6595ms)\n"
[21:39:27.870][GoBackendProcess  ][Info   ] error CloseWrite to: The pipe is being closed.
[21:39:27.894][ApiProxy          ][Info   ] time="2019-08-01T21:39:27+02:00" msg="proxy >> POST /v1.40/containers/create?name=SQLLinuxLocalPersist\n"
[21:39:27.908][APIRequestLogger  ][Info   ] [db460e2b-7d77-4756-be19-665715a9a182] POST http://unix/usage
[21:39:27.909][APIRequestLogger  ][Info   ] [db460e2b-7d77-4756-be19-665715a9a182] POST http://unix/usage -> 200 OK took 0ms
[21:39:27.909][ApiProxy          ][Info   ] time="2019-08-01T21:39:27+02:00" msg="Rewrote mount C:\\Docker\\SQL:/sql (volumeDriver=) to /host_mnt/c/Docker/SQL:/sql"
[21:39:28.049][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="proxy << POST /v1.40/containers/create?name=SQLLinuxLocalPersist (154.5485ms)\n"
[21:39:28.050][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="proxy >> POST /v1.40/containers/89d13c9d2d2bae095cf66e94b5bb60907a50cb199eb2bdcef9845d493435be07/wait?condition=next-exit\n"
[21:39:28.052][GoBackendProcess  ][Info   ] error CloseWrite to: The pipe is being closed.
[21:39:28.080][APIRequestLogger  ][Info   ] [a9a496c9-767a-4bd2-917c-f3f1391609dc] POST http://unix/usage
[21:39:28.082][APIRequestLogger  ][Info   ] [a9a496c9-767a-4bd2-917c-f3f1391609dc] POST http://unix/usage -> 200 OK took 0ms
[21:39:28.060][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="proxy >> POST /v1.40/containers/89d13c9d2d2bae095cf66e94b5bb60907a50cb199eb2bdcef9845d493435be07/start\n"
[21:39:28.088][APIRequestLogger  ][Info   ] [89bf69bf-5084-4d4b-a887-c7acb99bf131] POST http://unix/usage
[21:39:28.088][APIRequestLogger  ][Info   ] [6ca0e28f-bba3-4f66-afc5-43f6d486c8a2] POST http://unix/usage
[21:39:28.089][APIRequestLogger  ][Info   ] [89bf69bf-5084-4d4b-a887-c7acb99bf131] POST http://unix/usage -> 200 OK took 0ms
[21:39:28.089][APIRequestLogger  ][Info   ] [6ca0e28f-bba3-4f66-afc5-43f6d486c8a2] POST http://unix/usage -> 200 OK took 0ms
[21:39:28.067][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="mount point type:bind"
[21:39:28.068][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="mount point:/host_mnt/c/Docker/SQL"
[21:39:28.205][Moby              ][Info   ] [ 2254.975742] docker0: port 1(veth69918f7) entered blocking state
[21:39:28.250][Moby              ][Info   ] [ 2255.087127] docker0: port 1(veth69918f7) entered disabled state
[21:39:28.295][Moby              ][Info   ] [ 2255.132041] device veth69918f7 entered promiscuous mode
[21:39:28.354][Moby              ][Info   ] [ 2255.176944] IPv6: ADDRCONF(NETDEV_UP): veth69918f7: link is not ready
[21:39:28.439][GoBackendProcess  ][Info   ] Adding tcp forward from 0.0.0.0:1433 to 172.17.0.2:1433
[21:39:28.560][Moby              ][Info   ] [ 2255.385920] docker0: port 1(veth69918f7) entered disabled state
[21:39:28.616][Moby              ][Info   ] [ 2255.442735] device veth69918f7 left promiscuous mode
[21:39:28.667][Moby              ][Info   ] [ 2255.497549] docker0: port 1(veth69918f7) entered disabled state
[21:39:28.826][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="proxy << POST /v1.40/containers/89d13c9d2d2bae095cf66e94b5bb60907a50cb199eb2bdcef9845d493435be07/start (767.0192ms)\n"
[21:39:28.829][GoBackendProcess  ][Info   ] error CloseWrite to: The pipe is being closed.
[21:39:28.834][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="Cancel connection..."
[21:39:28.836][ApiProxy          ][Info   ] time="2019-08-01T21:39:28+02:00" msg="proxy << POST /v1.40/containers/89d13c9d2d2bae095cf66e94b5bb60907a50cb199eb2bdcef9845d493435be07/wait?condition=next-exit (786.0411ms)\n"

这将导致创建一个容器,但未分配端口。因此无法启动SQL Server。

This leads to a container created, but without the port allocated. Therefore cannot start the SQL server.

Edit1:端口1433似乎不是用过(至少没有在 netstat -abn下列出)

The port 1433 doesn't seem to be used (at least it is not listed under "netstat -abn" )

推荐答案

我遇到了同样的问题,但是我没有想要更改MSSQL的默认端口(1433)

I faced the same issue and I didn't want to change the default port of MSSQL (1433)

这是我为解决此问题所做的工作。

Here what I did to fix this problem.

确保您的端口没有被使用,进入资源监视器以验证它。
现在检查该端口是否已保留。打开命令提示符并输入此

Make sure that your port is not in used, Go to resource monitor to validate this. Now check if the port is reserved. Open your command prompt and enter this

netsh int ipv4 show excludedportrange protocol=tcp

端口此处列出的是由hyper-v管理的,此处删除端口1433的唯一方法是禁用hyper-v,保留端口1433,以便大肆宣传rv不会保留它。

The port listed here are managed by hyper-v and the only way to remove the port 1433 here is to disable hyper-v, reserve the port 1433 so hyper-v doesn't reserve it back.

禁用hyper-v

dism.exe /Online /Disable-Feature:Microsoft-Hyper-V

保留端口1433

netsh int ipv4 add excludedportrange protocol=tcp startport=1433 numberofports=1

重新启用hyper-v

Re Enable hyper-v

dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

启动docker并运行您的容器

Start docker and run your container

这篇关于Docker SQL绑定:尝试以其访问权限禁止的方式访问套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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