In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to deploy distributed database MongoDB under Linux. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
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. The data structure he supports is very loose, which is similar to json's bjson 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.
I. mongodb installation and configuration
1. Create a tools directory to store the installation package
Cd / usr/localmkdir-p toolscd tools
2. Download the mongodb package (other versions please download by yourself)
Wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-3.2.4.tgz
3. Extract and copy mongodb to directory / usr/local/mongodb
Tar-zxvf mongodb-linux-x86_64-rhel70-3.2.4.tgz cp-r mongodb-linux-x86_64-rhel70-3.2.4 / usr/local/mongodb
4. System profile configuration
Vi / etc/profile export MONGODB_HOME=/usr/local/mongodb export PATH=$PATH:$MONGODB_HOME/bin
Mongodb system configuration
After saving, restart the system configuration
Source / etc/profile
5. Mongodb startup configuration
Cd / usr/local/mongodb/bin mkdir datacd datamkdir dbcd.. mkdir logscd logstouch mongodb.logcd.. vi mongodb.conf dbpath = / usr/local/mongodb/data/db # data file storage directory logpath = / usr/local/mongodb/logs/mongodb.log # log file storage directory port = 27017 # port fork = true # enabled as a daemon, that is, running nohttpinterface = true in the background
If the startup configuration is saved and exited, the mongodb.conf file exists in the bin directory.
Img
Mongodb startup configuration
Mongodb.conf file content
Img
File content
II. Mongodb testing
1. Start the mongod database service
. / mongod-f mongodb.conf
2. Enter the mongodb database
. / Mongo III. Mongodb starts up
1. Set the mongodb.service startup service
Cd / lib/systemd/system vi mongodb.service [Unit] Description=mongodbAfter=network.target remote-fs.target nss-lookup.target [Service] Type=forkingExecStart=/usr/local/mongodb/bin/mongod-- config / usr/local/mongodb/bin/mongodb.conf ExecReload=/bin/kill-s HUP $MAINPID ExecStop=/usr/local/mongodb/bin/mongod-- shutdown-- config / usr/local/mongodb/bin/mongodb.conf PrivateTmp=true [Install] WantedBy=multi-user.target
2. Set mongodb.service permissions
Chmod 754 mongodb.service
3. System mongodb.service operation command
# start Service systemctl start mongodb.service # close Service systemctl stop mongodb.service # Boot start systemctl enable mongodb.service
These are all the contents of the article "how to deploy distributed database MongoDB under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.