{"id":7073,"date":"2016-02-12T15:49:47","date_gmt":"2016-02-12T14:49:47","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/"},"modified":"2016-02-12T15:49:47","modified_gmt":"2016-02-12T14:49:47","slug":"mongodb-installation","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/","title":{"rendered":"MongoDB Installation"},"content":{"rendered":"<p>In this blog posting we will see how to install MongoDB on a Linux distribution. MongoDB is supported for Linux, Mac, Windows and Solaris.<\/p>\n<h3>Linux distribution<\/h3>\n<p>First, determine your Linux distribution in order to download the appropriate MongoDB binaries.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">cat \/proc\/version<\/pre>\n<p>MongoDB is supported on the following operating systems:<\/p>\n<table style=\"height: 343px\" width=\"367\">\n<thead>\n<tr style=\"background-color: #dbbfbf\">\n<td style=\"text-align: left\">Platform<\/td>\n<td>3.2<\/td>\n<td>3.0<\/td>\n<td>2.6<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left\">Amazon Linux<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">Debian 7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">Fedora 8+<\/td>\n<td style=\"text-align: center\"><\/td>\n<td style=\"text-align: center\"><\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">RHEL\/CentOS 6.2+<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">RHEL\/CentOS 7.0+<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">SLES 11+<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">Solaris 64-bit<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">Ubuntu 12.04<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">Ubuntu 14.04<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">Microsoft Azure<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">Windows Vista\/Server 2008R2\/2012+<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">OSX10.7+<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<td style=\"text-align: center\">\u00d7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>MongoDB recommends the following OS for production environments:<\/p>\n<ul>\n<li>Amazon Linux<\/li>\n<li>Debian 7.1<\/li>\n<li>Red Hat \/ CentOS 6.2+<\/li>\n<li>SLES 11+<\/li>\n<li>Ubuntu LTS 12.04<\/li>\n<li>Ubuntu LTS 14.04<\/li>\n<li>Windows Server 2012 &amp; 2012 R2<\/li>\n<\/ul>\n<p>You always should use 64-bit builds for production environment. 32-bit build were deprecated from MongoDB.<\/p>\n<h3>Binary installation<\/h3>\n<p>Download and extract, the latest (3.2 release)\u00a0 stable release from the <a href=\"https:\/\/www.mongodb.org\/downloads#production\">MongoDB website<\/a>. In this blog we are going to install the 3.0.2 release.<\/p>\n<h4>Software Directory Creation:<\/h4>\n<p>To start a MongoBD server, you must create the data\/db directory to store data files. To manage your installation, dbi services provides you some best practices to properly install MongoDB on your system.<br \/>\nBased on the Oracle and MySQL installation dbi services has implemented an Optimal Flexible Architecture (OFA) for MongoDB.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">As root:\nmkdir \/u00\/app\/mongodb\nmkdir \/u00\/app\/mongodb\/product\n\nmkdir \/u00\/app\/mongodb\/admin\/\nmkdir \/u00\/app\/mongodb\/admin\/mongod1\/\nmkdir \/u00\/app\/mongodb\/admin\/mongod1\/etc\/\nmkdir \/u00\/app\/mongodb\/admin\/mongod1\/log\/\n\nmkdir \/u01\/app\/mongodbdata\/mongod1\/<\/pre>\n<p class=\"brush: bash; gutter: true; first-line: 1\">Check if you have the permissions to all of this directories. If not, add the permissions:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">sudo chown -R username:group \/u00\/app\/mongodb\/\nsudo chown -R username:group \/u01\/mongodbdata\/<\/pre>\n<p class=\"brush: bash; gutter: true; first-line: 1\">Move the MongoDB folder into the product directory:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">mv mongodb-linux-x86_64-ubuntu1204-3.0.2\/ \/u00\/app\/mongodb\/product<\/pre>\n<p>To start MongoDB by command line, specify the data path and the log file path:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">.\/mongod --dbpath \/u01\/mongodbdata\/mongod1\/ --logpath \/u00\/app\/mongodb\/admin\/mongod1\/log\/mongod.log --fork\n\nabout to fork child process, waiting until server is ready for connections.\nforked process: 7785\nchild process started successfully, parent exiting<\/pre>\n<p class=\"brush: bash; gutter: true; first-line: 1\">By default MongoDB start on localhost and listen on the port 27017, if you want to change it, use the \u2013-host and \u2013-port options. Use the \u2013-help to see all available options for mongod.<\/p>\n<p>You can also, add binaries to the system path by adding the following lines to your bash.rc file:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">PATH=$PATH:\/u00\/app\/mongodb\/product\/mongodb-linux-x86_64-ubuntu1204-3.0.2\/bin source \/etc\/bash.bashrc<\/pre>\n<h4 class=\"brush: bash; gutter: true; first-line: 1\">Binary description<\/h4>\n<p>Below you will find a description of all available binaries on the MongoDB Community release:<\/p>\n<p><span style=\"text-decoration: underline\">Components:<\/span><\/p>\n<ul>\n<li>mongod:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Database process<\/li>\n<li>mongo:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Database shell (javascript)<\/li>\n<li>mongos:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Sharding controller<\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline\">Utilities:<\/span><\/p>\n<ul>\n<li>mongodump:\u00a0\u00a0 Dump tool for backups, snapshots, etc &#8230;<\/li>\n<li>mongorestore: Restore a MongoDB Dump<\/li>\n<li>mongoimport: Import from JSON or CSV<\/li>\n<li>mongoexport:\u00a0 Export a single collection to test<\/li>\n<li>mongostat:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Show performance statistics<\/li>\n<li>mongofiles: \u00a0\u00a0\u00a0\u00a0 Utility for putting and getting files from MongoDB GridFS<\/li>\n<\/ul>\n<h3 class=\"brush: bash; gutter: true; first-line: 1\">MongoDB Shell<\/h3>\n<p>Connect to the mongo shell by launching the .\/mongo binary:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">.\/mongo\nMongoDB shell version: 3.0.2\nconnecting to: test\n\n<\/pre>\n<p>Show all databases:<\/p>\n<pre class=\"brush: javascript; gutter: true; first-line: 1\">&gt; show dbs\nlocal  0.078GB<\/pre>\n<p>Create a new database:<\/p>\n<pre class=\"brush: javascript; gutter: true; first-line: 1\">&gt; use test switched to db test<\/pre>\n<p>&nbsp;<\/p>\n<p>In a next blog we will see how to insert, delete, update and read data from the MongoDB Shell.<\/p>\n<h3>Conclusion:<\/h3>\n<p>The installation of MongoDB is very easy and everyone can quickly install and test it in its own working environment. The work of dbi services here is to provide an extremely professional installation with the best practices for your production environment. In example,\u00a0 the Optimal Flexible Architecture for MongoDB is one of the best practices.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog posting we will see how to install MongoDB on a Linux distribution. MongoDB is supported for Linux, Mac, Windows and Solaris. Linux distribution First, determine your Linux distribution in order to download the appropriate MongoDB binaries. cat \/proc\/version MongoDB is supported on the following operating systems: Platform 3.2 3.0 2.6 Amazon Linux [&hellip;]<\/p>\n","protected":false},"author":109,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[],"type_dbi":[],"class_list":["post-7073","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>MongoDB Installation - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB Installation\" \/>\n<meta property=\"og:description\" content=\"In this blog posting we will see how to install MongoDB on a Linux distribution. MongoDB is supported for Linux, Mac, Windows and Solaris. Linux distribution First, determine your Linux distribution in order to download the appropriate MongoDB binaries. cat \/proc\/version MongoDB is supported on the following operating systems: Platform 3.2 3.0 2.6 Amazon Linux [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-12T14:49:47+00:00\" \/>\n<meta name=\"author\" content=\"DevOps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DevOps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/\"},\"author\":{\"name\":\"DevOps\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735\"},\"headline\":\"MongoDB Installation\",\"datePublished\":\"2016-02-12T14:49:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/\"},\"wordCount\":441,\"commentCount\":0,\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/\",\"name\":\"MongoDB Installation - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2016-02-12T14:49:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MongoDB Installation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735\",\"name\":\"DevOps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"caption\":\"DevOps\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/devops\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MongoDB Installation - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/","og_locale":"en_US","og_type":"article","og_title":"MongoDB Installation","og_description":"In this blog posting we will see how to install MongoDB on a Linux distribution. MongoDB is supported for Linux, Mac, Windows and Solaris. Linux distribution First, determine your Linux distribution in order to download the appropriate MongoDB binaries. cat \/proc\/version MongoDB is supported on the following operating systems: Platform 3.2 3.0 2.6 Amazon Linux [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/","og_site_name":"dbi Blog","article_published_time":"2016-02-12T14:49:47+00:00","author":"DevOps","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DevOps","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/"},"author":{"name":"DevOps","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735"},"headline":"MongoDB Installation","datePublished":"2016-02-12T14:49:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/"},"wordCount":441,"commentCount":0,"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/","url":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/","name":"MongoDB Installation - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2016-02-12T14:49:47+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/mongodb-installation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"MongoDB Installation"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735","name":"DevOps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","caption":"DevOps"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/devops\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/7073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=7073"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/7073\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=7073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=7073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=7073"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=7073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}