Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration of mongodb

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Concept

MongoDB is a database based on distributed file storage. Written in C++ language. Designed to provide scalable high-performance data storage solutions for WEB applications.

MongoDB is a product between relational database and non-relational database, which is the most functional and most like relational database in non-relational database. It supports a very loose data structure, which is similar to json's bson format, so it can store more complex data types. The most important feature of Mongo is that the query language it supports is very powerful, and its syntax is somewhat similar to the object-oriented query language. It can almost achieve most of the functions similar to the single table query of relational database, and also supports the establishment of data indexing.

* for collection storage, it is easy to store data of object type.

* Mode freedom.

* dynamic query is supported.

* full indexing is supported, including internal objects.

* query is supported.

* replication and failure recovery are supported.

* use efficient binary data storage, including large objects such as video, etc.

* automatically handle fragments to support scalability at the cloud computing level.

* Golang,RUBY,PYTHON,JAVA,C++,PHP,C# and other languages are supported.

* the file format is BSON (an extension of JSON).

* accessible through the network.

First, the installation environment CentOS Linux release 7.2.1511

Installation package: mongodb-linux-x86_64-4.0.4.tgz

Install tar xf mongodb-linux-x86_64-4.0.4.tgz & & cd mongodb-linux-x86_64-4.0.4mkdir-p / data/ {db,logs} mkdir etc/ & & cd etc/ & & touch mongodb.conf

Mongodb.conf configuration Information

Port=27017 # Port dbpath= / data/db # data inventory file storage directory logpath= / data/logs/mongodb.log # Log file storage path logappend=true # write log fork=true # run as daemon, create server process maxConns=100 # maximum number of simultaneous connections # noauth=false # do not enable authentication auth=true # enable verification journal=true # each write records an operation log (the written data can be reconstructed through journal) # even if there is a downtime, wiredtiger will restore the data to the most recent checkpoint point at startup, and then replay the subsequent journal logs to recover. StorageEngine=wiredTiger # storage engine has mmapv1, wiretiger, mongorocksbind_ip = 0.0.0.0 # so that it can be accessed externally. For example, disconnect MongoDB 3 from win10, start authentication 1, start mongo./bin/mongod-f etc/mongodb.conf2, log in to mongo./bin/mongoMongoDB shell version v4.0.4connecting to: mongodb://127.0.0.1:27017Implicit session: session {"id": UUID ("9daa9293-d882-44ec-ac41-2f49143b0ad9")} MongoDB server version: 4.0.4 > 3, close mongo./bin/mongod-- shutdown-f etc/mongodb.conf 4, Environment variable configuration vim / etc/profile

Add a new line

PATH=$ {PATH}: / root/mongodb-linux-x86_64-4.0.4/binsource / etc/profile # to make the configuration effective

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report