Having trouble with clustering
-
Hello,
This is my first foray into using NodeBB as a platform. I have managed to scrimp via trial and error, however I am stumped on this issue.
As pointed out in https://docs.nodebb.org/configuring/scaling/, it mentioned that all I have to do is to specify multiple ports in order to fork several processes to be used by Nginx thereafter.
I don't have any special setup on my config.json (everything is at default), other than the following:
"port": ["4567", "4568", "4569"]
Putting Nginx aside, I would like to get NodeBB up and running with multiple processes first.
However, when starting nodebb, these are the errors that came up:
nodebb@localhost:~/nodebb$ ./nodebb log Hit Ctrl-C to exit at module.exports.create (/home/nodebb/nodebb/src/database/cache.js:5:9) at module.exports (/home/nodebb/nodebb/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/nodebb/nodebb/src/database/mongo.js:187:24) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) [cluster] Child Process (14039) has exited (code: 0, signal: null) [cluster] Child Process (14041) has exited (code: 0, signal: null) [cluster] Child Process (14044) has exited (code: 0, signal: null)
How can I resolve this? Thank you.
Peace~ -
@natsbee that command only starts showing logs with only a couple lines from before.
You'll want to see what the error is by opening the file
logs/output.log
directly.Alternatively, just run
./nodebb dev
and then it'll just output the logs in real time. -
Hello Julian,
Thank you for the response. I have checked and these are the errors that I have received.
nodebb@localhost:~/nodebb$ ./nodebb dev NodeBB v3.5.0 Copyright (C) 2013-2023 NodeBB Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. For the full license, please visit: http://www.gnu.org/copyleft/gpl.html Clustering enabled: Spinning up 2 process(es). 2023-11-09T02:02:11.955Z [4568/16724] - verbose: * using configuration stored in: /home/nodebb/nodebb/config.json 2023-11-09T02:02:11.950Z [4567/16723] - verbose: * using configuration stored in: /home/nodebb/nodebb/config.json 2023-11-09T02:02:11.964Z [4567/16723] - info: Initializing NodeBB v3.5.0 http://localhost:4567 2023-11-09T02:02:11.964Z [4567/16723] - verbose: * using mongo store at 127.0.0.1:27017 2023-11-09T02:02:11.965Z [4567/16723] - verbose: * using themes stored in: /home/nodebb/nodebb/node_modules 2023-11-09T02:02:12.054Z [4568/16724] - error: Error: redis-required-for-pubsub at get (/home/nodebb/nodebb/src/pubsub.js:51:9) at Object.on (/home/nodebb/nodebb/src/pubsub.js:63:3) at module.exports (/home/nodebb/nodebb/src/cache/lru.js:105:9) at module.exports.create (/home/nodebb/nodebb/src/database/cache.js:5:9) at module.exports (/home/nodebb/nodebb/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/nodebb/nodebb/src/database/mongo.js:187:24) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) 2023-11-09T02:02:12.056Z [4567/16723] - error: Error: redis-required-for-pubsub at get (/home/nodebb/nodebb/src/pubsub.js:51:9) at Object.on (/home/nodebb/nodebb/src/pubsub.js:63:3) at module.exports (/home/nodebb/nodebb/src/cache/lru.js:105:9) at module.exports.create (/home/nodebb/nodebb/src/database/cache.js:5:9) at module.exports (/home/nodebb/nodebb/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/nodebb/nodebb/src/database/mongo.js:187:24) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) [cluster] Child Process (16724) has exited (code: 0, signal: null) [cluster] Child Process (16723) has exited (code: 0, signal: null) nodebb@localhost:~/nodebb$
Oh, I think I know why. I totally missed the "Configuring Redis if multiple processes was used". I subconsciously thought that Redis section was related to the Database type to be used like TigerEngine.
My bad
-