In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
System environment:
[root@mongodb ~] # cat / etc/redhat-releaseCentOS release 6.5 (Final) [root@mongodb ~] # uname-aLinux mongodb 2.6.32-431.el6.x86_64 # 1 SMP Fri Nov 22 03:15:09 UTC 2013 x 86 "64 x 86" 64 GNU/Linux
Start installation
[root@mongodb ~] # yum-y install openssl openssl-devel [root@mongodb ~] # mkdir soft [root@mongodb ~] # mkdir-p / opt/mongodb/data/ [root@mongodb ~] # mkdir-p / opt/mongodb/logs/ [root@mongodb ~] # cd soft/ [root@mongodb soft] # wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.9.tgz[root@mongodb soft] # cd / usr/local/ [root@mongodb Local] # mkdir mongodb [root@mongodb local] # cd mongodb/ [root@mongodb mongodb] # mv / root/soft/mongodb-linux-x86_64-2.4.9.tgz. [root@mongodb mongodb] # lsmongodb-linux-x86_64-2.4.9.tgz [root@mongodb mongodb] # tar xf mongodb-linux-x86_64-2.4.9.tgz [root@mongodb mongodb] # mv mongodb-linux-x86_64-2.4.9 lsmongodb-linux-x86_64 *. [root@mongodb mongodb ] # rm mongodb-linux-x86_64-2.4.9.tgz mongodb-linux-x86_64-2.4.9 /-rf [root@mongodb mongodb] # lsbin GNU-AGPL-3.0 README THIRD-PARTY-NOTICES [root@mongodb mongodb] # vim / etc/mongodb.cnf mongodb configuration file # configuration Options for MongoDB## For More Information Consider:#-Configuration Parameters: http://www.mongodb.org/display/DOCS/Command+Line+Parameters#-File Based Configuration: http://www.mongodb.org/display/DOCS/File+Based+Configurationdbpath = / opt/mongodb/data/logpath = / opt/mongodb/logs/mongodb.loglogappend = true#bind_ip = 127.0.0.1#port = 27017fork = true#auth = truenoauth = truedirectoryperdb = truejournal = truerest = false [root@mongodb mongodb] # / usr/local/mongodb/bin/mongod-- config / etc / mongodb.cnf starts mongodbwarning: remove or comment out this line by starting it with'#' Skipping now: rest = falseabout to fork child process Waiting until server is ready for connections.forked process: 5970all output going to: / opt/mongodb/logs/mongodb.log [root@mongodb ~] # tail-f / opt/mongodb/logs/mongodb.log View the mongodb startup log Fri Apr 4 21 initandlisten 30 waiting for connections on port 45.634 [websvr] admin web console waiting for connections on port 28017Fri Apr 4 21 initandlisten 30 waiting for connections on port successfully launched [root@mongodb ~] # netstat-tulnpan | grep mon Query listening port tcp 0 0 0.0.0. 0 LISTEN 28017 0.0.0 LISTEN * LISTEN 5970/mongod [root@mongodb ~] # ps aux | grep mongodroot 5970 6.9 3.6 465848 37504? Sl 21:29 0:17 / usr/local/mongodb/bin/mongod-- config / etc/mongodb.cnfroot 5974 0.1 0.0 100944 576 pts/1 S+ 21:29 tail-f / opt/mongodb/logs/mongodb.logroot 6007 0.0 103252 820 pts/2 S+ 21:33 0:00 grep mongod [root@mongodb] # kill-2 5970 Out of Service
Let's package mongodb into a startup script to let
[root@mongodb ~] # vim / ETC description init.ddeband MongodbBash Bash # chkconfig: 2345 97 inch description: mongodb init script for Linux.. / etc/init.d/functionssource / etc/bashrcsource / etc/profilemongodb_HOME=/usr/local/mongodb/binexport mongodb_HOMEstart () {/ usr/local/mongodb/bin/mongod-- config / etc/mongodb.cnf > > / dev/nullecho "start"} stop () {echo "stop" kill-2 `ps-C mongod-f | grep mongod | tr-s'| cut-d'- f 2`sleep 5} case "$1" in start) start;; stop) stop Restart) stop start;; version) exec $mongodb_HOME/mongod-- version *) echo $"Usage: $0 {start | stop | restart | version}" exit 1esac [root@mongodb ~] # chmod + x / etc/init.d/mongodb [root@mongodb ~] # / etc/init.d/mongodb start [root@mongodb ~] # cd / usr/local/mongodb/bin/ [root@mongodb bin] #. / mongoMongoDB shell version: 2.4.9connecting to: test > has been successfully connected to [root@mongodb ~] # / etc/init.d/mongodb Versiondb version v2.4.9Fri Apr 4 21 root@mongodb 35 git version 44.926 git version: 52fe0d21959e32a5bdbecdc62057db386e4e029c [root@mongodb ~] # netstat-tulnpan | grep montcp 0 0 0.0 0 0. 0 52fe0d21959e32a5bdbecdc62057db386e4e029c 28017 0. 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 of the 7 017 0. 0. 0. 0. 0. LISTEN 6024/mongod [root@mongodb ~] # / etc/init.d/mongodb stopstop [root@mongodb ~] # netstat-tulnpan | grep mon [root@mongodb ~] # chkconfig mongodb on
Turn it on and start it yourself.
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.