In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Building MongoDB Services based on CentOS 6.5 operating system
Mongo DB is a very popular non-relational database (NoSql) in the IT industry. Its flexible data storage method is favored by current IT employees. Mongo DB well implements the object-oriented idea (OO idea). In Mongo DB, each record is a Document object. The biggest advantage of Mongo DB is that all data persistence operations do not need developers to write SQL statements manually, and you can easily implement CRUD operations by calling methods directly.
In this paper, the Linux system is used to build MongoDB services. The following is the specific construction process:
Prepare the MongoDB installation package
You can download the mongodb package at http://www.mongodb.org/downloads
2. Prepare MongoDB users
[root@dev-17] # useradd-s / sbin/nologin mongodb
3. Unpack and rename the extracted directory to mongodb
[root@dev-17] # tar-zxf mongodb-linux-x86_64-2.6.4.tgz-C / usr/src/
[root@dev-17 ~] # mv / usr/src/mongodb-linux-x86_64-2.6.4 / / usr/local/mongodb/
4. Enter the decompressed directory
Because the mongodb directory does not contain its data storage directory and log directory, these two directories need to be established manually:
[root@dev-17 ~] # cd / usr/local/mongodb/
[root@dev-17 mongodb] # mkdir data
/ / create a data directory
[root@dev-17 mongodb] # mkdir logs / / create a log directory
After the creation is completed, change the group and master of the mongodb directory to the mongodb user you just added to prevent errors caused by permission problems.
[root@dev-17 local] # chown-R mongodb:mongodb mongodb/
5. Set the mongodb service to start when the system boots.
Edit the / etc/rc.local file and insert the following record in the file:
/ usr/local/mongodb/bin/mongod-dbpath=/usr/local/mongodb/data/-logpath=/usr/local/mongodb/logs/logs-fork
6. Activate the mongodb service
[root@dev-17 data] # / usr/local/mongodb/bin/mongod-- dbpath=/usr/local/mongodb/data/-- logpath=/usr/local/mongodb/logs/logs-fork
7. Client logs in to mongodb database
[root@dev-17 data] # / usr/local/mongodb/bin/mongo
MongoDB shell version: 2.6.4
Connecting to: test
>
At this point, the construction of mongodb is basically completed.
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.