Users are discussing how to set a Redis DB ID in a Docker container for multiple Discourse instances. TomekB wants to pass a DB ID to a web-only container so that multiple forums use their own cache. rluba has a similar issue and found the corresponding setting redis_db in discourse_defaults.conf, which can be set as DISCOURSE_REDIS_DB in the container YAML.
However, sam warns that using a different Redis database ID for multiple Discourse instances can cause major breakage, as the Message Bus relies on pub/sub, which is always on “db 0” and not configurable. ryanerwin asks if this warning is still accurate, and sam confirms that it is, citing Redis documentation that pub/sub is tied to DB 0 and has no relation to the key space or database numbers.
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 هل تحذيرك من عام 2018 حول حافلة الرسائل المرتبطة حصريًا بقاعدة بيانات Redis db 0 لا يزال دقيقًا، أم يمكننا الآن استخدام معرف قاعدة بيانات مختلف من مثيل Redis لاستضافة نسخ مختلفة من Discourse؟
لاحظت في دليل multisite-configuration-with-docker وجود db_id: 2 مُعرَّف، فظننت أنه قد يشير إلى معرف قاعدة بيانات Redis، ومن هنا جاء هذا الاستفسار
نعم، هذا صحيح بنسبة 100% حسب علمي. إن نظام النشر والاشتراك (PUB/SUB) في Redis مرتبط بقاعدة البيانات 0. تم تصميم نظام Discourse متعدد المواقع للعمل بشكل ممتاز مع عدة instances تتحدث إلى Redis واحد باستخدام قاعدة البيانات 0.
لا علاقة لنظام النشر والاشتراك (Pub/Sub) بمساحة المفاتيح. تم تصميمه لعدم التدخل في أي مستوى، بما في ذلك أرقام قواعد البيانات.
النشر في قاعدة البيانات 10 سيُسمع من قبل مشترك في قاعدة البيانات 1.