• 树莓派 mongodb 安装&报错处理


    树莓派 mongodb 安装&报错处理

    编译过的源码下载地址: https://files.cnblogs.com/files/xueshanshan/mongodb-rpi.zip

    adduser –firstuid 100 –ingroup nogroup –shell /etc/false –disabled-password –gecos "" –no-create-home mongodb
    cp -R mongodb-rpi/mongo /opt
    chmod +x /opt/mongo/bin/*
    mkdir /var/log/mongodb
    chown mongodb:nogroup /var/log/mongodb
    mkdir /var/lib/mongodb
    chown mongodb:nogroup /var/lib/mongodb
    cp mongodb-rpi/debian/init.d /etc/init.d/mongod
    cp mongodb-rpi/debian/mongodb.conf /etc/
    ln -s /opt/mongo/bin/mongod /usr/bin/mongod
    chmod u+x /etc/init.d/mongod
    update-rc.d mongod defaults
    /etc/init.d/mongod start

     常用命令:

    启动
    sudo service mongodb start
    
    查看状态
    sudo service mongodb status
    
    停止
    sudo service mongodb stop

    报错以及解决办法:

    mongod.service - LSB: An object/document-oriented database
    Loaded: loaded (/etc/init.d/mongod)
    Active: active (exited) since 二 2017-07-18 19:17:07 CST; 1 day 21h ago
    Process: 444 ExecStart=/etc/init.d/mongod start (code=exited, status=0/SUCCESS)

    7月 18 19:17:05 raspberrypi systemd[1]: Starting LSB: An object/document-oriented database...
    7月 18 19:17:07 raspberrypi mongod[444]: Starting database: mongodb.
    7月 18 19:17:07 raspberrypi systemd[1]: Started LSB: An object/document-oriented database.
    7月 19 09:31:42 raspberrypi systemd[1]: Started LSB: An object/document-oriented database.
    7月 20 16:20:54 raspberrypi systemd[1]: Started LSB: An object/document-oriented database.

    7月 20 16:22:34 raspberrypi mongod[4625]: Starting database: mongodb failed!
    7月 20 16:22:34 raspberrypi systemd[1]: mongod.service: control process exited, code=exited
    7月 20 16:22:34 raspberrypi systemd[1]: Failed to start LSB: An object/document-oriented dat

    解决办法:

    cd /var/lib
    sudo rm -rf ./mongodb
    sudo mkdir mongodb
    sudo chown -R mongodb mongodb/
    sudo service mongod restart
  • 相关阅读:
    pugixml
    C++ 头文件的理解
    图像的特征
    光圈与景深
    Unix高级环境编程
    用libtommath实现RSA算法
    【linux+C】神器 vim + 指针相关客串
    【算法25】对称子字符串的最大长度
    设计并实现同时支持多种视频格式的流媒体点播系统
    递归再一次让哥震惊了
  • 原文地址:https://www.cnblogs.com/xueshanshan/p/7212034.html
Copyright © 2020-2023  润新知