在阿里云Linux上安装Mongo DB 3.0

Installation Steps

$ cd /etc/yum.repos.d
$ sudo vi mongodb-org-3.0.repo

[mongodb-org-3.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1

$ sudo yum install -y mongodb-org

Loaded plugins: branch, security
mongodb-org-3.0 | 951 B 00:00
mongodb-org-3.0/primary | 8.6 kB 00:00
mongodb-org-3.0 45/45
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package mongodb-org.x86_64 0:3.0.6-1.el6 will be installed
–> Processing Dependency: mongodb-org-shell = 3.0.6 for package: mongodb-org-3.0.6-1.el6.x86_64
–> Processing Dependency: mongodb-org-tools = 3.0.6 for package: mongodb-org-3.0.6-1.el6.x86_64
–> Processing Dependency: mongodb-org-server = 3.0.6 for package: mongodb-org-3.0.6-1.el6.x86_64
–> Processing Dependency: mongodb-org-mongos = 3.0.6 for package: mongodb-org-3.0.6-1.el6.x86_64
–> Running transaction check
—> Package mongodb-org-mongos.x86_64 0:3.0.6-1.el6 will be installed
—> Package mongodb-org-server.x86_64 0:3.0.6-1.el6 will be installed
—> Package mongodb-org-shell.x86_64 0:3.0.6-1.el6 will be installed
—> Package mongodb-org-tools.x86_64 0:3.0.6-1.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Installing:
mongodb-org x86_64 3.0.6-1.el6 mongodb-org-3.0 4.6 k
Installing for dependencies:
mongodb-org-mongos x86_64 3.0.6-1.el6 mongodb-org-3.0 3.9 M
mongodb-org-server x86_64 3.0.6-1.el6 mongodb-org-3.0 8.3 M
mongodb-org-shell x86_64 3.0.6-1.el6 mongodb-org-3.0 4.1 M
mongodb-org-tools x86_64 3.0.6-1.el6 mongodb-org-3.0 31 M

Transaction Summary
====================================================================================================================================
Install 5 Package(s)

Total download size: 48 M
Installed size: 149 M
Downloading Packages:
(1/5): mongodb-org-3.0.6-1.el6.x86_64.rpm | 4.6 kB 00:00
(2/5): mongodb-org-mongos-3.0.6-1.el6.x86_64.rpm | 3.9 MB 00:12
(3/5): mongodb-org-server-3.0.6-1.el6.x86_64.rpm | 8.3 MB 00:09
(4/5): mongodb-org-shell-3.0.6-1.el6.x86_64.rpm | 4.1 MB 00:07
(5/5): mongodb-org-tools-3.0.6-1.el6.x86_64.rpm | 31 MB 00:27
————————————————————————————————————————————
Total 800 kB/s | 48 MB 01:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mongodb-org-server-3.0.6-1.el6.x86_64 1/5
Installing : mongodb-org-shell-3.0.6-1.el6.x86_64 2/5
Installing : mongodb-org-mongos-3.0.6-1.el6.x86_64 3/5
Installing : mongodb-org-tools-3.0.6-1.el6.x86_64 4/5
Installing : mongodb-org-3.0.6-1.el6.x86_64 5/5

Installed:
mongodb-org.x86_64 0:3.0.6-1.el6

Dependency Installed:
mongodb-org-mongos.x86_64 0:3.0.6-1.el6 mongodb-org-server.x86_64 0:3.0.6-1.el6 mongodb-org-shell.x86_64 0:3.0.6-1.el6
mongodb-org-tools.x86_64 0:3.0.6-1.el6

Complete!

$ sudo service mongod start
$ mongo

MongoDB shell version: 3.0.6
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type “help”.
For more comprehensive documentation, see

http://docs.mongodb.org/

Questions? Try the support group

http://groups.google.com/group/mongodb-user

Server has startup warnings:
2015-10-29T19:51:37.887+0800 I CONTROL [initandlisten]
2015-10-29T19:51:37.887+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 1024 processes, 655360 files. Number of processes should be at least 327680 : 0.5 times number of files.
> exit
bye

$ sudo vi /etc/security/limits.conf

mongod soft nofile 64000
mongod hard nofile 64000
mongod soft nproc 32000
mongod hard nproc 32000

$ sudo service mongod restart

Stopping mongod: [ OK ]
Starting mongod: [ OK ]

$ mongo

MongoDB shell version: 3.0.6
connecting to: test
> help
db.help() help on db methods
db.mycoll.help() help on collection methods
sh.help() sharding helpers
rs.help() replica set helpers
help admin administrative help
help connect connecting to a db help
help keys key shortcuts
help misc misc things to know
help mr mapreduce

show dbs show database names
show collections show collections in current database
show users show users in current database
show profile show most recent system.profile entries with time >= 1ms
show logs show the accessible logger names
show log [name] prints out the last segment of log in memory, ‘global’ is default
use <db_name> set current database
db.foo.find() list objects in collection foo
db.foo.find( { a : 1 } ) list objects in foo where a == 1
it result of the last line evaluated; use to further iterate
DBQuery.shellBatchSize = x set default number of items to display on shell
exit quit the mongo shell
> show dbs
local 0.078GB
> exit
bye

References:

  1. Install MongoDB on Red Hat Enterprise or CentOS Linux

Data Warehouse For Ever原创文章,转载请注明出处

Leave a comment ?

630 Comments.

  1. -4389″) UNION ALL SELECT 5350,5350,5350,5350,5350,5350,5350,5350,5350#

  2. jfsezhxj”) UNION ALL SELECT 3940,3940,3940,3940,CONCAT(0x7170766b71,0x76786e4546567a53686c41434a5755624952735353704d497877574f4c6859745a62794c6e435350,0x7176786b71),3940,3940,3940,3940#

  3. -2880″) UNION ALL SELECT 1094,1094,1094,CONCAT(0x7170766b71,0x536a53745a736f585758544f646f616f47437552785570706170597867695843424e7750414f7157,0x7176786b71),1094,1094,1094,1094,1094#

  4. -7899″) UNION ALL SELECT CONCAT(0x7170766b71,0x644f4a64415673597351,0x7176786b71),1956,1956,1956,1956,1956,1956,1956,1956#

  5. -2815″ UNION ALL SELECT 9996,9996,9996,9996,9996,9996,9996#

  6. jfsezhxj” UNION ALL SELECT 8592,8592,8592,8592,8592,CONCAT(0x7170766b71,0x445675416f41764c5064,0x7176786b71),8592#

  7. -1401″ UNION ALL SELECT 9777,CONCAT(0x7170766b71,0x6f5668564949704c676c,0x7176786b71),9777,9777,9777,9777,9777#

  8. -3183′ UNION ALL SELECT 6596,6596,6596,6596,6596,6596,6596,6596#

  9. jfsezhxj’ UNION ALL SELECT 7061,7061,7061,7061,7061,7061,7061,CONCAT(0x7170766b71,0x6a596549686446665465,0x7176786b71)#

  10. -7928′ UNION ALL SELECT 4548,4548,4548,4548,4548,4548,4548,CONCAT(0x7170766b71,0x69624b6362466945544d7169794b51726e6b414155477258694a69664e5a63637546524b686e4b67,0x7176786b71)#

  11. -4098) UNION ALL SELECT 5358#

  12. -9647) UNION ALL SELECT CONCAT(0x7170766b71,0x7173777447656e4f6747,0x7176786b71)#

  13. -7915) UNION ALL SELECT 1768,1768,1768,1768,1768,1768,1768,1768,1768,1768#

  14. jfsezhxj) UNION ALL SELECT 9824,9824,9824,9824,9824,9824,9824,CONCAT(0x7170766b71,0x6d6861447457586e456b,0x7176786b71),9824,9824#

  15. -1172) UNION ALL SELECT 1569,1569,1569,1569,1569,1569,1569,1569,CONCAT(0x7170766b71,0x4e52675a455274527850595a79774d455559737058624c4f595743656362774f577957494265536a,0x7176786b71),1569#

  16. -3348) UNION ALL SELECT 5892,5892,5892,5892,5892,5892,CONCAT(0x7170766b71,0x7273756c5661486e6641,0x7176786b71),5892,5892,5892#

  17. -8898)) UNION ALL SELECT 4278,4278,4278,4278,4278,4278,4278,4278#

  18. jfsezhxj)) UNION ALL SELECT 1409,1409,1409,CONCAT(0x7170766b71,0x78736c55524e664845445673755278714a6d48544e53626a4e6957596e7346716955454245615164,0x7176786b71),1409,1409,1409,1409#

  19. -9991)) UNION ALL SELECT 8516,8516,8516,8516,8516,8516,8516,CONCAT(0x7170766b71,0x55626d5a6a7456556348646a61684a6f68644e75765666444646437344504466714d71486d6c7177,0x7176786b71)#

  20. -8423)) UNION ALL SELECT 6880,6880,6880,6880,6880,CONCAT(0x7170766b71,0x4773494c47554d4d4668,0x7176786b71),6880,6880#

  21. -9718))) UNION ALL SELECT 7535,7535,7535,7535,7535,7535,7535,7535#

  22. jfsezhxj))) UNION ALL SELECT 5986,5986,5986,5986,CONCAT(0x7170766b71,0x4470635843667a697550,0x7176786b71),5986,5986,5986#

  23. -2435))) UNION ALL SELECT 8157,CONCAT(0x7170766b71,0x46457765594b71624d6e68796e4661706a4c72646b7a45624d764150464d506e6169505a6d577875,0x7176786b71),8157,8157,8157,8157,8157,8157#

  24. -9598 UNION ALL SELECT 7862,7862,7862#

  25. jfsezhxj UNION ALL SELECT CONCAT(0x7170766b71,0x47646b78705362745572,0x7176786b71),2803,2803#

  26. -7081 UNION ALL SELECT 7141,7141,7141,7141,7141,7141,7141,7141#

  27. jfsezhxj UNION ALL SELECT 1919,1919,1919,1919,1919,CONCAT(0x7170766b71,0x457542586f54764242737767754d67796b4a64697954727146494e514f4165596167796b6c4d626f,0x7176786b71),1919,1919#

  28. -8875 UNION ALL SELECT 7427,7427,7427,7427,7427,CONCAT(0x7170766b71,0x636f454b7669487a624265715966516d7942754f74664c5572524a585455627957766b7566427549,0x7176786b71),7427,7427#

  29. -4609 UNION ALL SELECT 3512,3512,3512,3512,3512,3512,CONCAT(0x7170766b71,0x574354584d7371525258,0x7176786b71),3512#

  30. 技术文章,学习了。
    80% WordPress/Typecho,都是在讲开发

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>