In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Extract the file after obtaining the file
[root@localhost soft]# tar -xf mongodb-linux-x86_64-2.6.3.tgz [root@localhost soft]# ll Total Usage 112656drwxr-xr-x. 3 root root 4096 Jul 10 14:57 mongodb-linux-x86_64-2.6.3-rwxr-xr-x. 1 root root 115355601 Jul 10 14:57 mongodb-linux-x86_64-2.6.3.tgz
Copy the extracted file to/usr/local/and name it mongodb
[root@localhost soft]# mv mongodb-linux-x86_64-2.6.3 /usr/local/mongodb
Create mongodb data and log storage space
[root@localhost data]# mkdir -pv mongodb_data/{data,logs}mkdir: directory created "mongodb_data"mkdir: directory created "mongodb_data/data"mkdir: directory created "mongodb_data/logs"
start the service
[root@localhost ~]# /usr/local/mongodb/bin/mongod --dbpath=/data/mongodb_data/data/ --logpath=/data/mongodb_data/logs/mongodb.log --fork
viewing process
[root@localhost ~]# ps -ef|grep mongodbroot 38463 3174 0 15:16 pts/1 00:00:00 tail -f mongodb.logroot 38470 1 0 15:16 ? 00:00:00 /usr/local/mongodb/bin/mongod --dbpath=/data/mongodb_data/data/ --logpath=/data/mongodb_data/logs/mongodb.log --forkroot 38516 19166 0 15:18 pts/2 00:00:00 grep mongodb
Join Power On
[root@localhost ~]# echo "/usr/local/mongodb/bin/mongod --dbpath=/data/mongodb_data/data/ --logpath=/data/mongodb_data/logs/mongodb.log --fork" >> /etc/rc.local
query
[root@localhost ~]# /usr/local/mongodb/bin/mongoMongoDB shell version: 2.6.3connecting to: testWelcome to the MongoDB shell.For interactive help, type "help".For more comprehensive documentation, seehttp://docs.mongodb.org/Questions? Try the support grouphttp://groups.google.com/group/mongodb-user> show dbsadmin (empty)local 0.078GB>
parameter description
--dbpath database path (data file)
--logpath Log file path
--master designated as master
--slave specified as slave machine
--source Specifies the IP address of the host
--pologSize specifies that the log file size does not exceed 64M. Because resync is very laborious and time-consuming, it is best to avoid resync by setting a sufficiently large oplog Size (the default oplog size is 5% of the free disk size).
--logappend Add to end of log file
--port Enable port number
--fork runs in the background
--only Specifies which database to copy only
--slavedelay refers to the time interval from replication detection
--auth Does authentication permission need to be logged in (username and password
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.