zoukankan      html  css  js  c++  java
  • centos7 install mongodb

    $vi /etc/yum.repos.d/mongodb-org-3.0.repo

    [mongodb-org-3.0]
    name=MongoDB Repository
    baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
    gpgcheck=0
    enabled=1

    $安装mongodb

    yum install -y mongodb-org

    配置文件在:/etc/mongod.conf  数据文件在:/var/lib/mongo  日志文件在:/var/log/mongodb 

    mongodb服务使用

    #启动
    service mongod start
    #停止
    service mongod stop
    #重启
    service mongod restart
    #增加开机启动
    chkconfig mongod on


    [root@localhost ysy]# service mongod start
    Starting mongod (via systemctl): Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.
    [失败]
    [root@localhost ysy]#

    [root@localhost ysy]# systemctl status mongod.service
    mongod.service - SYSV: Mongo is a scalable, document-oriented database.
    Loaded: loaded (/etc/rc.d/init.d/mongod)
    Active: failed (Result: exit-code) since 二 2015-12-08 14:15:39 CST; 39s ago
    Process: 26948 ExecStart=/etc/rc.d/init.d/mongod start (code=exited, status=1/FAILURE)

    12月 08 14:15:39 localhost.localdomain systemd[1]: Starting SYSV: Mongo is a scalable, document-orien......
    12月 08 14:15:39 localhost.localdomain runuser[26954]: pam_unix(runuser:session): session opened for ...=0)
    12月 08 14:15:39 localhost.localdomain mongod[26948]: Starting mongod: [失败]
    12月 08 14:15:39 localhost.localdomain systemd[1]: mongod.service: control process exited, code=exite...s=1
    12月 08 14:15:39 localhost.localdomain systemd[1]: Failed to start SYSV: Mongo is a scalable, documen...e..
    12月 08 14:15:39 localhost.localdomain systemd[1]: Unit mongod.service entered failed state.
    Hint: Some lines were ellipsized, use -l to show in full.
    [root@localhost ysy]#

  • 相关阅读:
    .net开发环境的选择
    html头部的一些信息
    SQLHelper类
    C#实现文件下载
    js类
    Winform小知识点
    emacs 代码缩进
    自己喜欢的shell终端配置
    time_wait过多的优化
    Emacs 电子邮件组件RMAIL
  • 原文地址:https://www.cnblogs.com/yshyee/p/5029025.html
Copyright © 2011-2022 走看看