MongoDB installation, configuration, startup and related operations

Source: Internet
Author: User
Tags mongodb

About MongoDB:

??? MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bjson format, so you can store more complex data types. MONGO's biggest feature is that the query language he supports is very powerful, and its syntax is a bit like an object-oriented query language that almost implements most of the functionality of a relational database single-table query, and also supports indexing of data.

? In this experiment we will install the mongodb3.6.6 database and a series of operations

1. Install: Configure the Yum source repository

???????????????????????????????

????????????????????????????? Add the following content:

?????????? [Mongodb-org]
??????????? Name=mongodb Repository
??????????? baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
??????????? Gpgcheck=1
??????????? Enabled=1
??????????? Gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

????????????????????????????????

????????????????????????????????

?????????????????????????? Next Install:

??????????????????????????????????? ???

???????????????????????????? Configure the configuration file:??

??????????????????????????????????

???????????????????????????????? ? #修改监听地址和监听端口

???????? Start the service:

??????????????????????????????????

????????????????????????????? Enter MongoDB:

?????????????????????????????????????

???????????????????????????? To view the database:

???????????????????????????????????????

??????????????????????????? Insert data into the collection:

??????????????????????????????????????

?????????????????????????????? To view the contents of the collection:

??????????????????????????????????????

?????????????????????????????? To modify the data in the collection:

??????????????????????????????????????

??????????????????????????????? Insert 100 Data:

?????????????????????????????????????

????????? View data:

???????????????????????????????????????

?????????? Find the 10th data:

?????????????????????????????????????????????

? 2. Import and Export: Export the collection in database school info:

??????????????????????????????????????????

??????????????????????????????????? Import into the database:

????????????????????????????????????????????

???????????????????????????????????????????? #可以看出, Info1 is already in school.

3. Backup and Recovery:

???????????????????????????????????????????????

4. Clone collection:?

????????????????????????? Create a data file and log file storage location:

??????????????????????????????????????????

?????????????????????????? To modify a configuration file:?????

????????????????????????????????????????????

??????????????????????????????????????????? ??????????????????????????????????????????????

????????????????????????????????????????????

????????????????????????? Launch the instance and enter the port:

??????????????????????????????????????????

???????????????????????????? Clone collection:

????????????????????????????????????????

?????????????????????????? Copy database:

?????????????????????????????????????????

MongoDB installation, configuration, startup and related operations

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.