MongoDB Service Will Not Start After Initial Setup

前端 未结 11 1747
夕颜
夕颜 2021-01-31 12:11

I am running Fedora 20 and installed MongoDB per the Red Hat installation guide on the official documentation. I was able to run the mongod daemon as a service with

11条回答
  •  失恋的感觉
    2021-01-31 12:33

    We need to create the temp dir location of pidfile /var/run/mongodb that's handled by systemd-tmpfiles. So, create a file /lib/tmpfiles.d/mongodb.conf as root:

    lnx#> sudo su
    lnx#> cd /lib/tmpfiles.d
    lnx#> echo “d /var/run/mongodb 0755 mongod mongod” > mongodb.conf

    Then reboot or run this command to activate that temp directory:

    lnx#>sudo systemd-tmpfiles --create mongodb.conf

    Start mongod service:

    lnx#> sudo systemctl start mongod.service

    Bibliography: Fedora And Mongodb · l33tsource

提交回复
热议问题