SOLVED Scaling on 1.16.x requires redis - how to configure?


  • Looking to upgrade to 1.16.2 with a forum that uses clustering and runs on MongoDB

    I see this:
    https://community.nodebb.org/topic/15178/1-16-0-breaking-changes/3?_=1616876795709

    If you are using clustering redis is now a requirement. Simply install and configure redis in your config.json block. If you were already using redis as your datastore or for sessions no changes are necessary.

    In the "scaling" page of the documentation this is:

    Configure Redis
    When you setup NodeBB to use more than one process, it is advisable to configure Redis as well. Each NodeBB process can communicate with the others through Redis pub-sub. Install Redis on your server and add a redis block to your config.json....

    So:

    1. Does redis need to be installed before upgrading to 1.16.x? or should the upgrade be done first, then redis installed (basically clarity on the upgrade sequence in this case)
    2. How is redis configured? Does the upgrade script create the database, admin user etc etc? If not where is the documentation on how to install and configure redis to be used for pub-sub, but not as the main database?
  • NodeBB

    1. You don't need redis while upgrading to 1.16.x.

    2. Upgrade script won't create the redis database or setup users. You need to install redis on your server and then add a redis block to your config.json like this.

    "database": "mongo"
    "mongo": {
       ..mongo details
    },
    "redis": {
          "host": "127.0.0.1",
          "port": "6379",
          "password": "",
          "database": "0"
    }
    

    Once you start nodebb it will read the redis block and use redis for pubsub/sessions and passing around socket.io messages between the processes.


  • @baris thanks. so to be clear just installing redis, without any configuration is all that is required?

    Is there any concern with having redis used in this way with no admin account/password etc?


  • @tonytony I find this site very helpful https://redis.io/topics/security

  • NodeBB

    Yeah follow the above link and only allow access from localhost or setup auth and use a password


  • @baris @FrankM thanks, so it looks like redis installs suitably setup (protected mode on, only bound to the loopback address) etc.

    I did the upgrade to 1.16.2 and this element of it appears ok, will open another thread for other issues.


  • @TonyTony
    Make sure you have updated in the nodebb configuration with the property

    "isCluster": true
    

    When you use auto sclaing(HPA) of NodeBB, this is must. Otherwise you will end with lot of inconsistency in the API responses.

    Note: This property will help if you use on Redis as your DB(not with the conbination of Mongo+Redis)

    Thanks for the details mentioned in this post
    https://community.nodebb.org/topic/15517/nodebb-mongodb-scaling-k8s/16

Suggested Topics

  • 2
  • 5
  • 3
  • 1
  • 2
| |