-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Mongo DB #527
Comments
I was just looking into this, as I was wanting to move away from standalone use myself, but… upstream seem to (in their
Mongo's own lifecycle policy reflects that the 3.6 line was EoL'd in April 2021, which is also reflected by the "supported tags" in the official Docker image only going back to some Shouldn't upstream be improving their own product baseline? It's been over a year since 3.6 has fallen out of any support. |
@jasonmp85: it seems likely that they're intentionally picking the earlier versions to avoid the MongoDB license change (AGPL3 to SSPL). |
7.5.x (now release candidate) has these requirements in the
This means we could upgrade to a 4.x version. However, with the new Java == 17 requirement that's tricky to select the OS version that ships with both Java and MongoDB versions compatible with the application. See also #673 (comment) |
Why not making your lives easier and decouple the dependencies by having two separate containers, one for the app and one for the database? services:
app:
image: jacobalberty/unifi:v7.5.176
ports:
- 3478:3478/udp
- 8443:8443 # better use traefik
- 8080:8080
- 10001:10001/udp
#- 1900:1900/udp # optional
#- 5514:5514/udp # optional
#- 6789:6789 # optional
#- 8843:8843 # optional
#- 8880:8880 # optional
volumes:
- ./data/app:/unifi/data
- ./data/log:/unifi/log
environment:
- RUNAS_UID0=false
- UNIFI_UID=999
- UNIFI_GID=999
- LOTSOFDEVICES=true
- DB_URI=mongodb://unifi:{my-mongodb-pw}@db/unifi?authSource=admin
- STATDB_URI=mongodb://unifi:{my-mongodb-pw}@db/unifi_stat?authSource=admin
- DB_NAME=unifi
networks:
- default
db:
image: mongo:4.4.18
volumes:
- ./data/db:/data/db
- ./data/configdb:/data/configdb
environment:
- MONGO_INITDB_ROOT_USERNAME=unifi
- MONGO_INITDB_ROOT_PASSWORD={my-mongodb-pw}
- MONGO_INITDB_DATABASE=unifi
networks:
- default
networks:
default: An additional important information for the RaspberryPi 4. Any MongoDB version >4.4.18 will not work. MongoDB requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that! applies to all versions ≥5.0, any of 4.4 ≥4.4.19 |
Looks like UniFi Network Application 8.0 (not released yet) will require MongoDB 3.6 upwards: https://community.ui.com/releases/UniFi-Network-Application-8-0-7/7818b9df-4845-4c82-ba3c-1218e61010d4 |
Seems the maintainers of other UniFi Controller Docker images realized it as well, see here. I switched to linuxserver/unifi-network-application to finally get a clean "mongoless" Docker image 😉 services:
app:
image: linuxserver/unifi-network-application:8.0.7
ports:
- 3478:3478/udp
- 8443:8443 # better use traefik
- 8080:8080
- 10001:10001/udp
#- 1900:1900/udp # optional
#- 5514:5514/udp # optional
#- 6789:6789 # optional
#- 8843:8843 # optional
#- 8880:8880 # optional
volumes:
- ./data/app:/config
environment:
- TZ=Etc/UTC
- PUID=1000
- PGID=1000
- MONGO_USER=unifi
- MONGO_PASS={my-mongodb-pw}
- MONGO_HOST=db
- MONGO_PORT=27017
- MONGO_DBNAME=unifi
- MEM_LIMIT=1024 # optional
- MEM_STARTUP=1024 # optional
- MONGO_TLS= # optional
- MONGO_AUTHSOURCE= # optional
networks:
- default
db:
image: mongo:4.4.18
volumes:
- ./data/db:/data/db
- ./data/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro # only for first run
#environment:
#- MONGO_INITDB_ROOT_USERNAME=unifi # unsupported, use init-mongo.js instead
#- MONGO_INITDB_ROOT_PASSWORD={my-mongodb-pw} # unsupported, use init-mongo.js instead
#- MONGO_INITDB_DATABASE=unifi # unsupported, use init-mongo.js instead
networks:
- default
networks:
default: And do not forget to use db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "{my-mongodb-pw} ", roles: [{role: "dbOwner", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "{my-mongodb-pw} ", roles: [{role: "dbOwner", db: "unifi_stat"}]}); |
I also switched to a very similiar setup and it works flawlessly. Would recommend @jokay setup 👍 |
thx, looks very nice, I really tried to setup the same but I always get that error on the mongo db container and I am sure that's the reason why the unifi container won't start up: What's wrong? :/ thx! |
Unifi Application v 8.1 and newer now support up to MongoDB v7.0. |
I installed unifi 8.1.113 using this container image. A few days later I updated mongo db from 3.6 to 4.4. I use docker-compose to manage my containers. A few points to consider:
|
Seems to be a similar limitation as for a RaspberryPi 4:
You may consider using a RaspberryPi 5 which allows you to run the UniFi Network Application 8.1.x together with MongoDB 7.0.x. Btw creating a backup for e.g. MongoDB 4.4.29 and restoring it on MongoDB 7.0.7 using the UniFi Network Application did work without any problems. |
As of right now Unifi supports up to Mongo DB 3.6, we are still on 3.4 for AMD64/ARM64 and 3.2 for ARM32.
At the very least we need to move Mongo DB to 3.6 for AMD64 or ARM64
This does not appear to require any changes to our base image.
If possible we should build Mongo DB 3.6 for ARM32 so it can upgrade as well.
The text was updated successfully, but these errors were encountered: