MongoDB 4.0 Version

Source: Internet
Author: User
Tags install openssl mongodb

About MongoDB
    • is a cross-platform, document-oriented database. The real performance, high availability, and ease of scalability can be achieved. is an open source database system based on distributed file storage, which adds more nodes under high load.
    • MongoDB is also a kind of product between relational database and non-relational database, the most abundant function in non-relational data database, like relational database.
      MongoDB Features
      -Easy to install, provides document-oriented storage, free mode
      Rich query statements and multi-level indexes, replication mechanism, easy to scale horizontally, can be inserted into the storage engine. Cross-platform multi-lingual support • Multiple languages such as Ruby, Python, Java, C + + PHP C #, and more.
Areas of Use
MongoDB可以为Web应用提供可扩展的高性能数据存储解决方案。MongoDB主要适用领域有网站数据、分布式场景、数据缓存和JSON文件格式存储。适用大数据量、高并发、若事务的互联网应用,其内置的水平扩展机制提供了从几百万到十亿级别的数据处理能力,可以很好地满足Web2.0和移动互联网应用数据存储的要求。
Deployment Installation
1. [官网](https://www.mongodb.com/download-center?jmp=nav#community)2. 安装支持的软件包yum -y install openssl-devel libcurl3. 解压缩mongdb软件包tar zxvf mongodb-linux-x86_64-rhel70-4.0.0.tgz -C /opt4. 重命名并移动目录至/usr/local/目录下mv /opt/mongodb-linux-x86_64-rhel70-4.0.0 /usr/local/mongodb5. 创建mongodb的数据存储目录、日志存储目录及日志文件mkdir -p /data/mongodb1mkdir -p /data/logs/mongodbtouch /data/logs/mongodb/mongodb1.logchmod -R 777 /data/logs/mongodb/mongodb1.log6. 调整shell 启动资源ulimit -n 25000    #同一时刻最多开启文件数ulimit -u 25000     #同一时刻最多开启程序数7. 创建配置文件(启动脚本)vim /usr/local/mongodb/bin/mongodb1.confpot=27017    #默认端口dbpath=/data/mongodb1 # 数据存放目录logpath=/data/logs/mongodb/mongodb1.log #日志文件logappend=true  #使用追加方式写日志fork=true       #后台运行maxConns=5000   #最大同时链接数默认2000storageEngine=mmapv1 #指定存储引擎为内存映射文件

Set kernel parameters (the system allocates memory from other nodes when there is not enough memory available for a node)

echo 0 > /proc/sys/vm/zone_reclaim_modesysctl -w vm.zone_reclaim_mode=0echo never > /sys/kernel/mm/transparent_hugepage/enabledecho never > /sys/kernel/mm/transparent_hugepage/defrag

MongoDB's executable file is located in the bin directory, so you can add it to your path path:

vim /etc/profile#在文件末尾追加以下语句export PATH=/usr/local/mongodb/bin:$PATH重新加载环境变量source /etc/profile设置mongodb开机自启动vim /etc/rc.local#在文件末尾追加以下语句rm -rf /data/mongodb1/mongodb.lock/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/bin/mongodb1.conf #启动

MongoDB 4.0 Version

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.