I have one data container and I would like to use several web_only containers (several forums on separate servers). How to I pass a DB ID to web_only container so that multiple forums use their own cache?
Without this the stats reported in Admin -> Reports are mixed up between different forums.
I’ve got the same issue. I have an existing redis cluster (with replication and failover) that I want Discourse to use, but I can’t find a way to tell Discourse which database index to use.
Definitely do not do anything like this . Message Bus which is responsible for long polling relies on pub/sub, pub/sub is always on “db 0” not configurable.
If you try to co-host multiple Discourses on one Redis DB expect some very major amount of breakage.
@sam is your warning from 2018 about the message bus exclusively linked to Redis db 0 still accurate, or can we use now a different redis instance database ID to host different discourse instances?
I noticed in the multisite-configuration-with-docker howto, there is a db_id: 2 defined, I thought that may refer to the redis database ID, thus this inquiry
Yes this is still 100% correct afaik, PUB/SUB in redis is tied to DB 0. Discourse multisite is designed to work fine with multiple instances talking to 1 redis with db 0.
Pub/Sub has no relation to the key space. It was made to not interfere with it on any level, including database numbers.
Publishing on db 10, will be heard by a subscriber on db 1.