月度归档:2024年05月

Defined MONGO_HOST unifi-db is not reachable, cannot proceed.

内网部署的 UniFi Network application,https://hub.docker.com/r/linuxserver/unifi-controller 已deprecated,今天有空迁移到https://hub.docker.com/r/linuxserver/unifi-network-application

unifi-network-application需要mongodb。

部署mongodb正常,服务正常启动。部署unifi-network-application后启动失败报错如下:

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
*** Waiting for MONGO_HOST unifi-db to be reachable. ***
*** Defined MONGO_HOST unifi-db is not reachable, cannot proceed. ***

寻找解决方案,发现不少同样问题,普遍确认过mongodb连接信息正确。尝试过一些解决方法无效后,想起来container需要link才能互相通信。将mongodb和unifi-network-application容器设置`–link`后重启,服务正常启动。