{"id":1198,"date":"2011-04-22T10:28:00","date_gmt":"2011-04-22T00:28:00","guid":{"rendered":"http:\/\/www.melvic.info\/?p=1198"},"modified":"2012-04-17T09:18:14","modified_gmt":"2012-04-16T23:18:14","slug":"37-2","status":"publish","type":"post","link":"https:\/\/www.melvic.info\/?p=1198","title":{"rendered":"Mongo DB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>Cassandra\u306b\u7d9a\u3044\u3066\uff0cMongo DB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u5099\u5fd8\u9332\u3092\u53d6\u308b\u3002<!--more-->Mongo\u306fKey-Value\u30b9\u30c8\u30a2\uff0cNoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308a\uff0c\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3057\u3066\u306e\u4f7f\u7528\u306b\u7279\u5316\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3068\u3057\u3066\u306f\uff0c\u524d\u56de\u306eCassandra 0.7.4\u3068\u540c\u3058\u30de\u30b7\u30f3\u3092\u4f7f\u7528\u3057\u305f\u3002\uff08Fedora 14 64bit)<\/p>\n<p>Fedora\u5411\u3051\u306b\uff0cyum\u30ea\u30dd\u30b8\u30c8\u30ea\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u306a\u3044\u304c\uff0c\u516c\u958b\u3055\u308c\u3066\u3044\u3066\uff0c\u81ea\u5206\u3067\u30ea\u30dd\u30b8\u30c8\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u3053\u3068\u306b\u3088\u3063\u3066Yum\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u53ef\u80fd\u306b\u306a\u308b\u3002<\/p>\n<p>\u307e\u305a\uff0c\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092 \/etc\/yum.repos.d\/10gen.repo \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u4f5c\u308b\u3002\u3082\u3061\u308d\u3093\uff0croot\u6a29\u9650\u3067\u3084\u308b\u3053\u3068\u3002<\/p>\n<p><span style=\"color: #0000ff;\">$<\/span><span style=\"color: #6600ff;\"> cat \/etc\/yum.repos.d\/10gen.repo<\/span><span style=\"color: #0000ff;\"><br \/>\n[10gen]<br \/>\nname=10gen Repository<br \/>\nbaseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/x86_64<br \/>\ngpgcheck=0<\/span><\/p>\n<p>\u306a\u304a\uff0c32bit OS\u306e\u5834\u5408\u306f\uff0cbaseurl\u306e\u6700\u5f8c\u306ex86_64\u3092i686\uff08i386\u3067\u306f\u306a\u3044\u306e\u3067\u6ce8\u610f\uff09\u306b\u63db\u3048\u308b\u3060\u3051\u3067\u3044\u3044\u3002<\/p>\n<p>\u3042\u3068\u306f\uff0cMongo\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092yum\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3060\u3051\u3060\u3002<br \/>\n\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\uff0c\u30b5\u30fc\u30d0\u30fc\u3068\uff0c\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067\u5225\u3005\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>Mongo DB\u30b5\u30fc\u30d0\u30fc\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306fmongo-10gen-server\uff0c\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306fmongo-10gen\u3067\u3042\u308b\u3002<br \/>\n\u30b5\u30fc\u30d0\u30fc\u306e\u5834\u5408\u306f\uff0c\u4e21\u65b9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u306a\u3044\u3068\u306a\u306b\u304b\u3068\u4e0d\u4fbf\u3067\u3042\u308d\u3046\u3002<\/p>\n<p><span style=\"color: #0000ff;\">#<\/span><span style=\"color: #6600ff;\"> yum install mongo-10gen mongo-10gen-server<\/span><\/p>\n<p>\u3053\u308c\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u304a\u3057\u307e\u3044\u3002\u975e\u5e38\u306b\u7c21\u5358\u3067\u3042\u308b\u3002<br \/>\n\u3042\u3068\u306f\uff0cMongo DB\u3092\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u7acb\u3061\u4e0a\u3052\u308c\u3070\u3044\u3044\u3002\u30b5\u30fc\u30d3\u30b9\u540d\u306fmongod\u3067\u3042\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">#<\/span><span style=\"color: #6600ff;\"> service mongod start<\/span><\/p>\n<p>\u3053\u308c\u3067\uff0cMongoDB\u306f\u4f7f\u7528\u53ef\u80fd\u306a\u72b6\u614b\u306b\u306a\u308b\u3002\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u306b\u3082\u3069\u3063\u3066\uff0cMongo\u306eshell\u3067\u3042\u308b\uff0cmongo\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u307f\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">$<\/span><span style=\"color: #6600ff;\"> mongo<\/span><span style=\"color: #0000ff;\"><br \/>\nMongoDB shell version: 1.8.1<br \/>\nconnecting to: test<br \/>\n&gt; help<br \/>\ndb.help() help on db methods<br \/>\ndb.mycoll.help() help on collection methods<br \/>\nrs.help() help on replica set methods<br \/>\nhelp connect connecting to a db help<br \/>\nhelp admin administrative help<br \/>\nhelp misc misc things to know<br \/>\nhelp mr mapreduce help<\/span><\/p>\n<p>show dbs show database names<br \/>\nshow collections show collections in current database<br \/>\nshow users show users in current database<br \/>\nshow profile show most recent system.profile entries with time &gt;= 1ms<br \/>\nuse set current database<br \/>\ndb.foo.find() list objects in collection foo<br \/>\ndb.foo.find( { a : 1 } ) list objects in foo where a == 1<br \/>\nit result of the last line evaluated; use to further iterate<br \/>\nDBQuery.shellBatchSize = x set default number of items to display on shell<br \/>\nexit quit the mongo shell<br \/>\n&gt;<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\uff0c\u4eca\u56de\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u307e\u3067\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cassandra\u306b\u7d9a\u3044\u3066\uff0cMongo DB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u5099\u5fd8\u9332\u3092\u53d6\u308b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10,15],"tags":[],"class_list":["post-1198","post","type-post","status-publish","format-standard","hentry","category-computer-technology","category-15"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p53KbG-jk","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.melvic.info\/index.php?rest_route=\/wp\/v2\/posts\/1198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.melvic.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melvic.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melvic.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melvic.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1198"}],"version-history":[{"count":4,"href":"https:\/\/www.melvic.info\/index.php?rest_route=\/wp\/v2\/posts\/1198\/revisions"}],"predecessor-version":[{"id":1298,"href":"https:\/\/www.melvic.info\/index.php?rest_route=\/wp\/v2\/posts\/1198\/revisions\/1298"}],"wp:attachment":[{"href":"https:\/\/www.melvic.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melvic.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melvic.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}