Mongodb安装

 

1. 下载Mongodb

  下载地址: https://www.mongodb.com/download-center/community

 

 

    2.  安装单机版mongodb

       1) 解压缩

           tar -xvf mongodb-linux-x86_64-rhel70-4.2.2.tgz 

       2)加入环境变量

            vim /etc/profile

            export PATH=$PATH:/root/software/mongodb-server-4.2.2/bin

       3)  启动mongodb

           mongod --dbpath /root/software/mongodb-server-4.2.2/db --port 27017 --logpath /root/software/mongodb-server-4.2.2/logs/mongod.log --fork -bind_ip 0.0.0.0

       

       4)  配置文件启动方式

           mongod  -f  ../conf/mongod.conf

           vim mongod.conf 如下:

             systemLog:

                destination: file
               path: "/root/software/mongodb-server-4.2.2/logs/mongod.log"
              logAppend: true
           storage:
              dbPath: "/root/software/mongodb-server-4.2.2/db"
             journal:
                enabled: true
            processManagement:
                fork: true
          net:
              bindIp: 0.0.0.0
             port: 27017
#setParameter:
# enableLocalhostAuthBypass: false

         配置文件参见: https://docs.mongodb.com/manual/reference/configuration-options/

  

     3. cloud 托管 mongodb 公有云服务 

           可以用邮箱免费创建mongodb集群

posted on 2020-01-08 23:48  银河星爆-邪恶黑撒  阅读(60)  评论(0)    收藏  举报

导航