themattman / mongodb-raspberrypi-binaries

Unofficial MongoDB Community Edition Binaries for Raspberry Pi
Other
108 stars 10 forks source link

Mongod Service (DietPi) [v7.0.5] #8

Closed RC-Projects closed 5 months ago

RC-Projects commented 5 months ago

I am not sure if this is an issue with v7.0.5, however I previously had v7.0.4 with a working mongod.service.

I had something along the lines of this:

[Unit]
Description=MongoDB Database Server
Documentation=https://docs.mongodb.org/manual
After=network-online.target
Wants=network-online.target

[Service]
User=mongod
Group=mongod
Environment="OPTIONS=-f /etc/mongod.conf"
Environment="MONGODB_CONFIG_OVERRIDE_NOFORK=1"
EnvironmentFile=-/etc/sysconfig/mongod
ExecStart=/usr/bin/mongod $OPTIONS
RuntimeDirectory=mongodb
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
# Recommended limits for mongod as specified in
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings

[Install]
WantedBy=multi-user.target

However, after tinkering around with this for a few hours, I keep getting a timeout error with nothing substantial in the logs. I have also tried iterations using the same /data directory in the README file with no luck.

Any ideas of what I am missing here? Have you had any luck creating a service file?

RC-Projects commented 5 months ago

I have also noticed that my mongod.conf file is empty with this latest install, i'm wondering if that is related? Currently, Mongod is running from the command you provided in the README file: mongod --dbpath /data/myPath --fork --logpath /data/myPath/mongod.log --port somePort

RC-Projects commented 5 months ago

It was due to the empty config file 🤦🏻 Closing!