Trying to make nodebb working with Redis or MongoDB
-
Hello guys,
I'm sick because of trying to run stable nodebb instance with Redis or MongoDB.
I'm running newest version of nodebb (right now it's current master, previously was latest official version), newest Redis and previously newest MongoDB.- First problem - nodebb is not supporting secured connections to MongoDB (connection with ssl=true)
a) I was trying to fix it by modyfing connection string
"var connString = 'mongodb://' + usernamePassword + servers.join() + '/' + nconf.get('mongo:database') + '?ssl=true';"
This trick allows me to connect with mongodb (run setup) but didnt finish installation, only about 50% of initialize data goes to mongodb and nodebb won't start.
- After few days of fight I have moved to Redis.
a) My nodebb instance successfully complete initialization on redis and working fine... for about 10min ... after that time I'm not able to refresh the site. After about 30min I'm getting an error
"23/9 07:56 [1424] - error: Error: Redis connection to xxxxxxx:xxxx failed - read ETIMEDOUT
"
b ) I was trying to ping redis on every connection every 4min
" setInterval(function() {
cxn.ping();
winston.info('Redis Ping');
}, 1000 * 60 * 4);"
c) Redis stills timeout, so I have added retry strategy:
" options.retry_strategy = function (options) {
if (options.error.code === 'ECONNREFUSED') {
// End reconnecting on a specific error and flush all commands with a individual error
winston.error('Redis: The server refused the connection');
}
if (options.total_retry_time > 1000 * 60 * 60) {
// End reconnecting after a specific timeout and flush all commands with a individual error
winston.error('Redis: Retry time exhausted');
}
if (options.times_connected > 10) {
// End reconnecting with built in error
return undefined;
}
// reconnect after
winston.error('Redis: Reconnecting');
winston.error(options.error.code);
return Math.max(options.attempt * 100, 3000);
};"
d) still nothing... ofc. I have double checked that redis configuration is OK and every possible timeout options are disabled.
Any ideas how can I prevent timeouts or debug it deeper ?
example log:
https://gist.github.com/anonymous/b62a40ef21059cd68dfb6712fe4b7912 - First problem - nodebb is not supporting secured connections to MongoDB (connection with ssl=true)
-
Hello again,
this issue is related to server/redis, NOT nodebb itself.
I have created dedicated Redis (3.0) cluster via Azure portal and seems to working fine from the 1hour.
I need to add rest of the plugins and check if they are not cause any issue but seems that problem was with the server/newest redis
Copyright © 2024 NodeBB | Contributors