1.Docker中apt-get update出现以下错误:
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:3 http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 InRelease
Temporary failure resolving 'repo.mongodb.org'
Err:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
解决方式:
在linux中修改
vim /etc/resolv.conf
追加
nameserver 8.8.8.8
重新启动网络服务
sudo service network-manager restart
重新启动docker
sudo systemctl restart docker
2.虚拟机挂机后,
远程连接mongodb 失败
解决:
重新启动网络服务
sudo service network-manager restart
重新启动docker
sudo systemctl restart docker
3.有的教程进行如下修改
设置 vim /etc/mongod.conf.orig
bindId=127.0.0.1改为bindIp=0.0.0.0
我进行前两步骤就实现了,远程访问