• Community Rep

    @dunlix Well, I do not use Ubuntu for long while now so cannot comment there. Mongodb Debian pkgs default to /var/lib/mongodb. The contents of wh/should look something akin to this:

    [email protected]:~# ll /var/lib/mongodb/
    total 421696
    drwxr-xr-x  4 mongodb mongodb      4096 Nov 16 00:26 .
    drwxr-xr-x 32 root    root         4096 Apr 12  2021 ..
    -rw-------  1 mongodb mongodb        47 Apr 11  2021 WiredTiger
    -rw-------  1 mongodb mongodb        21 Apr 11  2021 WiredTiger.lock
    -rw-------  1 mongodb mongodb      1455 Nov 16 00:26 WiredTiger.turtle
    -rw-------  1 mongodb mongodb    241664 Nov 16 00:26 WiredTiger.wt
    -rw-------  1 mongodb mongodb     36864 Nov 16 00:26 WiredTigerHS.wt
    -rw-------  1 mongodb mongodb     36864 Nov  3 01:53 _mdb_catalog.wt
    -rw-------  1 mongodb mongodb     36864 Nov  3 01:53 collection-0--6779710148686833028.wt
    -rw-------  1 mongodb mongodb      4096 Nov  3 01:52 collection-0--8716107555814307976.wt
    -rw-------  1 mongodb mongodb 114978816 Nov  3 01:51 collection-0-7297207552526326231.wt
    -rw-------  1 mongodb mongodb 223993856 Nov 16 00:26 collection-10--6779710148686833028.wt
    -rw-------  1 mongodb mongodb     36864 Nov  3 01:52 collection-11--6779710148686833028.wt
    -rw-------  1 mongodb mongodb     32768 Nov  3 01:52 collection-13--6779710148686833028.wt
    -rw-------  1 mongodb mongodb     32768 Nov  3 01:52 collection-15--6779710148686833028.wt
    -rw-------  1 mongodb mongodb     12288 Nov  3 01:52 collection-17--6779710148686833028.wt
    
    

    The db location is configured in /etc/mongod.conf:

    [email protected]:~# grep -i db /etc/mongod.conf 
    #   http://docs.mongodb.org/manual/reference/configuration-options/
      dbPath: /var/lib/mongodb
    
    

    I would expect Ubuntu to be same. Use systemctl to stop and start mongodb service. Check the mongo server via systemctl status.

    [email protected]:~# systemctl status mongod
    ● mongod.service - MongoDB Database Server
       Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
       Active: active (running) since Wed 2021-11-03 01:51:58 UTC; 1 weeks 5 days ago
         Docs: https://docs.mongodb.org/manual
     Main PID: 573 (mongod)
       Memory: 208.2M
       CGroup: /system.slice/mongod.service
               └─573 /usr/bin/mongod --config /etc/mongod.conf
    

    If running and all reports back dandy confirm it is listening on port 27017:

    [email protected]:~# netstat -na | grep 27017
    tcp        0      0 192.168.128.121:27017   0.0.0.0:*               LISTEN     
    tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN     
    tcp        0      0 192.168.128.121:38624   192.168.128.121:27017   ESTABLISHED
    tcp        0      0 192.168.128.121:37938   192.168.128.122:27017   ESTABLISHED
    tcp        0      0 192.168.128.121:27017   192.168.128.122:56238   ESTABLISHED
    tcp        0      0 192.168.128.121:33606   192.168.128.123:27017   ESTABLISHED
    
    

    But I got a feelin' that yours is not and only listening via unix socket. So please check mongo's "Net" settings in /etc/mongod.conf:

    # network interfaces
    net:
      port: 27017
      bindIp: 127.0.0.1
    

    NodeBB should now be able to talk to MongoDB. Start it from CLI with logging.

  • GNU/Linux Admin

    @dunlix I believe /data/db is just the default placeholder, so that is why it is trying to access it. You've executed mongod on its own with no flags, so it assumes the default config options, since it doesn't know where to locate the config file at /etc/mongod.conf 😄

    That said, on Ubuntu the logs are kept at /var/log/mongodb/mongodb.log

    Can you tail -F /var/log/mongodb/mongodb.log and then in another terminal sudo systemctl start mongodb?

  • Community Rep

    @dunlix said in Mongodb not working:

    I looked around and realized that it wasn’t loading the confit file or something,

    Hmmm..... I wonder... Reaching here but perchance might your mongod.conf file have become corrupted in some manner? You said all you did was a system upgrade and that should not have touched mongod.conf on a running system. But one never knows....

    Also, along related note, mongod.conf is ASCII text only. No UTF-8. So if your text editor somehow slipped a little utf-8 in there during some edit, but you did not reboot until the update, and then/now mongod can no longer read/load mongod.conf? Maybe, just maybe?

    But mainly in the main, need to confirm mongod is indeed listening on localhost port 27017.

  • GNU/Linux Gamers

    @gotwf said in Mongodb not working:

    But mainly in the main, need to confirm mongod is indeed listening on localhost port 27017.

    Yes it is cause when I start it the right way I only specify the dbpath and NodeBB can connect right away.

  • GNU/Linux Admin

    @dunlix logs logs logs from /var/log/mongodb/mongodb.log please...

    I'm assuming you installed mongo via mongodb-org from their apt repos. Not sure what mongo is like if you install it manually, etc.

  • GNU/Linux Gamers

    @julian I did use apt I’ll get the logs later today

  • GNU/Linux Admin

    @dunlix Thanks 😄 I think the clues may be there.

  • Community Rep

    @dunlix It would be beneficial to confirm APT-Sources, e.g.;

    APT-Sources: http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4/main amd64 Packages
    Description: MongoDB shell client
    

    Note the repo.mongodb.org bit above. Preferential to use mongo built pkgs if available. And they should be for Ubuntu. But maybe not set as default? So just confirm this bit for me whilst at it, eh?


  • @julian wouldnt be easier for nodeBB to just switch from this shitty DB engine to something more " modern "?

  • GNU/Linux Admin


  • Community Rep

    @macfan said in Mongodb not working:

    @julian wouldnt be easier for nodeBB to just switch from this shitty DB engine to something more " modern "?

    Hmm.... 🤔

    1. What would you propose?

    2. Got code?

  • Global Moderator Plugin & Theme Dev

    NodeBB supports postgresql.

  • Community Rep

    @pitaj said in Mongodb not working:

    NodeBB supports postgresql.

    And, despite the above saga, Mongo itself was pretty groovy until someone got the bright idea to relicense it under SSPL. This has not affected me so much but seems to have hit a sore spot with various package managers.


  • @gotwf said in Mongodb not working:

    Hmm.... 🤔

    1. What would you propose?
    2. Got code?
    1. Something SQL maybe? Like mysql? I would touch nothing thats licensed on SSPL
    2. What kind of code?
  • Community Rep

    @macfan said in Mongodb not working:

    @gotwf said in Mongodb not working:

    Hmm.... 🤔

    1. What would you propose?
    2. Got code?
    1. Something SQL maybe? Like mysql? I would touch nothing thats licensed on SSPL

    As mentioned above, NodeBB supports PostgreSQL. A far superior RDBMS to MySQL, imho, btw.

    1. What kind of code?

    Code requisite for "porting" nodebb db backend to whatever your dream data store may be. 🙂

    I, too, am none too keen on SSPL. While I am sensitive to both sides of this issue, in reality the SSPL affects me personally minimally. Meanwhile, MongoDB does a kick ass job. Hence I am electing an "If it ain't broke, don't fix it" posture.

    That said, next NodeBB deployment will likely take a closer look at PostgreSQL.


Suggested Topics

  • 9
  • 2
  • 5
  • 3
  • 7
| |