Skip to content
  • How can I migrate from redis to postgresql/mongodb

    Unsolved Technical Support
    12
    0 Votes
    12 Posts
    3k Views
    J
    @JaredBusch said in How can I migrate from redis to postgresql/mongodb: Found a pull request for nodebb-plugin-import that gives it postgresql capability. Well, it seem that I cannot install v1.12.1 as required by this plugin. npm never successfully builds. [jbusch@obelisk nodebb]$ sudo -u nodebb ./nodebb setup package.json not found. Populating package.json... OK Dependencies outdated or not yet installed. Installing them now... npm notice npm notice New minor version of npm available! 8.3.1 -> 8.12.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.12.2 npm notice Run npm install -g [email protected] to update! npm notice npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/pg npm ERR! pg@"^7.4.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer pg@"^8" from [email protected] npm ERR! node_modules/pg-cursor npm ERR! pg-cursor@"^2.0.0" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /home/nodebb/.npm/eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! /home/nodebb/.npm/_logs/2022-06-18T01_31_52_584Z-debug-0.log Error installing dependencies! message: Command failed: npm install --production stdout: null stderr: null /opt/nodebb/src/cli/package-install.js:54 throw e; ^ Error: Command failed: npm install --production at checkExecSyncError (node:child_process:828:11) at Object.execSync (node:child_process:902:15) at Object.installAll (/opt/nodebb/src/cli/package-install.js:45:9) at Object.<anonymous> (/opt/nodebb/src/cli/index.js:60:18) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) { status: 1, signal: null, output: [ null, null, null ], pid: 1461, stdout: null, stderr: null } [jbusch@obelisk nodebb]$ Built just fine to v2.2.0 though. [jbusch@obelisk nodebb]$ sudo -u nodebb ./nodebb setup Dependencies outdated or not yet installed. Installing them now... npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10. npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0 npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1 added 922 packages, and audited 923 packages in 2m 76 packages are looking for funding run `npm fund` for details 5 high severity vulnerabilities Some issues need review, and may require choosing a different dependency. Run `npm audit` for details. OK 2022-06-18T01:40:58.599Z [1600] - info: NodeBB Setup Triggered via Command Line Welcome to NodeBB v2.2.0! This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed. Press enter to accept the default setting (shown in brackets). [image: 1655517237358-7d8a5a66-30f5-4d65-a5ec-ac395ecd0178-image.png]
  • How can I change Redis configuration directory?

    Solved Technical Support
    7
    +0
    0 Votes
    7 Posts
    3k Views
    Daniel Mendoza PupoD
    @julian I tried that route, and it still didn't work: -rw-r--r--. 1 redis redis 63122 Mar 6 13:56 /path/to/redis/redis.conf redis.service: (changed the path to my redis.conf) ExecStart=/usr/bin/redis-server /path/to/redis/redis.conf --supervised systems After changing the redis service file: systemctl daemon-reload systemctl start/restart redis ● redis.service - Redis persistent key-value database Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/redis.service.d └─limit.conf Active: failed (Result: exit-code) since Thu 2024-03-07 16:18:06 EST; 7s ago Process: 3672598 ExecStop=/usr/libexec/redis-shutdown (code=exited, status=0/SUCCESS) Process: 3672869 ExecStart=/usr/bin/redis-server /path/to/redis/redis.conf --supervised systemd (code=exited, status=1/FAILURE) Main PID: 3672869 (code=exited, status=1/FAILURE) Mar 07 16:18:06 my-lab systemd[1]: Starting Redis persistent key-value database... Mar 07 16:18:06 my-lab redis-server[3672869]: 3672869:C 07 Mar 2024 16:18:06.355 # Fatal error, can't open config file '/path/to/redis/redis.conf' Mar 07 16:18:06 my-lab systemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE Mar 07 16:18:06 my-lab systemd[1]: redis.service: Failed with result 'exit-code'. Mar 07 16:18:06 my-lab systemd[1]: Failed to start Redis persistent key-value database.
  • Using redis as a cache

    Feature Requests
    2
    0 Votes
    2 Posts
    880 Views
    barisB
    In your setup redis will be used for sessions, pubsub and socket.io will use it to pass around messages. Each nodejs process has it's own post cache, you can see the caches at /admin/advanced/cache. Redis pubsub is also used to clear cache on the other nodejs process when it is cleared on one nodejs process. For example when a post is edited it's cache will be cleared on the other nodes.
  • It is a big problem with Redis

    Technical Support
    10
    0 Votes
    10 Posts
    4k Views
    S
    @julian thanks, but all properties on any VPS "permission denied on key": $ cat /proc/sys/vm/swappiness 60 $ sudo sysctl vm.swappiness=10 sysctl: permission denied on key 'vm.swappiness' And with the memory seems to be all right: [image: UgXx3Gg.png]
  • Cannot restore database

    Unsolved Technical Support
    6
    0 Votes
    6 Posts
    3k Views
    julianJ
    Unfortunately we cannot debug docker installs as that is a community contributed installation guide. Perhaps someone else here can help you out (e.g. @Ben-Lubar ?)
  • NodeBB on docker

    Technical Support
    3
    0 Votes
    3 Posts
    6k Views
    F
    @a_5mith Yes I have already checked it. I have found a docker image created by @nopz, this one is up-to-date. But the official docker image in not! Maybe you (nodebb) should give access to a dockerfile to allow anyone to build a nodebb docker image. EDIT I found the dockerfile, and the problem about this outdated version here. It's outdated because the dockerfile build the image with the v0.5.x version : FROM centos:centos7 MAINTAINER NodeBB Docker Team <[email protected]> # install main packages: RUN yum -y update ; yum clean all RUN yum -y install epel-release tar ; yum clean all RUN yum -y install wget ; yum clean all RUN yum -y groupinstall "Development Tools" RUN yum -y install nodejs git ImageMagick npm RUN yum -y install openssl openssl-devel # clone nodebb and install it RUN cd /opt ; git clone -b v0.5.x https://github.com/NodeBB/NodeBB nodebb RUN cd /opt/nodebb ; npm install # Create a nodebb volume VOLUME /opt/nodebb # Define a working directory WORKDIR /opt/nodebb # Expose ports EXPOSE 80 EXPOSE 443 EXPOSE 4567 CMD [ "node", "app.js" ] You should (NodeBB) update this dockerfile ! End of the EDIT Now, with the nopz/nodebb image I just had a problem about plugin persistence. But the first installation is so much easier and automatic with just one docker. Thanks for your answer by the way
  • 1 Votes
    8 Posts
    17k Views
    BzllB
    @Absam-Sibsam you saved me bro, worked perfectly!
  • 0 Votes
    72 Posts
    39k Views
    Charly86C
    I had back this problem a 2nd time 2 days ago, I don't know if it's related but I was doing iptables FW settings on the VM, I had nodeBB running, and also redis and from my computer desktop redis desktop manager connected to DB. Then I made a mistake in iptables, blocked all redis port (even local), saying nodebb unable to connect to redis (so as redis desktop manager) then when I openned back 6379 port, all data was gone, not sure if it's related, just an information.
  • 3 Votes
    1 Posts
    2k Views
    eva2000E
    @psychobunny @julian been a while since I played with NodeBB. But now that my Centmin Mod LEMP .08 stable release is out, I decided to play with NodeBB v0.7.2 + Centmin Mod Nginx server setup Posted a full how to install guide at https://community.centminmod.com/threads/centmin-mod-nginx-nodebb-forum-install.4009/ Only issue I have right now is forever restart or ./nodebb restart commands don't seem to work ? Stop and start work fine. Comments and suggestions are welcome
  • Redis Desktop Manager

    General Discussion
    2
    0 Votes
    2 Posts
    2k Views
    codejetC
    found this couple weeks ago, magic
  • Minimongo instead of redis

    NodeBB Plugins
    1
    0 Votes
    1 Posts
    2k Views
    J
    Anyone know if Minimongo could be used in a plugin to enable redis-style caching to a full mongodb instance? The redis (live) to mongodb (persist) route looks daunting... JB
  • 0 Votes
    3 Posts
    2k Views
    Andrea CardinaleA
    @baris Yes, this is on latest. if I configure only mongo, it's works
  • Problem With Database

    Technical Support
    2
    0 Votes
    2 Posts
    2k Views
    Master-AntonioM
    Update 16: 18 : I removed nodebb-plugin-poll and Seems to me that returned all right. @Schamper For me is this.
  • 1 Votes
    18 Posts
    14k Views
    J
    @julian said in Mongo vs Redis: which one is better for a huge community?: 64GB -- that is a lot of memory We host larger databases on much less RAM (as we're using a cloud provider and high memory installs are crazy expensive)... There is definitely a speed difference though. Navigating between pages on here takes a split second longer than a Redis database... if you want to see NodeBB fly, use Redis. @scottalanmiller was replying to somebody talking about a 50 GB data community though.
  • 0 Votes
    1 Posts
    1k Views
    A
    Hi, Have NodeBB used "optimistic concurrency locking"? I think in NodeBB there is 'UPVOTE' concept, While upvoting there has to be 'Optimistic concurrency locking', So it can handle multiple database insert operation at a time while upvoting single post by multiple users. Please let me know where do I find the code for 'Optimistic Concurrency locking', and guide me how to handle multiple insert operation at a time in redis database. Thanks!!
  • Add PHP API

    NodeBB Development
    32
    0 Votes
    32 Posts
    20k Views
    S
    <?php class nodebb { function category_add ($params='name=Default category name', $token='e9de6fb6-1234-5678-8bbc-b5073fd1edef'){ shell_exec('/usr/bin/curl -H "Authorization: Bearer '.$token.'" --data "'.$params.'" http://localhost:4567/forum/api/v1/categories'); } } $nodebb = new nodebb; $nodebb->category_add(); return false; Now it's much easier
  • Keeping the stack alive

    General Discussion
    2
    0 Votes
    2 Posts
    2k Views
    L
    Well.. For the nodebb application himself you could use "forever" .... but when it turned 5x i stopped using forever (@julian posted somewhere that nodebb application can do the forever job himself) for the database.. well.. dont monitor it YET cz the volume of my transactions is low... But any service monitor application could do it.. like nagios ...or newrelic
  • Redis & NodeBB

    General Discussion
    2
    0 Votes
    2 Posts
    3k Views
    barisB
    Here are the stats for this forum. 3848 users 3628 topics 28458 posts 139.12M redis memory usage This includes the session store as well.
  • Editing Redis database (User avatar paths)

    General Discussion
    2
    0 Votes
    2 Posts
    2k Views
    barisB
    You need to write a server side script to go through all the users and update their urls. Something like the following should work. var db = require('./database'), user = require('./user'), async = require('async'); db.getSortedSetRange('users:joindate', 0, -1, function(err, uids) { async.eachLimit(uids, 50, updateUserImage, function(err) { console.log('done'); }); }); function updateUserImage(uid, next) { user.getUserFields(uid, ['image', 'gravatarpicture', 'uploadedpicture'], function(err, userData) { // do your update here, can check current data from userData user.setUserField(uid, 'gravatarpicture', 'some_new_url', next); }); }
  • nodebb setup redis npm warn

    General Discussion
    3
    1 Votes
    3 Posts
    3k Views
    P
    @Hưng-Thành-Nguyễn Will ignore. Thank you for confirming!