cvat启动成功之后无法访问
Posted 修炼之路
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cvat启动成功之后无法访问相关的知识,希望对你有一定的参考价值。
错误信息
cvat
安装好之后,通过docker-compose up -d
启动成功之后,输出信息如下
$ docker-compose up -d
/root/anaconda3/lib/python3.5/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.
from cryptography.hazmat.backends import default_backend
Creating network "cvat_default" with the default driver
Creating cvat_redis ... done
Creating cvat_db ... done
Creating cvat ... done
Creating cvat_ui ... done
Creating cvat_proxy ... done
通过localhost:8080来访问时,提示无法访问。通过下面命令来创建super user
时报错
#创建super user
docker exec -it cvat bash -ic 'python3 ~/manage.py createsuperuser'
#错误信息如下
django.db.utils.OperationalError: could not connect to server: Connection timed out
Is the server running on host "cvat_db" (172.28.0.3) and accepting
TCP/IP connections on port 5432?
解决办法
方法1
- 用
ifconfig
命令查看docker占用的网络服务
$ ifconfig
br-fe794652b2b6 Link encap:Ethernet HWaddr 02:42:07:cf:35:d7
inet addr:172.28.0.1 Bcast:172.28.0.255 Mask:255.255.255.0
inet6 addr: fe80::42:7ff:fecf:35d7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:183 errors:0 dropped:0 overruns:0 frame:0
TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:236909 (236.9 KB) TX bytes:35323 (35.3 KB)
如果在docker-compose down
之后这个服务还在,我们就通过sudo ifconfig br-fe794652b2b6 down
来关闭这个服务之后,再通过docker-compose up
重启之后这个问题就能解决了
方法2
通过上面的信息不难看出,应该是cvat_db
无法连接导致的,我们通过docker来测试连接,发现根本无法ping通
> docker exec -it cvat_db bash
bash-5.1# ping 172.28.0.4
PING 172.28.0.4 (172.28.0.4): 56 data bytes
^C
--- 172.28.0.4 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss
bash-5.1# ping 172.28.0.0
PING 172.28.0.0 (172.28.0.0): 56 data bytes
^C
--- 172.28.0.0 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss
bash-5.1# ping 172.28.0.6
PING 172.28.0.6 (172.28.0.6): 56 data bytes
^C
--- 172.28.0.6 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
修改配置文件中设置的IP地址,修改内容如下
- 修改docker-compose.xml中https://github.com/openvinotoolkit/cvat/blob/develop/docker-compose.yml#L83
将172.28.0.0/24改为
172.18.0.0/16
- 修改docker-compose.serverless.yml中的https://github.com/openvinotoolkit/cvat/blob/develop/components/serverless/docker-compose.serverless.yml#L17
将172.28.0.1改为
172.18.0.0
修改完成之后,重新启动即可访问
参考:
以上是关于cvat启动成功之后无法访问的主要内容,如果未能解决你的问题,请参考以下文章