About MongoDB
MongoDB (from the English word "humongous", the Chinese meaning "huge") is an open-source database that can be applied to businesses of all sizes, industries and applications. As a database for agile development, MongoDB's data schema can be updated flexibly as the application progresses. At the same time, it also provides developers with the functionality of traditional databases: two-level indexes, a complete query system, and strict consistency, among other things.
MongoDB enables businesses to be more agile and scalable, and businesses of all sizes can use MongoDB to create new applications, increase productivity with their customers, accelerate time-to-market, and reduce enterprise costs.
MongoDB is a database designed for scalability, high performance, and high availability. It can scale from a single-server deployment to a large, complex, multi-datacenter architecture. With the advantage of memory computing, MONGODB can provide high-performance data read and write operations. MongoDB's local replication and automatic failover capabilities give your application enterprise-class reliability and operational flexibility.
The installation of MongoDB
MongoDB provides the installation package on the Linux platform, which can be downloaded from the official website. This experiment installs the latest version of MongoDB 4.0.0 on CentOS 7, the package used is: mongodb-linux-x86_64-rhel70-4.0.0.tgz
1. Unpack the Package
tar xzvf mongodb-linux-x86_64-rhel70-4.0.0.tgz -C /opt/
2. After the extracted directory moved to/usr/local/under Rename to MongoDB
cd /opt/mv mongodb-linux-x86_64-rhel70-4.0.0/ /usr/local/mongodb
3. Create data store directory and log file directory
mkdir -p /usr/local/mongodb/data/dbmkdir -p /usr/local/mongodb/logs
4. Edit MongoDB Boot configuration file
cd /usr/local/mongodb/binvim mongodb.conf
dbpath = /usr/local/mongodb/data/db //数据存储目录logpath = /usr/local/mongodb/logs/mongodb.log //日志文件目录fork = true //后台运行auth=true bind_ip=0.0.0.0
5. The MongoDB executable file is located in the bin directory and needs to be added to the path path
vim /etc/profile
export MONGODB_HOME=/usr/local/mongodbexport PATH=$PATH:$MONGODB_HOME/bin //末尾处添加
source /etc/profile //重新加载环境变量
6. Start MongoDB
cd /usr/local/mongodb/binmongod -f mongodb.conf
7. Connect MongoDB and Access
/usr/local/mongodb/bin/mongo
Installing MongoDB database on CentOS 7 4.0.0 latest Version