zoukankan      html  css  js  c++  java
  • 利用阿里云的源yum方式安装Mongodb

    1)在/etc/yum.repos.d 创建一个mongodb-org.repo 源文件

    [root@qd-vpc-dev-op01 ~]$ cd /etc/yum.repos.d/
    [root@qd-vpc-dev-op01 yum.repos.d]$ touch mongodb-org.repo
    [root@qd-vpc-dev-op01 yum.repos.d]$ cat mongodb-org.repo
    [mongodb-org]
    name=MongoDB Repository
    baseurl=http://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/
    gpgcheck=0
    enabled=1
     
    2)清空缓存和更新yum源
    [root@qd-vpc-dev-op01 yum.repos.d]$ yum clean all
    [root@qd-vpc-dev-op01 yum.repos.d]$ yum make cache
    #更新yum源
    [root@qd-vpc-dev-op01 yum.repos.d]$ yum update
     
    3) 安装MongoDB
    [root@qd-vpc-dev-op01 yum.repos.d]$ yum install -y mongodb-org
     
    4)启动MongoDB
    [root@qd-vpc-dev-op01 yum.repos.d]$ service mongod start
    [root@qd-vpc-dev-op01 yum.repos.d]$ chkconfig mongod on
     
    5)配置远程访问
    [root@qd-vpc-dev-op01 yum.repos.d]$cat /etc/mongod.conf|grep -v "#"|grep -v "^$"
    systemLog:
      destination: file
      logAppend: true
      path: /var/log/mongodb/mongod.log
    storage:
      dbPath: /var/lib/mongo
      journal:
        enabled: true
    processManagement:
    net:
      port: 27017
     
    [root@qd-vpc-dev-op01 yum.repos.d]$ service mongod restart
    Restarting mongod (via systemctl):                         [  OK  ]
     
    6)打开MongoDB
    [root@qd-vpc-dev-op01 yum.repos.d]$ mongo 127.0.0.1:27017
    MongoDB shell version: 3.2.16
    connecting to: 127.0.0.1:27017/test
    Server has startup warnings: 
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] 
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] 
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] 
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 4096 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
    2017-09-30T18:27:19.681+0800 I CONTROL  [initandlisten] 
  • 相关阅读:
    git安装和简单配置
    IDEA调试服务器上部署的程序
    fastjson的@JSONField注解的一点问题
    Spring quartz定时任务service注入问题
    MySql 插入数据库报错 Incorrect string value: 'xF0xA0x86xA2'
    Window启动Zookeeper报错java.lang.NumberFormatException: For input string:
    wget命令下载文件
    遇见的面试题
    使用jackson来进行数组格式的json字符串转换成List。
    边距重叠的三种情况
  • 原文地址:https://www.cnblogs.com/nulige/p/7613696.html
Copyright © 2011-2022 走看看