This document provides instructions for installing MongoDB on various operating systems. It includes sections for installing MongoDB on Linux distributions like Red Hat, Ubuntu, and Debian using package managers. There are also sections for installing MongoDB on other Linux systems, OS X using Homebrew packages, and Windows. The document provides an overview of installation guides for MongoDB and MongoDB Enterprise editions.
This document is a textbook titled "Programming Fundamentals - A Modular Structured Approach using C++" by Kenneth Leroy Busbee. It covers topics related to programming fundamentals such as data types, operators, functions, input/output, and more using C++ as the programming language. The textbook is divided into chapters that each cover a programming concept and include examples and exercises. It is intended to teach structured programming techniques using a modular approach in C++.
This document is the user manual for SQL Developer version 2.2.0. It provides information on getting started with SQL Developer, including license registration and configuring database drivers. It describes the main features of the SQL Developer desktop interface, including the main menu, tool bar, window areas, and output window. It provides details on the database navigator, connection dialog, SQL editors, bookmarks, diagram editor, database info, settings, and extensions available in SQL Developer.
Winserver 2012 R2 and Winserver 2012.TechnetEmilio
This document provides an overview of designing a private cloud infrastructure using Windows Server 2012 R2 and Windows Server 2012. It discusses key aspects of the cloud infrastructure including storage, networking, virtualization, and host design. Specific topics covered include storage options and protocols, cluster shared volumes, storage networking, network infrastructure design including traffic isolation, host licensing, memory configuration, and Hyper-V clustering.
The document provides instructions for installing MongoDB on Red Hat Enterprise Linux, CentOS Linux, and Fedora Linux systems using RPM packages. It describes downloading and configuring the MongoDB YUM repository, then installing the mongo-10gen and mongo-10gen-server packages to get the latest stable version of MongoDB. It also discusses how to install a specific version and prevent unintended upgrades using YUM version pinning.
This document provides an overview of HTML, CSS, Bootstrap, JavaScript and jQuery. It covers topics such as basic HTML tags and attributes, CSS selectors and properties, Bootstrap's grid system and components, JavaScript keywords and data types, and how to use jQuery. The document is intended as a reference for learning these web development languages and frameworks.
Hp networking-and-cisco-cli-reference-guide june-10_ww_eng_ltrFelippe Costa
Here are the commands to configure the console baud rate on each platform:
ProVision:
ProVision(config)# console baud-rate 9600
Comware 5:
[Comware5]user-interface aux 0
[Comware5-ui-aux0]speed 9600
Cisco:
Cisco(config)#line console 0
Cisco(config-line)#speed 9600
The side-by-side comparison shows that on ProVision the baud rate is configured under the console command while on Comware 5 and Cisco it is configured under the user-interface and line console commands respectively.
Perl <b>5 Tutorial</b>, First Editiontutorialsruby
This document is a 241-page tutorial on the Perl 5 programming language. It was written by Chan Bernard Ki Hong and published in 2003. The document covers topics such as what Perl is, getting started with Perl, manipulating data structures, operators, conditionals, loops, and subroutines. It includes over 20 chapters to guide readers through learning Perl programming.
This document is the Neo4j Manual v1.8.M01 which provides an introduction to graph database concepts, tutorials on using Neo4j from Java and Python, a reference section on Neo4j capabilities and transactions, and sections on operations, tools, and contributing to the Neo4j community. It is published by Neo Technology under a Creative Commons license and covers topics such as nodes, relationships, properties, paths, and the Cypher query language.
This document is a textbook titled "Programming Fundamentals - A Modular Structured Approach using C++" by Kenneth Leroy Busbee. It covers topics related to programming fundamentals such as data types, operators, functions, input/output, and more using C++ as the programming language. The textbook is divided into chapters that each cover a programming concept and include examples and exercises. It is intended to teach structured programming techniques using a modular approach in C++.
This document is the user manual for SQL Developer version 2.2.0. It provides information on getting started with SQL Developer, including license registration and configuring database drivers. It describes the main features of the SQL Developer desktop interface, including the main menu, tool bar, window areas, and output window. It provides details on the database navigator, connection dialog, SQL editors, bookmarks, diagram editor, database info, settings, and extensions available in SQL Developer.
Winserver 2012 R2 and Winserver 2012.TechnetEmilio
This document provides an overview of designing a private cloud infrastructure using Windows Server 2012 R2 and Windows Server 2012. It discusses key aspects of the cloud infrastructure including storage, networking, virtualization, and host design. Specific topics covered include storage options and protocols, cluster shared volumes, storage networking, network infrastructure design including traffic isolation, host licensing, memory configuration, and Hyper-V clustering.
The document provides instructions for installing MongoDB on Red Hat Enterprise Linux, CentOS Linux, and Fedora Linux systems using RPM packages. It describes downloading and configuring the MongoDB YUM repository, then installing the mongo-10gen and mongo-10gen-server packages to get the latest stable version of MongoDB. It also discusses how to install a specific version and prevent unintended upgrades using YUM version pinning.
This document provides an overview of HTML, CSS, Bootstrap, JavaScript and jQuery. It covers topics such as basic HTML tags and attributes, CSS selectors and properties, Bootstrap's grid system and components, JavaScript keywords and data types, and how to use jQuery. The document is intended as a reference for learning these web development languages and frameworks.
Hp networking-and-cisco-cli-reference-guide june-10_ww_eng_ltrFelippe Costa
Here are the commands to configure the console baud rate on each platform:
ProVision:
ProVision(config)# console baud-rate 9600
Comware 5:
[Comware5]user-interface aux 0
[Comware5-ui-aux0]speed 9600
Cisco:
Cisco(config)#line console 0
Cisco(config-line)#speed 9600
The side-by-side comparison shows that on ProVision the baud rate is configured under the console command while on Comware 5 and Cisco it is configured under the user-interface and line console commands respectively.
Perl <b>5 Tutorial</b>, First Editiontutorialsruby
This document is a 241-page tutorial on the Perl 5 programming language. It was written by Chan Bernard Ki Hong and published in 2003. The document covers topics such as what Perl is, getting started with Perl, manipulating data structures, operators, conditionals, loops, and subroutines. It includes over 20 chapters to guide readers through learning Perl programming.
This document is the Neo4j Manual v1.8.M01 which provides an introduction to graph database concepts, tutorials on using Neo4j from Java and Python, a reference section on Neo4j capabilities and transactions, and sections on operations, tools, and contributing to the Neo4j community. It is published by Neo Technology under a Creative Commons license and covers topics such as nodes, relationships, properties, paths, and the Cypher query language.
This document is the Akka Java documentation for release 2.3.9 from Typesafe Inc. It provides an introduction to Akka, which is a toolkit for building scalable, resilient applications using the actor model. Akka aims to make writing concurrent, fault-tolerant and scalable applications easier by providing higher-level abstractions and tools based on the actor model. The documentation covers concepts like actors, actor systems, fault tolerance, and provides examples of using Akka for common patterns like scheduling periodic messages.
This document is the MySQL Reference Manual. It provides information about MySQL, including what MySQL is, its main features, the company MySQL AB that develops it, licensing and support options, standards compliance, and installation instructions for MySQL. It also outlines MySQL's history and roadmap, and describes how to find additional information sources about MySQL.
This document discusses production topologies for WebSphere Process Server and WebSphere ESB V6. It includes selection criteria for choosing the right topology and examples with step-by-step instructions. Specifically, it describes three main topologies - basic, loosely coupled, and full support. The basic topology provides minimal capabilities with a single server, while the full support topology provides high availability and scalability with multiple clustered servers. The document provides details on implementing each topology and factors to consider when selecting a topology for a given scenario.
This document is the OpenStack Beginner's Guide for Ubuntu Precise edition. It provides an introduction to OpenStack components including Nova, Glance, Swift, Keystone and Horizon. It then describes how to install and configure these components on an Ubuntu server, including installing databases, configuring Keystone, Glance, Nova, Swift and Horizon.
This document discusses LaTeX and the contents of this PDF file. It notes that on April 28, 2012, the contents of the English and German Wikibooks and Wikipedia projects were licensed under a Creative Commons license. It also mentions that the LaTeX source code for this document is included as an attachment that can be extracted from the PDF. Finally, it states that the LaTeX source was generated by a freely available program under an open source license.
This document is the PostgreSQL 8.4.0 Documentation created by the PostgreSQL Global Development Group. It is covered by the license of the University of California and provides documentation for using PostgreSQL, including tutorials on basic and advanced features like installing PostgreSQL, creating and querying databases and tables, using SQL, and features like views, foreign keys, transactions, and inheritance. The documentation includes information on the history and development of PostgreSQL.
This module prints a simple "Hello world 1" message when loaded and "Goodbye world 1" when unloaded. It implements the basic init_module and cleanup_module functions required for all kernel modules, which are called when the module is loaded and unloaded respectively. The module demonstrates the simplest form of a kernel module and introduces the printk function for printing from a module.
The document provides step-by-step instructions for setting up an email server using Red Hat Linux 7. It discusses installing Red Hat Linux, configuring the network settings, installing and configuring DNS (BIND), sendmail, POP3, IMAP, and LDAP. The document contains details on installing necessary packages and configuring files to set up these various services and enable email functionality.
This document provides an overview of MySQL database concepts and usage. It discusses creating and selecting databases, as well as creating tables to store data. It describes how to retrieve information from tables to learn about the data. The document also covers common queries, optimizing SQL statements and database structure, data types, functions and operators, and more advanced topics like stored programs and views. The objective is to teach MySQL database programming in a clear, detailed format.
This document describes using open source tools for cross development on ST microcontrollers from the STR710, STR730 and STR750 families. It discusses the necessary hardware, including a target board with the microcontroller, a JTAG interface to connect the board to a PC, and the software tools used, such as OpenOCD, GNU ARM Eclipse and Insight. It then provides tutorials for setting up the tools on Windows and Linux, covering installing software, configuring projects, building and debugging programs. Details are given on the configuration files and project template created by the authors to support development. Tests were also done with an STR912 board which showed promising results.
RDB Synchronization, Transcoding and LDAP Directory Services ...Videoguy
This document provides an overview and instructions for synchronizing data between mobile databases and back-end databases using IBM WebSphere Everyplace Access Version 4.1.1. It also covers using transcoding technologies to adapt portlet content for different devices. The key topics covered include:
- Configuring database synchronization between DB2 Everyplace and backend DB2 or Oracle databases
- Using transcoding technologies like XML stylesheets and annotations to customize content for devices
- A sample application demonstrating how to clip content from documents using internal and external annotation
This document provides reference information about the Gecko DOM (Document Object Model) API. It includes sections that describe the DOM window, DOM document, DOM elements, DOM events, DOM styles, and DOM ranges. The document is intended for web developers and explains how to access and manipulate web page content and structure using the DOM.
This document provides information on installing and using the Selenium Python bindings. It covers downloading and configuring Selenium, writing tests, locating elements, handling waits and timeouts, using page objects, and the full WebDriver API. The appendix addresses some frequently asked questions about Selenium and Python.
This document provides a deployment guide for IBM System Storage Productivity Center (SSPC). It discusses SSPC and TotalStorage Productivity Center (TPC) Basic Edition, including their components, architecture and key concepts. It also covers planning considerations for an SSPC installation such as hardware and software requirements, licensing, and server sizing. The document then describes setting up an SSPC server, including installing required software like DB2 and TPC. It concludes with sections on managing the SSPC appliance after deployment through security, upgrades and integrating it with an existing TPC environment.
This document provides an overview and guide for planning and implementing IBM's Tivoli Data Warehouse Version 1.3. It discusses key concepts in data warehousing and business intelligence. The document also covers planning a data warehouse project, including requirements, design considerations, and best practices. Implementation topics include hardware and software requirements, physical and logical design options, database sizing, security, and more. The goal is to help IT professionals successfully deploy Tivoli Data Warehouse.
This user guide provides information about managing and configuring Zend Server Community Edition 4.0.3. It describes the administration interface layout and tabs for monitoring server information and setup. It also provides tasks for working with components, extensions, logs, and other features. Configuration details and API references are included for components like the debugger, optimizer, guard loader, and others. Best practices are also covered for performance, security, development, and deployment.
This document provides an overview and instructions for using transcoding technologies in IBM WebSphere Everyplace Access Version 4.1.1. It describes the architecture and components involved in transcoding, including preference profiles, stylesheets, annotators, and plug-ins. It also covers tools for configuring transcoding and monitoring requests. Finally, it provides examples of using annotation, stylesheets, and portal-level transcoding to deliver content to different devices.
This document provides an introduction to security on mainframe systems. It discusses fundamental security concepts like confidentiality, integrity and availability. It also covers security elements such as identification, authentication, authorization, encryption and auditing. Additionally, it examines the System z architecture and how the hardware and operating system provide security features. The document uses a case study about securing an online bookstore to illustrate how these concepts apply in a business context. It is intended to help readers understand mainframe security.
Data source integration guide for HP Performance Agenthernajes
This document provides documentation for HP Performance Agent software version 5.00, including a data source integration guide. It describes how to use the data source integration (DSI) feature to collect and log performance data from various sources on Unix systems. The document covers planning and setting up data collection, defining log file formats, creating class specification files, using the dsilog logging process, and examples of integrating common data sources like vmstat.
This document provides an introduction and overview of NoSQL concepts and MongoDB database. It begins with the purpose of guiding beginners and discusses how the growth of data led to the development of NoSQL technologies. It then covers the history of databases, defines key terms, and describes the different types of NoSQL databases like key-value, column-oriented, document-oriented and graph oriented. Specifics about MongoDB are provided, including conceptual understanding, basic operations like insert and find, and comparison operators. The document aims to make learning MongoDB and NoSQL easy and fun for beginners.
This document provides information about MongoDB, including:
- MongoDB is a cross-platform document-oriented database that provides high performance, high availability, and easy scalability.
- Data is stored in MongoDB in the form of JSON-like documents with dynamic schemas, instead of using fixed table schemas as in SQL-based databases.
- Relationships between documents can be modeled either by embedding one document inside another or by storing references between separate documents.
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYCLaura Ventura
One of the most popular NoSQL databases, MongoDB is one of the building blocks for big data analysis. MongoDB can store unstructured data and makes it easy to analyze files by commonly available tools. This session will go over how big data analytics can improve sales outcomes in identifying users with a propensity to buy by processing information from social networks. All attendees will have a MongoDB instance on a public cloud, plus sample code to run Big Data Analytics.
This document is the Akka Java documentation for release 2.3.9 from Typesafe Inc. It provides an introduction to Akka, which is a toolkit for building scalable, resilient applications using the actor model. Akka aims to make writing concurrent, fault-tolerant and scalable applications easier by providing higher-level abstractions and tools based on the actor model. The documentation covers concepts like actors, actor systems, fault tolerance, and provides examples of using Akka for common patterns like scheduling periodic messages.
This document is the MySQL Reference Manual. It provides information about MySQL, including what MySQL is, its main features, the company MySQL AB that develops it, licensing and support options, standards compliance, and installation instructions for MySQL. It also outlines MySQL's history and roadmap, and describes how to find additional information sources about MySQL.
This document discusses production topologies for WebSphere Process Server and WebSphere ESB V6. It includes selection criteria for choosing the right topology and examples with step-by-step instructions. Specifically, it describes three main topologies - basic, loosely coupled, and full support. The basic topology provides minimal capabilities with a single server, while the full support topology provides high availability and scalability with multiple clustered servers. The document provides details on implementing each topology and factors to consider when selecting a topology for a given scenario.
This document is the OpenStack Beginner's Guide for Ubuntu Precise edition. It provides an introduction to OpenStack components including Nova, Glance, Swift, Keystone and Horizon. It then describes how to install and configure these components on an Ubuntu server, including installing databases, configuring Keystone, Glance, Nova, Swift and Horizon.
This document discusses LaTeX and the contents of this PDF file. It notes that on April 28, 2012, the contents of the English and German Wikibooks and Wikipedia projects were licensed under a Creative Commons license. It also mentions that the LaTeX source code for this document is included as an attachment that can be extracted from the PDF. Finally, it states that the LaTeX source was generated by a freely available program under an open source license.
This document is the PostgreSQL 8.4.0 Documentation created by the PostgreSQL Global Development Group. It is covered by the license of the University of California and provides documentation for using PostgreSQL, including tutorials on basic and advanced features like installing PostgreSQL, creating and querying databases and tables, using SQL, and features like views, foreign keys, transactions, and inheritance. The documentation includes information on the history and development of PostgreSQL.
This module prints a simple "Hello world 1" message when loaded and "Goodbye world 1" when unloaded. It implements the basic init_module and cleanup_module functions required for all kernel modules, which are called when the module is loaded and unloaded respectively. The module demonstrates the simplest form of a kernel module and introduces the printk function for printing from a module.
The document provides step-by-step instructions for setting up an email server using Red Hat Linux 7. It discusses installing Red Hat Linux, configuring the network settings, installing and configuring DNS (BIND), sendmail, POP3, IMAP, and LDAP. The document contains details on installing necessary packages and configuring files to set up these various services and enable email functionality.
This document provides an overview of MySQL database concepts and usage. It discusses creating and selecting databases, as well as creating tables to store data. It describes how to retrieve information from tables to learn about the data. The document also covers common queries, optimizing SQL statements and database structure, data types, functions and operators, and more advanced topics like stored programs and views. The objective is to teach MySQL database programming in a clear, detailed format.
This document describes using open source tools for cross development on ST microcontrollers from the STR710, STR730 and STR750 families. It discusses the necessary hardware, including a target board with the microcontroller, a JTAG interface to connect the board to a PC, and the software tools used, such as OpenOCD, GNU ARM Eclipse and Insight. It then provides tutorials for setting up the tools on Windows and Linux, covering installing software, configuring projects, building and debugging programs. Details are given on the configuration files and project template created by the authors to support development. Tests were also done with an STR912 board which showed promising results.
RDB Synchronization, Transcoding and LDAP Directory Services ...Videoguy
This document provides an overview and instructions for synchronizing data between mobile databases and back-end databases using IBM WebSphere Everyplace Access Version 4.1.1. It also covers using transcoding technologies to adapt portlet content for different devices. The key topics covered include:
- Configuring database synchronization between DB2 Everyplace and backend DB2 or Oracle databases
- Using transcoding technologies like XML stylesheets and annotations to customize content for devices
- A sample application demonstrating how to clip content from documents using internal and external annotation
This document provides reference information about the Gecko DOM (Document Object Model) API. It includes sections that describe the DOM window, DOM document, DOM elements, DOM events, DOM styles, and DOM ranges. The document is intended for web developers and explains how to access and manipulate web page content and structure using the DOM.
This document provides information on installing and using the Selenium Python bindings. It covers downloading and configuring Selenium, writing tests, locating elements, handling waits and timeouts, using page objects, and the full WebDriver API. The appendix addresses some frequently asked questions about Selenium and Python.
This document provides a deployment guide for IBM System Storage Productivity Center (SSPC). It discusses SSPC and TotalStorage Productivity Center (TPC) Basic Edition, including their components, architecture and key concepts. It also covers planning considerations for an SSPC installation such as hardware and software requirements, licensing, and server sizing. The document then describes setting up an SSPC server, including installing required software like DB2 and TPC. It concludes with sections on managing the SSPC appliance after deployment through security, upgrades and integrating it with an existing TPC environment.
This document provides an overview and guide for planning and implementing IBM's Tivoli Data Warehouse Version 1.3. It discusses key concepts in data warehousing and business intelligence. The document also covers planning a data warehouse project, including requirements, design considerations, and best practices. Implementation topics include hardware and software requirements, physical and logical design options, database sizing, security, and more. The goal is to help IT professionals successfully deploy Tivoli Data Warehouse.
This user guide provides information about managing and configuring Zend Server Community Edition 4.0.3. It describes the administration interface layout and tabs for monitoring server information and setup. It also provides tasks for working with components, extensions, logs, and other features. Configuration details and API references are included for components like the debugger, optimizer, guard loader, and others. Best practices are also covered for performance, security, development, and deployment.
This document provides an overview and instructions for using transcoding technologies in IBM WebSphere Everyplace Access Version 4.1.1. It describes the architecture and components involved in transcoding, including preference profiles, stylesheets, annotators, and plug-ins. It also covers tools for configuring transcoding and monitoring requests. Finally, it provides examples of using annotation, stylesheets, and portal-level transcoding to deliver content to different devices.
This document provides an introduction to security on mainframe systems. It discusses fundamental security concepts like confidentiality, integrity and availability. It also covers security elements such as identification, authentication, authorization, encryption and auditing. Additionally, it examines the System z architecture and how the hardware and operating system provide security features. The document uses a case study about securing an online bookstore to illustrate how these concepts apply in a business context. It is intended to help readers understand mainframe security.
Data source integration guide for HP Performance Agenthernajes
This document provides documentation for HP Performance Agent software version 5.00, including a data source integration guide. It describes how to use the data source integration (DSI) feature to collect and log performance data from various sources on Unix systems. The document covers planning and setting up data collection, defining log file formats, creating class specification files, using the dsilog logging process, and examples of integrating common data sources like vmstat.
This document provides an introduction and overview of NoSQL concepts and MongoDB database. It begins with the purpose of guiding beginners and discusses how the growth of data led to the development of NoSQL technologies. It then covers the history of databases, defines key terms, and describes the different types of NoSQL databases like key-value, column-oriented, document-oriented and graph oriented. Specifics about MongoDB are provided, including conceptual understanding, basic operations like insert and find, and comparison operators. The document aims to make learning MongoDB and NoSQL easy and fun for beginners.
This document provides information about MongoDB, including:
- MongoDB is a cross-platform document-oriented database that provides high performance, high availability, and easy scalability.
- Data is stored in MongoDB in the form of JSON-like documents with dynamic schemas, instead of using fixed table schemas as in SQL-based databases.
- Relationships between documents can be modeled either by embedding one document inside another or by storing references between separate documents.
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYCLaura Ventura
One of the most popular NoSQL databases, MongoDB is one of the building blocks for big data analysis. MongoDB can store unstructured data and makes it easy to analyze files by commonly available tools. This session will go over how big data analytics can improve sales outcomes in identifying users with a propensity to buy by processing information from social networks. All attendees will have a MongoDB instance on a public cloud, plus sample code to run Big Data Analytics.
Doctrine MongoDB ODM is an object document mapper for PHP that provides tools for managing object persistence with MongoDB. It allows developers to work with MongoDB documents as objects and provides a query API and change tracking functionality to make common operations like inserting, updating, and deleting documents straightforward. Doctrine abstracts away the low-level MongoDB driver to allow developers to work with documents and references between documents using familiar object-oriented patterns.
This document provides an overview of CRUD (create, read, update, delete) operations in MongoDB. It describes the basic database operations like querying and modifying documents. It also covers related features like indexes, read preference for replica sets, and write concern. The document consists of several sections that explain MongoDB CRUD concepts and provide tutorial-style examples for performing CRUD operations.
The document discusses data migration between Oracle and MongoDB databases. It provides an introduction to the topic, reasons for migration between different database systems, key differences between relational and non-relational databases, and a demonstration of migrating data between Oracle and MongoDB. The document aims to help developers take advantage of both database types to maximize benefits for their organizations.
This tutorial will introduce the features of MongoDB by building a simple location-based application using MongoDB. The tutorial will cover the basics of MongoDB’s document model, query language, map-reduce framework and deployment architecture.
The tutorial will be divided into 5 sections:
Data modeling with MongoDB: documents, collections and databases
Querying your data: simple queries, geospatial queries, and text-searching
Writes and updates: using MongoDB’s atomic update modifiers
Trending and analytics: Using mapreduce and MongoDB’s aggregation framework
Deploying the sample application
Besides the knowledge to start building their own applications with MongoDB, attendees will finish the session with a working application they use to check into locations around Portland from any HTML5 enabled phone!
TUTORIAL PREREQUISITES
Each attendee should have a running version of MongoDB. Preferably the latest unstable release 2.1.x, but any install after 2.0 should be fine. You can dowload MongoDB at http://www.mongodb.org/downloads.
Instructions for installing MongoDB are at http://docs.mongodb.org/manual/installation/.
Additionally we will be building an app in Ruby. Ruby 1.9.3+ is required for this. The current latest version of ruby is 1.9.3-p194.
For windows download the http://rubyinstaller.org/
For OSX download http://unfiniti.com/software/mac/jewelrybox/
For linux most users should know how to for their own distributions.
We will be using the following GEMs and they MUST BE installed ahead of time so you can be ahead of the game and safe in the event that the Internet isn’t accommodating.
bson (1.6.4)
bson_ext (1.6.4)
haml (3.1.4)
mongo (1.6.4)
rack (1.4.1)
rack-protection (1.2.0)
rack shotgun (0.9)
sinatra (1.3.2)
tilt (1.3.3)
Prior ruby experience isn’t required for this. We will NOT be using rails for this app.
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB
Presented by Austin Zellner, Solutions Architect, MongoDB
Schema design is as much art as it is science, but it is central to understanding how to get the most out of MongoDB. Attendees will walk away with an understanding of how to approach schema design, what influences it, and the science behind the art. After this session, attendees will be ready to design new schemas, as well as re-evaluate existing schemas with a new mental model.
This document provides information about MongoDB and its suitability for e-commerce applications. It discusses how MongoDB allows for a flexible schema that can accommodate different product types like books, music albums, jeans, without needing to define all attributes in advance. This flexibility addresses the "data dilemma" that traditional relational databases have in modeling diverse e-commerce data. Examples of companies successfully using MongoDB for e-commerce are also provided.
This document is a 241-page tutorial on the Perl 5 programming language. It was written by Chan Bernard Ki Hong and published in 2003 under a Creative Commons license. The document provides an introduction to Perl and teaches the fundamentals of Perl programming, including data structures, operators, conditionals, loops, subroutines, references and more. It aims to help readers learn Perl and further improve the quality of the tutorial through reader feedback.
This document is a Python tutorial that provides an overview of the Python programming language. It covers topics like using the Python interpreter, basic syntax, data structures, modules, input/output, exceptions, classes and inheritance, and the standard library. The tutorial is intended for new Python programmers to help them learn the essential aspects of the language.
Python is an easy to learn, powerful programming language. It has efficient high-level data structures and
a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic
typing, together with its interpreted nature, make it an ideal language for scripting and rapid application
development in many areas on most platforms.
The Python interpreter and the extensive standard library are freely available in source or binary form for all
major platforms from the Python Web site, https://www.python.org/, and may be freely distributed. The
same site also contains distributions of and pointers to many free third-party Python modules, programs
and tools, and additional documentation.
This document is a tutorial for the Python programming language. It covers topics such as using Python as a calculator, basic programming concepts like variables and functions, built-in data types like lists and dictionaries, modules and packages, input/output functions, exceptions and errors, classes and object-oriented programming, and an overview of the Python standard library. The tutorial is intended for new Python programmers to help them learn the fundamentals of the language.
This document is a tutorial for the Python programming language. It covers topics such as using Python as a calculator, basic programming concepts like variables and functions, built-in data types like lists and dictionaries, modules and packages, input/output functions, exceptions and errors, classes and inheritance, and an overview of the Python standard library. The tutorial is intended for new Python programmers to help them learn the fundamentals of the language.
This document is a tutorial for the Python programming language. It covers topics such as using Python as a calculator, basic programming concepts like variables and functions, built-in data types like lists and dictionaries, modules and packages, input/output functions, exceptions and errors, classes and object-oriented programming, and an overview of the Python standard library. The tutorial is intended for new Python programmers to help them learn the fundamentals of the language.
This document is a tutorial for the Python programming language. It covers topics such as using the Python interpreter, basic syntax, data types, control flow, functions, modules, input/output, exceptions, object-oriented programming with classes, and an overview of the standard library. The tutorial is intended for new Python programmers to help them learn the fundamentals of the language.
This document is a guide to Yii 2.0, an open source PHP framework. Chapter 1 introduces Yii, describing what it is best suited for, how it compares to other frameworks, its versions, and requirements. Yii is a high performance, component-based framework for rapidly developing modern web applications. It is especially suitable for large-scale projects like portals, forums, and content management systems.
This document provides an introduction to using R for data mining. It discusses importing and exploring data, various data mining techniques including decision trees, regression, clustering, outlier detection, time series analysis, association rule mining and text mining. Case studies and online resources for further learning are also referenced. The document is intended as a guide to applying data mining methods in R and includes examples using common R packages.
This document provides an overview of SWI-Prolog, a comprehensive and portable implementation of the Prolog programming language. It describes SWI-Prolog's positioning as a robust and scalable implementation supporting a wide range of applications. The document outlines key features such as interfaces to other languages, databases, graphics and networking, as well as support for managing HTML/SGML/XML and RDF documents. It also provides information on using SWI-Prolog, including details on its development environment, compiler, debugger and more.
This document is the Flask documentation, which provides information on how to use the Flask web framework. It covers topics like installation, basic usage, routing, templates, testing, debugging errors, configuration, signals, pluggable views, application and request contexts, modular applications with blueprints, extensions, and patterns for building larger Flask applications. The documentation contains tutorials, API references, and best practices for developing Flask applications.
This document provides an overview of SWI-Prolog, a comprehensive and portable implementation of the Prolog programming language. It aims to be a robust and scalable implementation supporting a wide range of applications, with extensive support for interfaces to other languages, databases, graphics and networking. The document covers topics like getting started with SWI-Prolog, developing Prolog projects, the integrated development environment, built-in predicates, and system limits.
This document is a tutorial for learning Apache Spark with Python. It covers topics like configuring Spark on different platforms, an introduction to Spark's core concepts and architecture, and programming with RDDs. It then demonstrates various machine learning techniques in Spark like regression, classification, clustering, and neural networks. It also discusses automating Spark pipelines and packaging PySpark code.
This document contains the MongoDB Reference Manual for version 2.6.4. It provides reference material covering MongoDB interfaces, commands, operators, aggregation, comparisons to SQL, core components, internal metadata, general system references, and release notes. The document outlines the manual's licensing terms and how to report issues or contribute.
This document contains a summary of the MongoDB Reference Manual, including information about its license, editions, versions, and how to report issues or contribute. It provides guidance on contributing translations and details the documentation process, build system, and style guide used for the MongoDB documentation.
This document provides a draft summary of an IBM reference architecture for virtualized environments using IBM System Storage N series storage platforms. It includes chapters on architecture, Clustered Data ONTAP 8.2 features, VMware vSphere integration, and Microsoft Hyper-V integration. The document discusses storage configuration, provisioning, cloning, snapshots, and other topics to understand how to design scalable cloud solutions using N series storage and Clustered Data ONTAP.
This document is a Python tutorial that provides an overview of the Python programming language. It covers topics like using the Python interpreter, basic syntax like variables and data types, control flow tools like if/else statements and for loops, defining functions, working with data structures like lists, tuples and dictionaries, modules and packages, input/output functions, exceptions and errors, and an introduction to classes. The tutorial is intended to help new Python programmers get started with the basics of the language.
The document evaluates five implementations of the SPARQL query language for the Semantic Web. It first provides background on the Semantic Web and SPARQL, including the data model and query language specifications. It then describes the methodology for testing each implementation using a dataset from DBpedia.org and sample queries. Each implementation - OpenRDF Sesame, OpenLink Virtuoso, Jena, Pyrrho DBMS, and AllegroGraph - is installed and evaluated based on documentation, loading data efficiently, and computing query results in a reasonable time. The conclusion finds that while some implementations are advanced, they still have problems processing basic SPARQL queries as specified.
This document provides instructions for installing and configuring IBM's Tivoli Intelligent ThinkDynamic Orchestrator software. It guides the reader through planning a demonstration of the software, installing necessary components on Windows systems, designing a sample data center model using XML, and loading and testing the model. The final chapter describes demonstrating the software's capabilities to monitor and manage resources and applications in the simulated data center.
This document provides an overview of sharding in MongoDB. It introduces sharding as a method for horizontally scaling databases across multiple machines to support large datasets and high throughput. The key components of a sharded MongoDB cluster are shards, which store data, and config servers, which maintain cluster metadata. The document discusses various sharding techniques for partitioning data and how the cluster maintains a balanced distribution through operations like splitting and balancing. It also outlines common cluster architectures and behaviors related to query routing, availability and more. Finally, it lists tutorials for deploying, managing and troubleshooting sharded clusters.
This document provides an overview and guidance on MongoDB security. It discusses authentication, role-based access control, auditing, encryption, and hardening deployments. It then details concepts like authentication mechanisms, authorization with roles and privileges, network exposure configuration, and API security. Finally it includes tutorials for security best practices, network configuration like firewalls and SSL, deployment, access control, user/role management, and auditing.
This document discusses replication in MongoDB and replica sets. It introduces the purpose of replication, which provides redundancy and increases data availability. A replica set in MongoDB is a group of mongod processes that maintain the same data set. The primary mongod instance receives all write operations and replicates the write operations to the secondary members via an oplog. Replica sets provide redundancy, high availability, and the ability to recover from hardware failures through automatic failover of a secondary to primary role. The document covers concepts like replica set members, deployment architectures, replication processes, and tutorials for common administrative tasks.
This document provides guidance on data modeling for MongoDB databases. It discusses two approaches to representing relationships between documents: embedding related data within documents, and linking documents through references. The document recommends considering both the application's usage patterns and data structure when designing a data model. It provides an overview of key data modeling concepts and factors to balance, and directs readers to additional sections that include data modeling examples and reference documentation.
This document provides an overview of aggregation and data processing in MongoDB. It describes three main modalities for performing aggregation: 1) the aggregation pipeline, which allows documents to pass through multi-stage pipelines that transform them into aggregated results; 2) map-reduce functions, which perform aggregation through map and reduce phases; and 3) single purpose aggregation operations like count, distinct, and group that support common aggregation needs. The document also covers aggregation concepts, examples, and reference materials.
This document provides an overview of MongoDB administration concepts and tutorials. It covers key topics related to operational strategies for MongoDB including backup methods, monitoring, database configuration, data management strategies, and optimization techniques. The document also outlines tutorials for tasks like configuration, maintenance, backup/recovery, and MongoDB scripting.
The Building Blocks of QuestDB, a Time Series Databasejavier ramirez
Talk Delivered at Valencia Codes Meetup 2024-06.
Traditionally, databases have treated timestamps just as another data type. However, when performing real-time analytics, timestamps should be first class citizens and we need rich time semantics to get the most out of our data. We also need to deal with ever growing datasets while keeping performant, which is as fun as it sounds.
It is no wonder time-series databases are now more popular than ever before. Join me in this session to learn about the internal architecture and building blocks of QuestDB, an open source time-series database designed for speed. We will also review a history of some of the changes we have gone over the past two years to deal with late and unordered data, non-blocking writes, read-replicas, or faster batch ingestion.
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...sameer shah
"Join us for STATATHON, a dynamic 2-day event dedicated to exploring statistical knowledge and its real-world applications. From theory to practice, participants engage in intensive learning sessions, workshops, and challenges, fostering a deeper understanding of statistical methodologies and their significance in various fields."
The Ipsos - AI - Monitor 2024 Report.pdfSocial Samosa
According to Ipsos AI Monitor's 2024 report, 65% Indians said that products and services using AI have profoundly changed their daily life in the past 3-5 years.
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeWalaa Eldin Moustafa
Dynamic policy enforcement is becoming an increasingly important topic in today’s world where data privacy and compliance is a top priority for companies, individuals, and regulators alike. In these slides, we discuss how LinkedIn implements a powerful dynamic policy enforcement engine, called ViewShift, and integrates it within its data lake. We show the query engine architecture and how catalog implementations can automatically route table resolutions to compliance-enforcing SQL views. Such views have a set of very interesting properties: (1) They are auto-generated from declarative data annotations. (2) They respect user-level consent and preferences (3) They are context-aware, encoding a different set of transformations for different use cases (4) They are portable; while the SQL logic is only implemented in one SQL dialect, it is accessible in all engines.
#SQL #Views #Privacy #Compliance #DataLake
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...Social Samosa
The Modern Marketing Reckoner (MMR) is a comprehensive resource packed with POVs from 60+ industry leaders on how AI is transforming the 4 key pillars of marketing – product, place, price and promotions.
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Data and AI
Round table discussion of vector databases, unstructured data, ai, big data, real-time, robots and Milvus.
A lively discussion with NJ Gen AI Meetup Lead, Prasad and Procure.FYI's Co-Found
Global Situational Awareness of A.I. and where its headedvikram sood
You can see the future first in San Francisco.
Over the past year, the talk of the town has shifted from $10 billion compute clusters to $100 billion clusters to trillion-dollar clusters. Every six months another zero is added to the boardroom plans. Behind the scenes, there’s a fierce scramble to secure every power contract still available for the rest of the decade, every voltage transformer that can possibly be procured. American big business is gearing up to pour trillions of dollars into a long-unseen mobilization of American industrial might. By the end of the decade, American electricity production will have grown tens of percent; from the shale fields of Pennsylvania to the solar farms of Nevada, hundreds of millions of GPUs will hum.
The AGI race has begun. We are building machines that can think and reason. By 2025/26, these machines will outpace college graduates. By the end of the decade, they will be smarter than you or I; we will have superintelligence, in the true sense of the word. Along the way, national security forces not seen in half a century will be un-leashed, and before long, The Project will be on. If we’re lucky, we’ll be in an all-out race with the CCP; if we’re unlucky, an all-out war.
Everyone is now talking about AI, but few have the faintest glimmer of what is about to hit them. Nvidia analysts still think 2024 might be close to the peak. Mainstream pundits are stuck on the wilful blindness of “it’s just predicting the next word”. They see only hype and business-as-usual; at most they entertain another internet-scale technological change.
Before long, the world will wake up. But right now, there are perhaps a few hundred people, most of them in San Francisco and the AI labs, that have situational awareness. Through whatever peculiar forces of fate, I have found myself amongst them. A few years ago, these people were derided as crazy—but they trusted the trendlines, which allowed them to correctly predict the AI advances of the past few years. Whether these people are also right about the next few years remains to be seen. But these are very smart people—the smartest people I have ever met—and they are the ones building this technology. Perhaps they will be an odd footnote in history, or perhaps they will go down in history like Szilard and Oppenheimer and Teller. If they are seeing the future even close to correctly, we are in for a wild ride.
Let me tell you what we see.
5. MongoDB Documentation, Release 2.6.4
See About MongoDB Documentation (page 811) for more information about the MongoDB Documentation project,
this Manual and additional editions of this text.
Note: This version of the PDF does not include the reference section, see MongoDB Reference Manual1 for a PDF
edition of all MongoDB Reference Material.
1http://docs.mongodb.org/master/MongoDB-reference-manual.pdf
Contents 1
7. CHAPTER 1
Introduction to MongoDB
Welcome to MongoDB. This document provides a brief introduction to MongoDB and some key concepts. See the
installation guides (page 5) for information on downloading and installing MongoDB.
1.1 What is MongoDB
MongoDB is an open-source document database that provides high performance, high availability, and automatic
scaling.
1.1.1 Document Database
A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB docu-ments
are similar to JSON objects. The values of fields may include other documents, arrays, and arrays of documents.
Figure 1.1: A MongoDB document.
The advantages of using documents are:
• Documents (i.e. objects) correspond to native data types in many programming languages.
• Embedded documents and arrays reduce need for expensive joins.
• Dynamic schema supports fluent polymorphism.
3
8. MongoDB Documentation, Release 2.6.4
1.1.2 Key Features
High Performance
MongoDB provides high performance data persistence. In particular,
• Support for embedded data models reduces I/O activity on database system.
• Indexes support faster queries and can include keys from embedded documents and arrays.
High Availability
To provide high availability, MongoDB’s replication facility, called replica sets, provide:
• automatic failover.
• data redundancy.
A replica set (page 503) is a group of MongoDB servers that maintain the same data set, providing redundancy and
increasing data availability.
Automatic Scaling
MongoDB provides horizontal scalability as part of its core functionality.
• Automatic sharding (page 607) distributes data across a cluster of machines.
• Replica sets can provide eventually-consistent reads for low-latency high throughput deployments.
4 Chapter 1. Introduction to MongoDB
9. CHAPTER 2
Install MongoDB
MongoDB runs on most platforms and supports both 32-bit and 64-bit architectures.
2.1 Installation Guides
See the Release Notes (page 725) for information about specific releases of MongoDB.
Install on Linux (page 6) Documentations for installing the official MongoDB distribution on Linux-based systems.
Install on Red Hat (page 6) Install MongoDB on Red Hat Enterprise, CentOS, Fedora and related Linux sys-tems
using .rpm packages.
Install on Ubuntu (page 9) Install MongoDB on Ubuntu Linux systems using .deb packages.
Install on Debian (page 12) Install MongoDB on Debian systems using .deb packages.
Install on Other Linux Systems (page 14) Install the official build of MongoDB on other Linux systems from
MongoDB archives.
Install on OS X (page 16) Install the official build of MongoDB on OS X systems from Homebrew packages or from
MongoDB archives.
Install on Windows (page 19) Install MongoDB on Windows systems and optionally start MongoDB as a Windows
service.
Install MongoDB Enterprise (page 24) MongoDB Enterprise is available for MongoDB Enterprise subscribers and
includes several additional features including support for SNMP monitoring, LDAP authentication, Kerberos
authentication, and System Event Auditing.
Install MongoDB Enterprise on Red Hat (page 24) Install the MongoDB Enterprise build and required depen-dencies
on Red Hat Enterprise or CentOS Systems using packages.
Install MongoDB Enterprise on Ubuntu (page 27) Install the MongoDB Enterprise build and required depen-dencies
on Ubuntu Linux Systems using packages.
Install MongoDB Enterprise on Debian (page 30) Install the MongoDB Enterprise build and required depen-dencies
on Debian Linux Systems using packages.
Install MongoDB Enterprise on SUSE (page 32) Install the MongoDB Enterprise build and required depen-dencies
on SUSE Enterprise Linux.
Install MongoDB Enterprise on Amazon AMI (page 34) Install the MongoDB Enterprise build and required
dependencies on Amazon Linux AMI.
Install MongoDB Enterprise on Windows (page 36) Install the MongoDB Enterprise build and required de-pendencies
using the .msi installer.
5
10. MongoDB Documentation, Release 2.6.4
2.1.1 Install on Linux
These documents provide instructions to install MongoDB for various Linux systems.
Recommended
For easy installation, MongoDB provides packages for popular Linux distributions. The following guides detail the
installation process for these systems:
Install on Red Hat (page 6) Install MongoDB on Red Hat Enterprise, CentOS, Fedora and related Linux systems
using .rpm packages.
Install on Ubuntu (page 9) Install MongoDB on Ubuntu Linux systems using .deb packages.
Install on Debian (page 12) Install MongoDB on Debian systems using .deb packages.
For systems without supported packages, refer to the Manual Installation tutorial.
Manual Installation
Although packages are the preferred installation method, for Linux systems without supported packages, see the
following guide:
Install on Other Linux Systems (page 14) Install the official build of MongoDB on other Linux systems from Mon-goDB
archives.
Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux
Overview Use this tutorial to install MongoDB on Red Hat Enterprise Linux, CentOS Linux, Fedora Linux, or a
related system from .rpm packages. While some of these distributions include their own MongoDB packages, the
official MongoDB packages are generally more up to date.
Packages MongoDB provides packages of the officially supported MongoDB builds in it’s own repository. This
repository provides the MongoDB distribution in the following packages:
• mongodb-org
This package is a metapackage that will automatically install the four component packages listed below.
• mongodb-org-server
This package contains the mongod daemon and associated configuration and init scripts.
• mongodb-org-mongos
This package contains the mongos daemon.
• mongodb-org-shell
This package contains the mongo shell.
• mongodb-org-tools
This package contains the following MongoDB tools: mongoimport bsondump, mongodump,
mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore,
mongostat, and mongotop.
6 Chapter 2. Install MongoDB
11. MongoDB Documentation, Release 2.6.4
Control Scripts The mongodb-org package includes various control scripts, including the init script
/etc/rc.d/init.d/mongod. These scripts are used to stop, start, and restart daemon processes.
The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts. See
http://docs.mongodb.org/manualreference/configuration-options for documentation of the
configuration file.
As of version 2.6.4, there are no control scripts for mongos. The mongos process is used only in sharding (page 613).
You can use the mongod init script to derive your own mongos control script for use in such environments. See the
mongos reference for configuration details.
Warning: With the introduction of systemd in Fedora 15, the control scripts included in the packages available
in the MongoDB downloads repository are not compatible with Fedora systems. A correction is forthcoming; see
SERVER-7285a for more information. In the mean time use your own control scripts or install using the procedure
outlined in Install MongoDB on Linux Systems (page 14).
ahttps://jira.mongodb.org/browse/SERVER-7285
Considerations For production deployments, always run MongoDB on 64-bit systems.
The default /etc/mongodb.conf configuration file supplied by the 2.6 series packages has bind_ip‘ set to
127.0.0.1 by default. Modify this setting as needed for your environment before initializing a replica set.
Changed in version 2.6: The package structure and names have changed as of version 2.6. For instructions on instal-lation
of an older release, please refer to the documentation for the appropriate version.
Install MongoDB
Step 1: Configure the package management system (YUM). Create a /etc/yum.repos.d/mongodb.repo
file to hold the following configuration information for the MongoDB repository:
If you are running a 64-bit system, use the following configuration:
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1
If you are running a 32-bit system, which is not recommended for production deployments, use the following config-uration:
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/
gpgcheck=0
enabled=1
Step 2: Install the MongoDB packages and associated tools. When you install the packages, you choose whether
to install the current release or a previous one. This step provides the commands for both.
To install the latest stable version of MongoDB, issue the following command:
sudo yum install -y mongodb-org
2.1. Installation Guides 7
12. MongoDB Documentation, Release 2.6.4
To install a specific release of MongoDB, specify each component package individually and append the version number
to the package name, as in the following example that installs the 2.6.1‘ release of MongoDB:
sudo yum install -y mongodb-org-2.6.1 mongodb-org-server-2.6.1 mongodb-org-shell-2.6.1 mongodb-org-mongos-You can specify any available version of MongoDB. However yum will upgrade the packages when a newer version
becomes available. To prevent unintended upgrades, pin the package. To pin a package, add the following exclude
directive to your /etc/yum.conf file:
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
Previous versions of MongoDB packages use different naming conventions. See the 2.4 version of documentation for
more information1.
Run MongoDB
Important: You must configure SELinux to allow MongoDB to start on Red Hat Linux-based systems (Red Hat
Enterprise Linux, CentOS, Fedora). Administrators have three options:
• enable access to the relevant ports (e.g. 27017) for SELinux. See Default MongoDB Port (page 380) for more
information on MongoDB’s default ports. For default settings, this can be accomplished by running
semanage port -a -t mongodb_port_t -p tcp 27017
• set SELinux to permissive mode in /etc/selinux.conf. The line
SELINUX=enforcing
should be changed to
SELINUX=permissive
• disable SELinux entirely; as above but set
SELINUX=disabled
All three options require root privileges. The latter two options each requires a system reboot and may have larger
implications for your deployment.
You may alternatively choose not to install the SELinux packages when you are installing your Linux operating system,
or choose to remove the relevant packages. This option is the most invasive and is not recommended.
The MongoDB instance stores its data files in /var/lib/mongo and its log files in /var/log/mongodb
by default, and runs using the mongod user account. You can specify alternate log and data file directories in
/etc/mongodb.conf. See systemLog.path and storage.dbPath for additional information.
If you change the user that runs the MongoDB process, you must modify the access control rights to the
/var/lib/mongo and /var/log/mongodb directories to give this users access to these directories.
Step 1: Start MongoDB. You can start the mongod process by issuing the following command:
sudo service mongod start
Step 2: Verify that MongoDB has started successfully You can verify that the mongod process has started suc-cessfully
by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading
1http://docs.mongodb.org/v2.4/tutorial/install-mongodb-on-linux
8 Chapter 2. Install MongoDB
13. MongoDB Documentation, Release 2.6.4
[initandlisten] waiting for connections on port <port>
where <port> is the port configured in /etc/mongod.conf, 27017 by default.
You can optionally ensure that MongoDB will start following a system reboot by issuing the following command:
sudo chkconfig mongod on
Step 3: Stop MongoDB. As needed, you can stop the mongod process by issuing the following command:
sudo service mongod stop
Step 4: Restart MongoDB. You can restart the mongod process by issuing the following command:
sudo service mongod restart
You can follow the state of the process for errors or important messages by watching the output in the
/var/log/mongodb/mongod.log file.
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Install MongoDB on Ubuntu
Overview Use this tutorial to install MongoDB on Ubuntu Linux systems from .deb packages. While Ubuntu
includes its own MongoDB packages, the official MongoDB packages are generally more up-to-date.
Note: If you use an older Ubuntu that does not use Upstart (i.e. any version before 9.10 “Karmic”), please follow the
instructions on the Install MongoDB on Debian (page 12) tutorial.
Packages MongoDB provides packages of the officially supported MongoDB builds in it’s own repository. This
repository provides the MongoDB distribution in the following packages:
• mongodb-org
This package is a metapackage that will automatically install the four component packages listed below.
• mongodb-org-server
This package contains the mongod daemon and associated configuration and init scripts.
• mongodb-org-mongos
This package contains the mongos daemon.
• mongodb-org-shell
This package contains the mongo shell.
• mongodb-org-tools
This package contains the following MongoDB tools: mongoimport bsondump, mongodump,
mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore,
mongostat, and mongotop.
2.1. Installation Guides 9
14. MongoDB Documentation, Release 2.6.4
Control Scripts The mongodb-org package includes various control scripts, including the init script
/etc/init.d/mongod. These scripts are used to stop, start, and restart daemon processes.
The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts. See
http://docs.mongodb.org/manualreference/configuration-options for documentation of the
configuration file.
As of version 2.6.4, there are no control scripts for mongos. The mongos process is used only in sharding (page 613).
You can use the mongod init script to derive your own mongos control script for use in such environments. See the
mongos reference for configuration details.
Considerations For production deployments, always run MongoDB on 64-bit systems.
You cannot install this package concurrently with the mongodb, mongodb-server, or mongodb-clients pack-ages
provided by Ubuntu.
The default /etc/mongodb.conf configuration file supplied by the 2.6 series packages has bind_ip‘ set to
127.0.0.1 by default. Modify this setting as needed for your environment before initializing a replica set.
Changed in version 2.6: The package structure and names have changed as of version 2.6. For instructions on instal-lation
of an older release, please refer to the documentation for the appropriate version.
Install MongoDB
Step 1: Import the public key used by the package management system. The Ubuntu package management tools
(i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with
GPG keys. Issue the following command to import the MongoDB public GPG Key2:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Step 2: Create a list file for MongoDB. Create the /etc/apt/sources.list.d/mongodb.list list file
using the following command:
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.Step 3: Reload local package database. Issue the following command to reload the local package database:
sudo apt-get update
Step 4: Install the MongoDB packages. You can install either the latest stable version of MongoDB or a specific
version of MongoDB.
Install the latest stable version of MongoDB. Issue the following command:
sudo apt-get install -y mongodb-org
Install a specific release of MongoDB. Specify each component package individually and append the version num-ber
to the package name, as in the following example that installs the 2.6.1 release of MongoDB:
2http://docs.mongodb.org/10gen-gpg-key.asc
10 Chapter 2. Install MongoDB
15. MongoDB Documentation, Release 2.6.4
sudo apt-get install -y mongodb-org=2.6.1 mongodb-org-server=2.6.1 mongodb-org-shell=2.6.1 mongodb-org-Pin a specific version of MongoDB. Although you can specify any available version of MongoDB, apt-get will
upgrade the packages when a newer version becomes available. To prevent unintended upgrades, pin the package. To
pin the version of MongoDB at the currently installed version, issue the following command sequence:
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
Previous versions of MongoDB packages use different naming conventions. See the 2.4 version of documentation for
more information3.
Run MongoDB The MongoDB instance stores its data files in /var/lib/mongodb and its log files in
/var/log/mongodb by default, and runs using the mongodb user account. You can specify alternate log and
data file directories in /etc/mongodb.conf. See systemLog.path and storage.dbPath for additional
information.
If you change the user that runs the MongoDB process, you must modify the access control rights to the
/var/lib/mongodb and /var/log/mongodb directories to give this users access to these directories.
Step 1: Start MongoDB. Issue the following command to start mongod:
sudo service mongod start
Step 2: Verify that MongoDB has started successfully Verify that the mongod process has started successfully
by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading
[initandlisten] waiting for connections on port <port>
where <port> is the port configured in /etc/mongod.conf, 27017 by default.
Step 3: Stop MongoDB. As needed, you can stop the mongod process by issuing the following command:
sudo service mongod stop
Step 4: Restart MongoDB. Issue the following command to restart mongod:
sudo service mongod restart
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
3http://docs.mongodb.org/v2.4/tutorial/install-mongodb-on-ubuntu
2.1. Installation Guides 11
16. MongoDB Documentation, Release 2.6.4
Install MongoDB on Debian
Overview Use this tutorial to install MongoDB on Debian systems from .deb packages. While some Debian
distributions include their own MongoDB packages, the official MongoDB packages are generally more up to date.
Note: This tutorial applies to both Debian systems and versions of Ubuntu Linux prior to 9.10 “Karmic” which do
not use Upstart. Other Ubuntu users will want to follow the Install MongoDB on Ubuntu (page 9) tutorial.
Packages MongoDB provides packages of the officially supported MongoDB builds in it’s own repository. This
repository provides the MongoDB distribution in the following packages:
• mongodb-org
This package is a metapackage that will automatically install the four component packages listed below.
• mongodb-org-server
This package contains the mongod daemon and associated configuration and init scripts.
• mongodb-org-mongos
This package contains the mongos daemon.
• mongodb-org-shell
This package contains the mongo shell.
• mongodb-org-tools
This package contains the following MongoDB tools: mongoimport bsondump, mongodump,
mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore,
mongostat, and mongotop.
Control Scripts The mongodb-org package includes various control scripts, including the init script
/etc/init.d/mongod. These scripts are used to stop, start, and restart daemon processes.
The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts. See
http://docs.mongodb.org/manualreference/configuration-options for documentation of the
configuration file.
As of version 2.6.4, there are no control scripts for mongos. The mongos process is used only in sharding (page 613).
You can use the mongod init script to derive your own mongos control script for use in such environments. See the
mongos reference for configuration details.
Considerations For production deployments, always run MongoDB on 64-bit systems.
You cannot install this package concurrently with the mongodb, mongodb-server, or mongodb-clients pack-ages
that your release of Debian may include.
The default /etc/mongodb.conf configuration file supplied by the 2.6 series packages has bind_ip‘ set to
127.0.0.1 by default. Modify this setting as needed for your environment before initializing a replica set.
Changed in version 2.6: The package structure and names have changed as of version 2.6. For instructions on instal-lation
of an older release, please refer to the documentation for the appropriate version.
Install MongoDB The Debian package management tools (i.e. dpkg and apt) ensure package consistency and
authenticity by requiring that distributors sign packages with GPG keys.
12 Chapter 2. Install MongoDB
17. MongoDB Documentation, Release 2.6.4
Step 1: Import the public key used by the package management system. Issue the following command to add
the MongoDB public GPG Key4 to the system key ring.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Step 2: Create a /etc/apt/sources.list.d/mongodb.list file for MongoDB. Create the list file using
the following command:
echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.Step 3: Reload local package database. Issue the following command to reload the local package database:
sudo apt-get update
Step 4: Install the MongoDB packages. You can install either the latest stable version of MongoDB or a specific
version of MongoDB.
Install the latest stable version of MongoDB. Issue the following command:
sudo apt-get install -y mongodb-org
Install a specific release of MongoDB. Specify each component package individually and append the version num-ber
to the package name, as in the following example that installs the 2.6.1 release of MongoDB:
sudo apt-get install -y mongodb-org=2.6.1 mongodb-org-server=2.6.1 mongodb-org-shell=2.6.1 mongodb-org-Pin a specific version of MongoDB. Although you can specify any available version of MongoDB, apt-get will
upgrade the packages when a newer version becomes available. To prevent unintended upgrades, pin the package. To
pin the version of MongoDB at the currently installed version, issue the following command sequence:
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
Previous versions of MongoDB packages use different naming conventions. See the 2.4 version of documentation for
more information5.
Run MongoDB The MongoDB instance stores its data files in /var/lib/mongodb and its log files in
/var/log/mongodb by default, and runs using the mongodb user account. You can specify alternate log and
data file directories in /etc/mongodb.conf. See systemLog.path and storage.dbPath for additional
information.
If you change the user that runs the MongoDB process, you must modify the access control rights to the
/var/lib/mongodb and /var/log/mongodb directories to give this users access to these directories.
4http://docs.mongodb.org/10gen-gpg-key.asc
5http://docs.mongodb.org/v2.4/tutorial/install-mongodb-on-ubuntu
2.1. Installation Guides 13
18. MongoDB Documentation, Release 2.6.4
Step 1: Start MongoDB. Issue the following command to start mongod:
sudo service mongod start
Step 2: Verify that MongoDB has started successfully Verify that the mongod process has started successfully
by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading
[initandlisten] waiting for connections on port <port>
where <port> is the port configured in /etc/mongod.conf, 27017 by default.
Step 3: Stop MongoDB. As needed, you can stop the mongod process by issuing the following command:
sudo service mongod stop
Step 4: Restart MongoDB. Issue the following command to restart mongod:
sudo service mongod restart
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Install MongoDB on Linux Systems
Overview Compiled versions of MongoDB for Linux provide a simple option for installing MongoDB for other
Linux systems without supported packages.
Considerations For production deployments, always run MongoDB on 64-bit systems.
Install MongoDB MongoDB provides archives for both 64-bit and 32-bit Linux. Follow the installation procedure
appropriate for your system.
Install for 64-bit Linux
Step 1: Download the binary files for the desired release of MongoDB. Download the binaries from
https://www.mongodb.org/downloads.
For example, to download the latest release through the shell, issue the following:
curl -O http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.4.tgz
Step 2: Extract the files from the downloaded archive. For example, from a system shell, you can extract through
the tar command:
tar -zxvf mongodb-linux-x86_64-2.6.4.tgz
14 Chapter 2. Install MongoDB
19. MongoDB Documentation, Release 2.6.4
Step 3: Copy the extracted archive to the target directory. Copy the extracted folder to the location from which
MongoDB will run.
mkdir -p mongodb
cp -R -n mongodb-linux-x86_64-2.6.4/ mongodb
Step 4: Ensure the location of the binaries is in the PATH variable. The MongoDB binaries are in the bin/
directory of the archive. To ensure that the binaries are in your PATH, you can modify your PATH.
For example, you can add the following line to your shell’s rc file (e.g. ~/.bashrc):
export PATH=<mongodb-install-directory>/bin:$PATH
Replace <mongodb-install-directory> with the path to the extracted MongoDB archive.
Install for 32-bit Linux
Step 1: Download the binary files for the desired release of MongoDB. Download the binaries from
https://www.mongodb.org/downloads.
For example, to download the latest release through the shell, issue the following:
curl -O http://downloads.mongodb.org/linux/mongodb-linux-i686-2.6.4.tgz
Step 2: Extract the files from the downloaded archive. For example, from a system shell, you can extract through
the tar command:
tar -zxvf mongodb-linux-i686-2.6.4.tgz
Step 3: Copy the extracted archive to the target directory. Copy the extracted folder to the location from which
MongoDB will run.
mkdir -p mongodb
cp -R -n mongodb-linux-i686-2.6.4/ mongodb
Step 4: Ensure the location of the binaries is in the PATH variable. The MongoDB binaries are in the bin/
directory of the archive. To ensure that the binaries are in your PATH, you can modify your PATH.
For example, you can add the following line to your shell’s rc file (e.g. ~/.bashrc):
export PATH=<mongodb-install-directory>/bin:$PATH
Replace <mongodb-install-directory> with the path to the extracted MongoDB archive.
Run MongoDB
Step 1: Create the data directory. Before you start MongoDB for the first time, create the directory to which
the mongod process will write data. By default, the mongod process uses the /data/db directory. If you create a
directory other than this one, you must specify that directory in the dbpath option when starting the mongod process
later in this procedure.
The following example command creates the default /data/db directory:
2.1. Installation Guides 15
20. MongoDB Documentation, Release 2.6.4
mkdir -p /data/db
Step 2: Set permissions for the data directory. Before running mongod for the first time, ensure that the user
account running mongod has read and write permissions for the directory.
Step 3: Run MongoDB. To run MongoDB, run the mongod process at the system prompt. If necessary, specify the
path of the mongod or the data directory. See the following examples.
Run without specifying paths If your system PATH variable includes the location of the mongod binary and if you
use the default data directory (i.e., /data/db), simply enter mongod at the system prompt:
mongod
Specify the path of the mongod If your PATH does not include the location of the mongod binary, enter the full
path to the mongod binary at the system prompt:
<path to binary>/mongod
Specify the path of the data directory If you do not use the default data directory (i.e., /data/db), specify the
path to the data directory using the --dbpath option:
mongod --dbpath <path to data directory>
Step 4: Stop MongoDB as needed. To stop MongoDB, press Control+C in the terminal where the mongod
instance is running.
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
2.1.2 Install MongoDB on OS X
Overview
Use this tutorial to install MongoDB on on OS X systems.
Platform Support
Starting in version 2.4, MongoDB only supports OS X versions 10.6 (Snow Leopard) on Intel x86-64 and later.
MongoDB is available through the popular OS X package manager Homebrew6 or through the MongoDB Download
site7.
Install MongoDB
You can install MongoDB with Homebrew8 or manually. This section describes both.
6http://brew.sh/
7http://www.mongodb.org/downloads
8http://brew.sh/
16 Chapter 2. Install MongoDB
21. MongoDB Documentation, Release 2.6.4
Install MongoDB with Homebrew
Homebrew9 installs binary packages based on published “formulae.” This section describes how to update brew to
the latest packages and install MongoDB. Homebrew requires some initial setup and configuration, which is beyond
the scope of this document.
Step 1: Update Homebrew’s package database.
In a system shell, issue the following command:
brew update
Step 2: Install MongoDB.
You can install MongoDB with via brew with several different options. Use one of the following operations:
Install the MongoDB Binaries To install the MongoDB binaries, issue the following command in a system shell:
brew install mongodb
Build MongoDB from Source with SSL Support To build MongoDB from the source files and include SSL sup-port,
issue the following from a system shell:
brew install mongodb --with-openssl
Install the Latest Development Release of MongoDB To install the latest development release for use in testing
and development, issue the following command in a system shell:
brew install mongodb --devel
Install MongoDB Manually
Only install MongoDB using this procedure if you cannot use homebrew (page 17).
Step 1: Download the binary files for the desired release of MongoDB.
Download the binaries from https://www.mongodb.org/downloads.
For example, to download the latest release through the shell, issue the following:
curl -O http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.4.tgz
Step 2: Extract the files from the downloaded archive.
For example, from a system shell, you can extract through the tar command:
9http://brew.sh/
2.1. Installation Guides 17
22. MongoDB Documentation, Release 2.6.4
tar -zxvf mongodb-osx-x86_64-2.6.4.tgz
Step 3: Copy the extracted archive to the target directory.
Copy the extracted folder to the location from which MongoDB will run.
mkdir -p mongodb
cp -R -n mongodb-osx-x86_64-2.6.4/ mongodb
Step 4: Ensure the location of the binaries is in the PATH variable.
The MongoDB binaries are in the bin/ directory of the archive. To ensure that the binaries are in your PATH, you
can modify your PATH.
For example, you can add the following line to your shell’s rc file (e.g. ~/.bashrc):
export PATH=<mongodb-install-directory>/bin:$PATH
Replace <mongodb-install-directory> with the path to the extracted MongoDB archive.
Run MongoDB
Step 1: Create the data directory.
Before you start MongoDB for the first time, create the directory to which the mongod process will write data. By
default, the mongod process uses the /data/db directory. If you create a directory other than this one, you must
specify that directory in the dbpath option when starting the mongod process later in this procedure.
The following example command creates the default /data/db directory:
mkdir -p /data/db
Step 2: Set permissions for the data directory.
Before running mongod for the first time, ensure that the user account running mongod has read and write permis-sions
for the directory.
Step 3: Run MongoDB.
To run MongoDB, run the mongod process at the system prompt. If necessary, specify the path of the mongod or the
data directory. See the following examples.
Run without specifying paths If your system PATH variable includes the location of the mongod binary and if you
use the default data directory (i.e., /data/db), simply enter mongod at the system prompt:
mongod
18 Chapter 2. Install MongoDB
23. MongoDB Documentation, Release 2.6.4
Specify the path of the mongod If your PATH does not include the location of the mongod binary, enter the full
path to the mongod binary at the system prompt:
<path to binary>/mongod
Specify the path of the data directory If you do not use the default data directory (i.e., /data/db), specify the
path to the data directory using the --dbpath option:
mongod --dbpath <path to data directory>
Step 4: Stop MongoDB as needed.
To stop MongoDB, press Control+C in the terminal where the mongod instance is running.
Step 5: Begin using MongoDB.
To begin using MongoDB, see Getting Started with MongoDB (page 43). Also consider the Production Notes
(page 188) document before deploying MongoDB in a production environment.
2.1.3 Install MongoDB on Windows
Overview
Use this tutorial to install MongoDB on a Windows systems.
Platform Support
Starting in version 2.2, MongoDB does not support Windows XP. Please use a more recent version of Windows to use
more recent releases of MongoDB.
Important: If you are running any edition of Windows Server 2008 R2 or Windows 7, please install a hotfix to
resolve an issue with memory mapped files on Windows10.
Install MongoDB
Step 1: Determine which MongoDB build you need.
There are three builds of MongoDB for Windows:
MongoDB for Windows Server 2008 R2 edition (i.e. 2008R2) runs only on Windows Server 2008 R2, Windows 7
64-bit, and newer versions of Windows. This build takes advantage of recent enhancements to the Windows Platform
and cannot operate on older versions of Windows.
MongoDB forWindows 64-bit runs on any 64-bit version of Windows newer than Windows XP, including Windows
Server 2008 R2 and Windows 7 64-bit.
MongoDB for Windows 32-bit runs on any 32-bit version of Windows newer than Windows XP. 32-bit versions of
MongoDB are only intended for older systems and for use in testing and development systems. 32-bit versions of
MongoDB only support databases smaller than 2GB.
10http://support.microsoft.com/kb/2731284
2.1. Installation Guides 19
24. MongoDB Documentation, Release 2.6.4
To find which version of Windows you are running, enter the following command in the Command Prompt:
wmic os get osarchitecture
Step 2: Download MongoDB for Windows.
Download the latest production release of MongoDB from the MongoDB downloads page11. Ensure you download
the correct version of MongoDB for your Windows system. The 64-bit versions of MongoDB does not work with
32-bit Windows.
Step 3: Install the downloaded file.
InWindows Explorer, locate the downloaded MongoDB msi file, which typically is located in the default Downloads
folder. Double-click the msi file. A set of screens will appear to guide you through the installation process.
Step 4: Move the MongoDB folder to another location (optional).
To move the MongoDB folder, you must issue the move command as an Administrator. For example, to move the
folder to C:mongodb:
Select Start Menu > All Programs > Accessories.
Right-click Command Prompt and select Run as Administrator from the popup menu.
Issue the following commands:
cd
move C:mongodb-win32-* C:mongodb
MongoDB is self-contained and does not have any other system dependencies. You can run MongoDB from any folder
you choose. You may install MongoDB in any folder (e.g. D:testmongodb)
Run MongoDB
Warning: Do not make mongod.exe visible on public networks without running in “Secure Mode” with the
auth setting. MongoDB is designed to be run in trusted environments, and the database does not enable “Secure
Mode” by default.
Step 1: Set up the MongoDB environment.
MongoDB requires a data directory to store all data. MongoDB’s default data directory path is datadb. Create
this folder using the following commands from a Command Prompt:
md datadb
You can specify an alternate path for data files using the --dbpath option to mongod.exe, for example:
C:mongodbbinmongod.exe --dbpath d:testmongodbdata
If your path includes spaces, enclose the entire path in double quotes, for example:
11http://www.mongodb.org/downloads
20 Chapter 2. Install MongoDB
25. MongoDB Documentation, Release 2.6.4
C:mongodbbinmongod.exe --dbpath "d:testmongo db data"
Step 2: Start MongoDB.
To start MongoDB, run mongod.exe. For example, from the Command Prompt:
C:Program FilesMongoDBbinmongod.exe
This starts the main MongoDB database process. The waiting for connections message in the console
output indicates that the mongod.exe process is running successfully.
Depending on the security level of your system, Windows may pop up a Security Alert dialog box about block-ing
“some features” of C:Program FilesMongoDBbinmongod.exe from communicating on networks.
All users should select Private Networks, such as my home or work network and click Allow
access. For additional information on security and MongoDB, please see the Security Documentation (page 281).
Step 3: Connect to MongoDB.
To connect to MongoDB through the mongo.exe shell, open another Command Prompt. When connecting, specify
the data directory if necessary. This step provides several example connection commands.
If your MongoDB installation uses the default data directory, connect without specifying the data directory:
C:mongodbbinmongo.exe
If you installation uses a different data directory, specify the directory when connecting, as in this example:
C:mongodbbinmongod.exe --dbpath d:testmongodbdata
If your path includes spaces, enclose the entire path in double quotes. For example:
C:mongodbbinmongod.exe --dbpath "d:testmongo db data"
If you want to develop applications using .NET, see the documentation of C# and MongoDB12 for more information.
Step 4: Begin using MongoDB.
To begin using MongoDB, see Getting Started with MongoDB (page 43). Also consider the Production Notes
(page 188) document before deploying MongoDB in a production environment.
Configure a Windows Service for MongoDB
Note: There is a known issue for MongoDB 2.6.0, SERVER-1351513, which prevents the use of the instructions
in this section. For MongoDB 2.6.0, use Manually Create a Windows Service for MongoDB (page 22) to create a
Windows Service for MongoDB instead.
12http://docs.mongodb.org/ecosystem/drivers/csharp
13https://jira.mongodb.org/browse/SERVER-13515
2.1. Installation Guides 21
26. MongoDB Documentation, Release 2.6.4
Step 1: Configure directories and files.
Create a configuration file and a directory path for MongoDB log output (logpath):
Create a specific directory for MongoDB log files:
md "C:Program FilesMongoDBlog"
In the Command Prompt, create a configuration file for the logpath option for MongoDB:
echo logpath="C:Program FilesMongoDBlogmongo.log" > "C:Program FilesMongoDBmongod.cfg"
Step 2: Run the MongoDB service.
Run all of the following commands in Command Prompt with “Administrative Privileges:”
Install the MongoDB service. For --install to succeed, you must specify the logpath run-time option.
"C:Program FilesMongoDBbinmongod.exe" --config "C:Program FilesMongoDBmongod.cfg" --install
Modify the path to the mongod.cfg file as needed.
To use an alternate dbpath, specify the path in the configuration file (e.g. C:Program
FilesMongoDBmongod.cfg) or on the command line with the --dbpath option.
If the dbpath directory does not exist, mongod.exe will not start. The default value for dbpath is datadb.
If needed, you can install services for multiple instances of mongod.exe or mongos.exe. Install each service with
a unique --serviceName and --serviceDisplayName. Use multiple instances only when sufficient system
resources exist and your system design requires it.
Step 3: Stop or remove the MongoDB service as needed.
To stop the MongoDB service use the following command:
net stop MongoDB
To remove the MongoDB service use the following command:
"C:Program FilesMongoDBbinmongod.exe" --remove
Manually Create a Windows Service for MongoDB
The following procedure assumes you have installed MongoDB using the MSI installer, with the default path
C:Program FilesMongoDB 2.6 Standard.
If you have installed in an alternative directory, you will need to adjust the paths as appropriate.
Step 1: Open an Administrator command prompt.
Windows 7 / Vista / Server 2008 (and R2) Press Win + R, then type cmd, then press Ctrl + Shift +
Enter.
22 Chapter 2. Install MongoDB
27. MongoDB Documentation, Release 2.6.4
Windows 8 Press Win + X, then press A.
Execute the remaining steps from the Administrator command prompt.
Step 2: Create directories.
Create directories for your database and log files:
mkdir c:datadb
mkdir c:datalog
Step 3: Create a configuration file.
Create a configuration file. This file can include any of the configuration options for mongod, but
must include a valid setting for logpath:
The following creates a configuration file, specifying both the logpath and the dbpath settings in the configuration
file:
echo logpath=c:datalogmongod.log> "C:Program FilesMongoDB 2.6 Standardmongod.cfg"
echo dbpath=c:datadb>> "C:Program FilesMongoDB 2.6 Standardmongod.cfg"
Step 4: Create the MongoDB service.
Create the MongoDB service.
sc.exe create MongoDB binPath= ""C:Program FilesMongoDB 2.6 Standardbinmongod.exe" --service --sc.exe requires a space between “=” and the configuration values (eg “binPath= ”), and a “” to escape double quotes.
If successfully created, the following log message will display:
[SC] CreateService SUCCESS
Step 5: Start the MongoDB service.
net start MongoDB
Step 6: Stop or remove the MongoDB service as needed.
To stop the MongoDB service, use the following command:
net stop MongoDB
To remove the MongoDB service, first stop the service and then run the following command:
sc.exe delete MongoDB
2.1. Installation Guides 23
28. MongoDB Documentation, Release 2.6.4
2.1.4 Install MongoDB Enterprise
These documents provide instructions to install MongoDB Enterprise for Linux and Windows Systems.
Install MongoDB Enterprise on Red Hat (page 24) Install the MongoDB Enterprise build and required dependen-cies
on Red Hat Enterprise or CentOS Systems using packages.
Install MongoDB Enterprise on Ubuntu (page 27) Install the MongoDB Enterprise build and required dependencies
on Ubuntu Linux Systems using packages.
Install MongoDB Enterprise on Debian (page 30) Install the MongoDB Enterprise build and required dependencies
on Debian Linux Systems using packages.
Install MongoDB Enterprise on SUSE (page 32) Install the MongoDB Enterprise build and required dependencies
on SUSE Enterprise Linux.
Install MongoDB Enterprise on Amazon AMI (page 34) Install the MongoDB Enterprise build and required depen-dencies
on Amazon Linux AMI.
Install MongoDB Enterprise on Windows (page 36) Install the MongoDB Enterprise build and required dependen-cies
using the .msi installer.
Install MongoDB Enterprise on Red Hat Enterprise or CentOS
Overview
Use this tutorial to install MongoDB Enterprise on Red Hat Enterprise Linux or CentOS Linux from .rpm packages.
Packages
MongoDB provides packages of the officially supported MongoDB Enterprise builds in it’s own repository. This
repository provides the MongoDB Enterprise distribution in the following packages:
• mongodb-enterprise
This package is a metapackage that will automatically install the four component packages listed below.
• mongodb-enterprise-server
This package contains the mongod daemon and associated configuration and init scripts.
• mongodb-enterprise-mongos
This package contains the mongos daemon.
• mongodb-enterprise-shell
This package contains the mongo shell.
• mongodb-enterprise-tools
This package contains the following MongoDB tools: mongoimport bsondump, mongodump,
mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore,
mongostat, and mongotop.
24 Chapter 2. Install MongoDB
29. MongoDB Documentation, Release 2.6.4
Control Scripts
The mongodb-enterprise package includes various control scripts, including the init script
/etc/rc.d/init.d/mongod.
The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts.
As of version 2.6.4, there are no control scripts for mongos. The mongos process is used only in sharding (page 613).
You can use the mongod init script to derive your own mongos control script.
Considerations
MongoDB only provides Enterprise packages for Red Hat Enterprise Linux and CentOS Linux versions 5 and 6,
64-bit.
The default /etc/mongodb.conf configuration file supplied by the 2.6 series packages has bind_ip‘ set to
127.0.0.1 by default. Modify this setting as needed for your environment before initializing a replica set.
Changed in version 2.6: The package structure and names have changed as of version 2.6. For instructions on instal-lation
of an older release, please refer to the documentation for the appropriate version.
Install MongoDB Enterprise
When you install the packages for MongoDB Enterprise, you choose whether to install the current release or a previous
one. This procedure describes how to do both.
Step 1: Configure repository. Create an /etc/yum.repos.d/mongodb-enterprise.repo file so that
you can install MongoDB enterprise directly, using yum.
Use the following repository file to specify the latest stable release of MongoDB enterprise.
[mongodb-enterprise]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/stable/$basearch/
gpgcheck=0
enabled=1
Use the following repository to install only versions of MongoDB for the 2.6 release. If you’d like to install Mon-goDB
Enterprise packages from a particular release series (page 808), such as 2.4 or 2.6, you can specify the re-lease
series in the repository configuration. For example, to restrict your system to the 2.6 release series, create a
/etc/yum.repos.d/mongodb-enterprise-2.6.repo file to hold the following configuration information
for the MongoDB Enterprise 2.6 repository:
[mongodb-enterprise-2.6]
name=MongoDB Enterprise 2.6 Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/2.6/$basearch/
gpgcheck=0
enabled=1
.repo files for each release can also be found in the repository itself14. Remember that odd-numbered minor release
versions (e.g. 2.5) are development versions and are unsuitable for production deployment.
Step 1: Install the MongoDB Enterprise packages and associated tools. You can install either the latest stable
version of MongoDB Enterprise or a specific version of MongoDB Enterprise.
14https://repo.mongodb.com/yum/redhat/
2.1. Installation Guides 25
30. MongoDB Documentation, Release 2.6.4
Install the latest stable version of MongoDB Enterprise. Issue the following command:
sudo yum install -y mongodb-enterprise
Step 2: Optional. Manage Installed Version
Install a specific release of MongoDB Enterprise. Specify each component package individually and append the
version number to the package name, as in the following example that installs the 2.6.1 release of MongoDB:
sudo yum install -y mongodb-enterprise-2.6.1 mongodb-enterprise-server-2.6.1 mongodb-enterprise-shell-Pin a specific version of MongoDB Enterprise. Although you can specify any available version of MongoDB
Enterprise, yum will upgrade the packages when a newer version becomes available. To prevent unintended upgrades,
pin the package. To pin a package, add the following exclude directive to your /etc/yum.conf file:
exclude=mongodb-enterprise,mongodb-enterprise-server,mongodb-enterprise-shell,mongodb-enterprise-mongos,Previous versions of MongoDB packages use different naming conventions. See the 2.4 version of documentation for
more information15.
Step 3: When the install completes, you can run MongoDB.
Run MongoDB Enterprise
Important: You must configure SELinux to allow MongoDB to start on Red Hat Linux-based systems (Red Hat
Enterprise Linux, CentOS, Fedora). Administrators have three options:
• enable access to the relevant ports (e.g. 27017) for SELinux. See Default MongoDB Port (page 380) for more
information on MongoDB’s default ports. For default settings, this can be accomplished by running
semanage port -a -t mongodb_port_t -p tcp 27017
• set SELinux to permissive mode in /etc/selinux.conf. The line
SELINUX=enforcing
should be changed to
SELINUX=permissive
• disable SELinux entirely; as above but set
SELINUX=disabled
All three options require root privileges. The latter two options each requires a system reboot and may have larger
implications for your deployment.
You may alternatively choose not to install the SELinux packages when you are installing your Linux operating system,
or choose to remove the relevant packages. This option is the most invasive and is not recommended.
The MongoDB instance stores its data files in /var/lib/mongo and its log files in /var/log/mongodb
by default, and runs using the mongod user account. You can specify alternate log and data file directories in
/etc/mongodb.conf. See systemLog.path and storage.dbPath for additional information.
15http://docs.mongodb.org/v2.4/tutorial/install-mongodb-on-linux
26 Chapter 2. Install MongoDB
31. MongoDB Documentation, Release 2.6.4
If you change the user that runs the MongoDB process, you must modify the access control rights to the
/var/lib/mongo and /var/log/mongodb directories to give this users access to these directories.
Step 1: Start MongoDB. You can start the mongod process by issuing the following command:
sudo service mongod start
Step 2: Verify that MongoDB has started successfully You can verify that the mongod process has started suc-cessfully
by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading
[initandlisten] waiting for connections on port <port>
where <port> is the port configured in /etc/mongod.conf, 27017 by default.
You can optionally ensure that MongoDB will start following a system reboot by issuing the following command:
sudo chkconfig mongod on
Step 3: Stop MongoDB. As needed, you can stop the mongod process by issuing the following command:
sudo service mongod stop
Step 4: Restart MongoDB. You can restart the mongod process by issuing the following command:
sudo service mongod restart
You can follow the state of the process for errors or important messages by watching the output in the
/var/log/mongodb/mongod.log file.
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Install MongoDB Enterprise on Ubuntu
Overview
Use this tutorial to install MongoDB Enterprise on Ubuntu Linux systems from .deb packages.
Packages
MongoDB provides packages of the officially supported MongoDB Enterprise builds in it’s own repository. This
repository provides the MongoDB Enterprise distribution in the following packages:
• mongodb-enterprise
This package is a metapackage that will automatically install the four component packages listed below.
• mongodb-enterprise-server
This package contains the mongod daemon and associated configuration and init scripts.
• mongodb-enterprise-mongos
This package contains the mongos daemon.
2.1. Installation Guides 27
32. MongoDB Documentation, Release 2.6.4
• mongodb-enterprise-shell
This package contains the mongo shell.
• mongodb-enterprise-tools
This package contains the following MongoDB tools: mongoimport bsondump, mongodump,
mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore,
mongostat, and mongotop.
Control Scripts
The mongodb-enterprise package includes various control scripts, including the init script
/etc/rc.d/init.d/mongod.
The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts.
As of version 2.6.4, there are no control scripts for mongos. The mongos process is used only in sharding (page 613).
You can use the mongod init script to derive your own mongos control script.
Considerations
MongoDB only provides Enterprise packages for Ubuntu 12.04 LTS (Precise Pangolin).
Changed in version 2.6: The package structure and names have changed as of version 2.6. For instructions on instal-lation
of an older release, please refer to the documentation for the appropriate version.
Install MongoDB Enterprise
Step 1: Import the public key used by the package management system. The Ubuntu package management tools
(i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with
GPG keys. Issue the following command to import the MongoDB public GPG Key16:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Step 2: Create a /etc/apt/sources.list.d/mongodb-enterprise.list file for MongoDB. Create
the list file using the following command:
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/stable multiverse' | sudo tee If you’d like to install MongoDB Enterprise packages from a particular release series (page 808), such as 2.4 or 2.6,
you can specify the release series in the repository configuration. For example, to restrict your system to the 2.6 release
series, add the following repository:
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/2.6 multiverse' | sudo tee /etc/Step 3: Reload local package database. Issue the following command to reload the local package database:
sudo apt-get update
16http://docs.mongodb.org/10gen-gpg-key.asc
28 Chapter 2. Install MongoDB
33. MongoDB Documentation, Release 2.6.4
Step 4: Install the MongoDB Enterprise packages. When you install the packages, you choose whether to install
the current release or a previous one. This step provides instructions for both.
To install the latest stable version of MongoDB Enterprise, issue the following command:
sudo apt-get install mongodb-enterprise
To install a specific release of MongoDB Enterprise, specify each component package individually and append the
version number to the package name, as in the following example that installs the 2.6.1‘ release of MongoDB Enter-prise:
apt-get install mongodb-enterprise=2.6.1 mongodb-enterprise-server=2.6.1 mongodb-enterprise-shell=2.6.1 You can specify any available version of MongoDB Enterprise. However apt-get will upgrade the packages when
a newer version becomes available. To prevent unintended upgrades, pin the package. To pin the version of MongoDB
Enterprise at the currently installed version, issue the following command sequence:
echo "mongodb-enterprise hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-server hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-shell hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-mongos hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-tools hold" | sudo dpkg --set-selections
Previous versions of MongoDB Enterprise packages use different naming conventions. See the 2.4 version of docu-mentation17
for more information.
Run MongoDB Enterprise
The MongoDB instance stores its data files in /var/lib/mongodb and its log files in /var/log/mongodb
by default, and runs using the mongodb user account. You can specify alternate log and data file directories in
/etc/mongodb.conf. See systemLog.path and storage.dbPath for additional information.
If you change the user that runs the MongoDB process, you must modify the access control rights to the
/var/lib/mongodb and /var/log/mongodb directories to give this users access to these directories.
Step 1: Start MongoDB. Issue the following command to start mongod:
sudo service mongod start
Step 2: Verify that MongoDB has started successfully Verify that the mongod process has started successfully
by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading
[initandlisten] waiting for connections on port <port>
where <port> is the port configured in /etc/mongod.conf, 27017 by default.
Step 3: Stop MongoDB. As needed, you can stop the mongod process by issuing the following command:
sudo service mongod stop
Step 4: Restart MongoDB. Issue the following command to restart mongod:
17http://docs.mongodb.org/v2.4/tutorial/install-mongodb-enterprise
2.1. Installation Guides 29
34. MongoDB Documentation, Release 2.6.4
sudo service mongod restart
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Install MongoDB Enterprise on Debian
Overview
Use this tutorial to install MongoDB Enterprise on Debian Linux systems from .deb packages.
Packages
MongoDB provides packages of the officially supported MongoDB Enterprise builds in it’s own repository. This
repository provides the MongoDB Enterprise distribution in the following packages:
• mongodb-enterprise
This package is a metapackage that will automatically install the four component packages listed below.
• mongodb-enterprise-server
This package contains the mongod daemon and associated configuration and init scripts.
• mongodb-enterprise-mongos
This package contains the mongos daemon.
• mongodb-enterprise-shell
This package contains the mongo shell.
• mongodb-enterprise-tools
This package contains the following MongoDB tools: mongoimport bsondump, mongodump,
mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore,
mongostat, and mongotop.
Control Scripts
The mongodb-enterprise package includes various control scripts, including the init script
/etc/rc.d/init.d/mongod.
The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts.
As of version 2.6.4, there are no control scripts for mongos. The mongos process is used only in sharding (page 613).
You can use the mongod init script to derive your own mongos control script.
Considerations
Changed in version 2.6: The package structure and names have changed as of version 2.6. For instructions on instal-lation
of an older release, please refer to the documentation for the appropriate version.
MongoDB only provides Enterprise packages for 64-bit versions of Debian Wheezy.
30 Chapter 2. Install MongoDB
35. MongoDB Documentation, Release 2.6.4
Install MongoDB Enterprise
Step 1: Import the public key used by the package management system. Issue the following command to add
the MongoDB public GPG Key18 to the system key ring.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Step 2: Create a /etc/apt/sources.list.d/mongodb-enterprise.list file for MongoDB. Create
the list file using the following command:
echo 'deb http://repo.mongodb.com/apt/debian wheezy/mongodb-enterprise/stable main' | sudo tee /etc/apt/If you’d like to install MongoDB Enterprise packages from a particular release series (page 808), such as 2.6, you can
specify the release series in the repository configuration. For example, to restrict your system to the 2.6 release series,
add the following repository:
echo 'deb http://repo.mongodb.com/apt/debian precise/mongodb-enterprise/2.6 main' | sudo tee /etc/apt/Step 3: Reload local package database. Issue the following command to reload the local package database:
sudo apt-get update
Step 4: Install the MongoDB Enterprise packages. When you install the packages, you choose whether to install
the current release or a previous one. This step provides instructions for both.
To install the latest stable version of MongoDB Enterprise, issue the following command:
sudo apt-get install mongodb-enterprise
To install a specific release of MongoDB Enterprise, specify each component package individually and append the
version number to the package name, as in the following example that installs the 2.6.1‘ release of MongoDB Enter-prise:
apt-get install mongodb-enterprise=2.6.1 mongodb-enterprise-server=2.6.1 mongodb-enterprise-shell=2.6.1 You can specify any available version of MongoDB Enterprise. However apt-get will upgrade the packages when
a newer version becomes available. To prevent unintended upgrades, pin the package. To pin the version of MongoDB
Enterprise at the currently installed version, issue the following command sequence:
echo "mongodb-enterprise hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-server hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-shell hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-mongos hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-tools hold" | sudo dpkg --set-selections
Run MongoDB Enterprise
The MongoDB instance stores its data files in /var/lib/mongodb and its log files in /var/log/mongodb
by default, and runs using the mongodb user account. You can specify alternate log and data file directories in
/etc/mongodb.conf. See systemLog.path and storage.dbPath for additional information.
If you change the user that runs the MongoDB process, you must modify the access control rights to the
/var/lib/mongodb and /var/log/mongodb directories to give this users access to these directories.
18http://docs.mongodb.org/10gen-gpg-key.asc
2.1. Installation Guides 31
36. MongoDB Documentation, Release 2.6.4
Step 1: Start MongoDB. Issue the following command to start mongod:
sudo service mongod start
Step 2: Verify that MongoDB has started successfully Verify that the mongod process has started successfully
by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading
[initandlisten] waiting for connections on port <port>
where <port> is the port configured in /etc/mongod.conf, 27017 by default.
Step 3: Stop MongoDB. As needed, you can stop the mongod process by issuing the following command:
sudo service mongod stop
Step 4: Restart MongoDB. Issue the following command to restart mongod:
sudo service mongod restart
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Install MongoDB Enterprise on SUSE
Overview
Use this tutorial to install MongoDB Enterprise on SUSE Linux. MongoDB Enterprise is available on select platforms
and contains support for several features related to security and monitoring.
Prerequisites
To use MongoDB Enterprise on SUSE Enterprise Linux, you must install several prerequisite packages:
• libopenssl0_9_8
• libsnmp15
• net-snmp
• snmp-mibs
• cyrus-sasl
• cyrus-sasl-gssapi
To install these packages, you can issue the following command:
sudo zypper install libopenssl0_9_8 net-snmp libsnmp15 snmp-mibs cyrus-sasl cyrus-sasl-gssapi
32 Chapter 2. Install MongoDB
37. MongoDB Documentation, Release 2.6.4
Install MongoDB Enterprise
Note: The Enterprise packages include an example SNMP configuration file named mongod.conf. This file is not
a MongoDB configuration file.
Step 1: Download and install the MongoDB Enterprise packages. After you have in-stalled
the required prerequisite packages, download and install the MongoDB Enterprise packages
from http://www.mongodb.com/subscription/downloads. The MongoDB binaries are located in the
http://docs.mongodb.org/manualbin directory of the archive. To download and install, use the
following sequence of commands.
curl -O http://downloads.10gen.com/linux/mongodb-linux-x86_64-subscription-suse11-2.6.4.tgz
tar -zxvf mongodb-linux-x86_64-subscription-suse11-2.6.4.tgz
cp -R -n mongodb-linux-x86_64-subscription-suse11-2.6.4/ mongodb
Step 2: Ensure the location of the MongoDB binaries is included in the PATH variable. Once you have copied
the MongoDB binaries to their target location, ensure that the location is included in your PATH variable. If it is not,
either include it or create symbolic links from the binaries to a directory that is included.
Run MongoDB Enterprise
Step 1: Create the data directory. Before you start MongoDB for the first time, create the directory to which
the mongod process will write data. By default, the mongod process uses the /data/db directory. If you create a
directory other than this one, you must specify that directory in the dbpath option when starting the mongod process
later in this procedure.
The following example command creates the default /data/db directory:
mkdir -p /data/db
Step 2: Set permissions for the data directory. Before running mongod for the first time, ensure that the user
account running mongod has read and write permissions for the directory.
Step 3: Run MongoDB. To run MongoDB, run the mongod process at the system prompt. If necessary, specify the
path of the mongod or the data directory. See the following examples.
Run without specifying paths If your system PATH variable includes the location of the mongod binary and if you
use the default data directory (i.e., /data/db), simply enter mongod at the system prompt:
mongod
Specify the path of the mongod If your PATH does not include the location of the mongod binary, enter the full
path to the mongod binary at the system prompt:
<path to binary>/mongod
2.1. Installation Guides 33
38. MongoDB Documentation, Release 2.6.4
Specify the path of the data directory If you do not use the default data directory (i.e., /data/db), specify the
path to the data directory using the --dbpath option:
mongod --dbpath <path to data directory>
Step 4: Stop MongoDB as needed. To stop MongoDB, press Control+C in the terminal where the mongod
instance is running.
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Install MongoDB Enterprise on Amazon Linux AMI
Overview
Use this tutorial to install MongoDB Enterprise on Amazon Linux AMI. MongoDB Enterprise is available on select
platforms and contains support for several features related to security and monitoring.
Prerequisites
To use MongoDB Enterprise on Amazon Linux AMI, you must install several prerequisite packages:
• net-snmp
• net-snmp-libs
• openssl
• net-snmp-utils
• cyrus-sasl
• cyrus-sasl-lib
• cyrus-sasl-devel
• cyrus-sasl-gssapi
To install these packages, you can issue the following command:
sudo yum install openssl net-snmp net-snmp-libs net-snmp-utils cyrus-sasl cyrus-sasl-lib cyrus-sasl-devel Install MongoDB Enterprise
Note: The Enterprise packages include an example SNMP configuration file named mongod.conf. This file is not
a MongoDB configuration file.
Step 1: Download and install the MongoDB Enterprise packages. After you have in-stalled
the required prerequisite packages, download and install the MongoDB Enterprise packages
from http://www.mongodb.com/subscription/downloads. The MongoDB binaries are located in the
http://docs.mongodb.org/manualbin directory of the archive. To download and install, use the
following sequence of commands.
34 Chapter 2. Install MongoDB
39. MongoDB Documentation, Release 2.6.4
curl -O http://downloads.10gen.com/linux/mongodb-linux-x86_64-subscription-amzn64-2.6.4.tgz
tar -zxvf mongodb-linux-x86_64-subscription-amzn64-2.6.4.tgz
cp -R -n mongodb-linux-x86_64-subscription-amzn64-2.6.4/ mongodb
Step 2: Ensure the location of the MongoDB binaries is included in the PATH variable. Once you have copied
the MongoDB binaries to their target location, ensure that the location is included in your PATH variable. If it is not,
either include it or create symbolic links from the binaries to a directory that is included.
Run MongoDB Enterprise
The MongoDB instance stores its data files in /var/lib/mongo and its log files in /var/log/mongodb
by default, and runs using the mongod user account. You can specify alternate log and data file directories in
/etc/mongodb.conf. See systemLog.path and storage.dbPath for additional information.
If you change the user that runs the MongoDB process, you must modify the access control rights to the
/var/lib/mongo and /var/log/mongodb directories to give this users access to these directories.
Step 1: Create the data directory. Before you start MongoDB for the first time, create the directory to which
the mongod process will write data. By default, the mongod process uses the /data/db directory. If you create a
directory other than this one, you must specify that directory in the dbpath option when starting the mongod process
later in this procedure.
The following example command creates the default /data/db directory:
mkdir -p /data/db
Step 2: Set permissions for the data directory. Before running mongod for the first time, ensure that the user
account running mongod has read and write permissions for the directory.
Step 3: Run MongoDB. To run MongoDB, run the mongod process at the system prompt. If necessary, specify the
path of the mongod or the data directory. See the following examples.
Run without specifying paths If your system PATH variable includes the location of the mongod binary and if you
use the default data directory (i.e., /data/db), simply enter mongod at the system prompt:
mongod
Specify the path of the mongod If your PATH does not include the location of the mongod binary, enter the full
path to the mongod binary at the system prompt:
<path to binary>/mongod
Specify the path of the data directory If you do not use the default data directory (i.e., /data/db), specify the
path to the data directory using the --dbpath option:
mongod --dbpath <path to data directory>
Step 4: Stop MongoDB as needed. To stop MongoDB, press Control+C in the terminal where the mongod
instance is running.
2.1. Installation Guides 35
40. MongoDB Documentation, Release 2.6.4
Step 5: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Install MongoDB Enterprise on Windows
New in version 2.6.
Overview
Use this tutorial to install MongoDB Enterprise on Windows systems. MongoDB Enterprise is available on select
platforms and contains support for several features related to security and monitoring.
Prerequisites
MongoDB Enterprise Server for Windows requires Windows Server 2008 R2 or later. The MSI installer includes all
other software dependencies.
Install MongoDB Enterprise
Step 1: Download MongoDB Enterprise for Windows. Download the latest production release of MongoDB
Enterprise19
Step 2: Install MongoDB Enterprise for Windows. Run the downloaded MSI installer. Make configuration
choices as prompted.
MongoDB is self-contained and does not have any other system dependencies. You can install MongoDB into any
folder (e.g. D:testmongodb) and run it from there. The installation wizard includes an option to select an
installation directory.
Run MongoDB Enterprise
Warning: Do not make mongod.exe visible on public networks without running in “Secure Mode” with the
auth setting. MongoDB is designed to be run in trusted environments, and the database does not enable “Secure
Mode” by default.
Step 1: Set up the MongoDB environment. MongoDB requires a data directory to store all data. MongoDB’s
default data directory path is datadb. Create this folder using the following commands from a Command Prompt:
md datadb
You can specify an alternate path for data files using the --dbpath option to mongod.exe, for example:
C:mongodbbinmongod.exe --dbpath d:testmongodbdata
If your path includes spaces, enclose the entire path in double quotes, for example:
19http://www.mongodb.com/products/mongodb-enterprise
36 Chapter 2. Install MongoDB
41. MongoDB Documentation, Release 2.6.4
C:mongodbbinmongod.exe --dbpath "d:testmongo db data"
Step 2: Start MongoDB. To start MongoDB, run mongod.exe. For example, from the Command Prompt:
C:Program FilesMongoDBbinmongod.exe
This starts the main MongoDB database process. The waiting for connections message in the console
output indicates that the mongod.exe process is running successfully.
Depending on the security level of your system, Windows may pop up a Security Alert dialog box about block-ing
“some features” of C:Program FilesMongoDBbinmongod.exe from communicating on networks.
All users should select Private Networks, such as my home or work network and click Allow
access. For additional information on security and MongoDB, please see the Security Documentation (page 281).
Step 3: Connect to MongoDB. To connect to MongoDB through the mongo.exe shell, open another Command
Prompt. When connecting, specify the data directory if necessary. This step provides several example connection
commands.
If your MongoDB installation uses the default data directory, connect without specifying the data directory:
C:mongodbbinmongo.exe
If you installation uses a different data directory, specify the directory when connecting, as in this example:
C:mongodbbinmongod.exe --dbpath d:testmongodbdata
If your path includes spaces, enclose the entire path in double quotes. For example:
C:mongodbbinmongod.exe --dbpath "d:testmongo db data"
If you want to develop applications using .NET, see the documentation of C# and MongoDB20 for more information.
Step 4: Begin using MongoDB. To begin using MongoDB, see Getting Started with MongoDB (page 43). Also
consider the Production Notes (page 188) document before deploying MongoDB in a production environment.
Configure a Windows Service for MongoDB Enterprise
You can set up the MongoDB server as a Windows Service that starts automatically at boot time.
Step 1: Configure directories and files. Create a configuration file and a directory path for MongoDB log
output (logpath):
Create a specific directory for MongoDB log files:
md "C:Program FilesMongoDBlog"
In the Command Prompt, create a configuration file for the logpath option for MongoDB:
echo logpath="C:Program FilesMongoDBlogmongo.log" > "C:Program FilesMongoDBmongod.cfg"
20http://docs.mongodb.org/ecosystem/drivers/csharp
2.1. Installation Guides 37
42. MongoDB Documentation, Release 2.6.4
Step 2: Run the MongoDB service. Run all of the following commands in Command Prompt with “Administrative
Privileges:”
Install the MongoDB service. For --install to succeed, you must specify the logpath run-time option.
"C:Program FilesMongoDBbinmongod.exe" --config "C:Program FilesMongoDBmongod.cfg" --install
Modify the path to the mongod.cfg file as needed.
To use an alternate dbpath, specify the path in the configuration file (e.g. C:Program
FilesMongoDBmongod.cfg) or on the command line with the --dbpath option.
If the dbpath directory does not exist, mongod.exe will not start. The default value for dbpath is datadb.
If needed, you can install services for multiple instances of mongod.exe or mongos.exe. Install each service with
a unique --serviceName and --serviceDisplayName. Use multiple instances only when sufficient system
resources exist and your system design requires it.
Step 3: Stop or remove the MongoDB service as needed. To stop the MongoDB service use the following com-mand:
net stop MongoDB
To remove the MongoDB service use the following command:
"C:Program FilesMongoDBbinmongod.exe" --remove
Configure a Windows Service for MongoDB Enterprise
Note: There is a known issue for MongoDB 2.6.0, SERVER-1351521, which prevents the use of the instructions
in this section. For MongoDB 2.6.0, use Manually Create a Windows Service for MongoDB Enterprise (page 39) to
create a Windows Service for MongoDB.
You can set up the MongoDB server as a Windows Service that starts automatically at boot time.
Step 1: Configure directories and files. Create a configuration file and a directory path for MongoDB log
output (logpath):
Create a specific directory for MongoDB log files:
md "C:Program FilesMongoDBlog"
In the Command Prompt, create a configuration file for the logpath option for MongoDB:
echo logpath="C:Program FilesMongoDBlogmongo.log" > "C:Program FilesMongoDBmongod.cfg"
Step 2: Run the MongoDB service. Run all of the following commands in Command Prompt with “Administrative
Privileges:”
Install the MongoDB service. For --install to succeed, you must specify the logpath run-time option.
"C:Program FilesMongoDBbinmongod.exe" --config "C:Program FilesMongoDBmongod.cfg" --install
21https://jira.mongodb.org/browse/SERVER-13515
38 Chapter 2. Install MongoDB
43. MongoDB Documentation, Release 2.6.4
Modify the path to the mongod.cfg file as needed.
To use an alternate dbpath, specify the path in the configuration file (e.g. C:Program
FilesMongoDBmongod.cfg) or on the command line with the --dbpath option.
If the dbpath directory does not exist, mongod.exe will not start. The default value for dbpath is datadb.
If needed, you can install services for multiple instances of mongod.exe or mongos.exe. Install each service with
a unique --serviceName and --serviceDisplayName. Use multiple instances only when sufficient system
resources exist and your system design requires it.
Step 3: Stop or remove the MongoDB service as needed. To stop the MongoDB service use the following com-mand:
net stop MongoDB
To remove the MongoDB service use the following command:
"C:Program FilesMongoDBbinmongod.exe" --remove
Manually Create a Windows Service for MongoDB Enterprise
The following procedure assumes you have installed MongoDB using the MSI installer, with the default path
C:Program FilesMongoDB 2.6 Enterprise.
If you have installed in an alternative directory, you will need to adjust the paths as appropriate.
Step 1: Open an Administrator command prompt. Press Win + R, then type cmd, then press Ctrl + Shift
+ Enter.
Execute the remaining steps from the Administrator command prompt.
Step 2: Create directories. Create directories for your database and log files:
mkdir c:datadb
mkdir c:datalog
Step 3: Create a configuration file. Create a configuration file. This file can include any of the
configuration options for mongod, but must include a valid setting for logpath:
The following creates a configuration file, specifying both the logpath and the dbpath settings in the configuration
file:
echo logpath=c:datalogmongod.log> "C:Program FilesMongoDB 2.6 Standardmongod.cfg"
echo dbpath=c:datadb>> "C:Program FilesMongoDB 2.6 Standardmongod.cfg"
Step 4: Create the MongoDB service. Create the MongoDB service.
sc.exe create MongoDB binPath= ""C:Program FilesMongoDB 2.6 Enterprisebinmongod.exe" --service sc.exe requires a space between “=” and the configuration values (eg “binPath= ”), and a “” to escape double quotes.
If successfully created, the following log message will display:
2.1. Installation Guides 39
44. MongoDB Documentation, Release 2.6.4
[SC] CreateService SUCCESS
Step 5: Start the MongoDB service.
net start MongoDB
Step 6: Stop or remove the MongoDB service as needed. To stop the MongoDB service, use the following com-mand:
net stop MongoDB
To remove the MongoDB service, first stop the service and then run the following command:
sc.exe delete MongoDB
2.1.5 Verify Integrity of MongoDB Packages
Overview
The MongoDB release team digitally signs all software packages to certify that a particular MongoDB package is a
valid and unaltered MongoDB release.
Before installing MongoDB, you can validate packages using either a PGP signature or with MD5 and SHA checksums
of the MongoDB packages. The PGP signatures store an encrypted hash of the software package, that you can validate
to ensure that the package you have is consistent with the official package release. MongoDB also publishes MD5 and
SHA hashes of the official packages that you can use to confirm that you have a valid package.
Considerations
MongoDB signs each release branch with a different PGP key.
The public .asc and .pub key files for each branch are available for download. For example, the 2.2 keys are
available at the following URLs:
https://www.mongodb.org/static/pgp/server-2.2.asc
https://www.mongodb.org/static/pgp/server-2.2.pub
Replace 2.2 with the appropriate release number to download public key. Keys are available for all MongoDB
releases beginning with 2.2.
Procedures
Use PGP/GPG
Step 1: Download the MongoDB installation file. Download the binaries from
https://www.mongodb.org/downloads based on your environment.
For example, to download the 2.6.0 release for OS X through the shell, type this command:
curl -LO http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.0.tgz
40 Chapter 2. Install MongoDB
45. MongoDB Documentation, Release 2.6.4
Step 2: Download the public signature file.
curl -LO http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.0.tgz.sig
Step 3: Download then import the key file. If you have not downloaded and imported the key file, enter these
commands:
curl -LO https://www.mongodb.org/static/pgp/server-2.6.asc
gpg --import server-2.6.asc
You should receive this message:
gpg: key AAB2461C: public key "MongoDB 2.6 Release Signing Key <packaging@mongodb.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Step 4: Verify the MongoDB installation file. Type this command:
gpg --verify mongodb-osx-x86_64-2.6.0.tgz.sig mongodb-osx-x86_64-2.6.0.tgz
You should receive this message:
gpg: Signature made Thu Mar 6 15:11:28 2014 EST using RSA key ID AAB2461C
gpg: Good signature from "MongoDB 2.6 Release Signing Key <packaging@mongodb.com>"
Download and import the key file, as described above, if you receive a message like this one:
gpg: Signature made Thu Mar 6 15:11:28 2014 EST using RSA key ID AAB2461C
gpg: Can't check signature: public key not found
gpg will return the following message if the package is properly signed, but you do not currently trust the signing key
in your local trustdb.
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: DFFA 3DCF 326E 302C 4787 673A 01C4 E7FA AAB2 461C
Use SHA
MongoDB provides checksums using both the SHA-1 and SHA-256 hash functions. You can use either, as you like.
Step 1: Download the MongoDB installation file. Download the binaries from
https://www.mongodb.org/downloads based on your environment.
For example, to download the 2.6.0 release for OS X through the shell, type this command:
curl -LO http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.0.tgz
Step 2: Download the SHA1 and SHA256 file.
curl -LO http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.3.tgz.sha1
curl -LO http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.3.tgz.sha256
2.1. Installation Guides 41
46. MongoDB Documentation, Release 2.6.4
Step 3: Use the SHA-256 checksum to verify the MongoDB package file. Compute the checksum of the package
file:
shasum mongodb-linux-x86_64-2.6.3.tgz
which will generate this result:
fe511ee40428edda3a507f70d2b91d16b0483674 mongodb-osx-x86_64-2.6.3.tgz
Enter this command:
cat mongodb-linux-x86_64-2.6.3.tgz.sha1
which will generate this result:
fe511ee40428edda3a507f70d2b91d16b0483674 mongodb-osx-x86_64-2.6.3.tgz
The output of the shasum and cat commands should be identical.
Step 3: Use the SHA-1 checksum to verify the MongoDB package file. Compute the checksum of the package
file:
shasum -a 256 mongodb-linux-x86_64-2.6.3.tgz
which will generate this result:
be3a5e9f4e9c8e954e9af7053776732387d2841a019185eaf2e52086d4d207a3 mongodb-osx-x86_64-2.6.3.tgz
Enter this command:
cat mongodb-linux-x86_64-2.6.3.tgz.sha256
which will generate this result:
be3a5e9f4e9c8e954e9af7053776732387d2841a019185eaf2e52086d4d207a3 mongodb-osx-x86_64-2.6.3.tgz
The output of the shasum and cat commands should be identical.
Use MD5
Step 1: Download the MongoDB installation file. Download the binaries from
https://www.mongodb.org/downloads based on your environment.
For example, to download the 2.6.0 release for OS X through the shell, type this command:
curl -LO http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.0.tgz
Step 2: Download the MD5 file.
curl -LO http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.0.tgz.md5
Step 3: Verify the checksum values for the MongoDB package file (Linux). Compute the checksum of the pack-age
file:
md5 mongodb-linux-x86_64-2.6.0.tgz
which will generate this result:
42 Chapter 2. Install MongoDB
47. MongoDB Documentation, Release 2.6.4
MD5 (mongodb-linux-x86_64-2.6.0.tgz) = a937d49881f90e1a024b58d642011dc4
Enter this command:
cat mongodb-linux-x86_64-2.6.0.tgz.md5
which will generate this result:
a937d49881f90e1a024b58d642011dc4
The output of the md5 and cat commands should be identical.
Step 4: Verify the MongoDB installation file (OS X). Compute the checksum of the package file:
md5sum -c mongodb-osx-x86_64-2.6.0.tgz.md5 mongodb-osx-x86_64-2.6.0.tgz
which will generate this result:
mongodb-osx-x86_64-2.6.0-rc1.tgz ok
2.2 First Steps with MongoDB
After you have installed MongoDB, consider the following documents as you begin to learn about MongoDB:
Getting Started with MongoDB (page 43) An introduction to the basic operation and use of MongoDB.
Generate Test Data (page 47) To support initial exploration, generate test data to facilitate testing.
2.2.1 Getting Started with MongoDB
This tutorial provides an introduction to basic database operations using the mongo shell. mongo is a part of the
standard MongoDB distribution and provides a full JavaScript environment with complete access to the JavaScript
language and all standard functions as well as a full database interface for MongoDB. See the mongo JavaScript API22
documentation and the mongo shell JavaScript Method Reference.
The tutorial assumes that you’re running MongoDB on a Linux or OS X operating system and that you have a running
database server; MongoDB does support Windows and provides a Windows distribution with identical operation.
For instructions on installing MongoDB and starting the database server, see the appropriate installation (page 5)
document.
Connect to a Database
In this section, you connect to the database server, which runs as mongod, and begin using the mongo shell to select
a logical database within the database instance and access the help text in the mongo shell.
Connect to a mongod
From a system prompt, start mongo by issuing the mongo command, as follows:
mongo
22http://api.mongodb.org/js
2.2. First Steps with MongoDB 43
48. MongoDB Documentation, Release 2.6.4
By default, mongo looks for a database server listening on port 27017 on the localhost interface. To connect to
a server on a different port or interface, use the --port and --host options.
Select a Database
After starting the mongo shell your session will use the test database by default. At any time, issue the following
operation at the mongo to report the name of the current database:
db
1. From the mongo shell, display the list of databases, with the following operation:
show dbs
2. Switch to a new database named mydb, with the following operation:
use mydb
3. Confirm that your session has the mydb database as context, by checking the value of the db object, which
returns the name of the current database, as follows:
db
At this point, if you issue the show dbs operation again, it will not include the mydb database. MongoDB
will not permanently create a database until you insert data into that database. The Create a Collection and
Insert Documents (page 44) section describes the process for inserting data.
New in version 2.4: show databases also returns a list of databases.
Display mongo Help
At any point, you can access help for the mongo shell using the following operation:
help
Furthermore, you can append the .help() method to some JavaScript methods, any cursor object, as well as the db
and db.collection objects to return additional help information.
Create a Collection and Insert Documents
In this section, you insert documents into a new collection named testData within the new database named mydb.
MongoDB will create a collection implicitly upon its first use. You do not need to create a collection before inserting
data. Furthermore, because MongoDB uses dynamic schemas (page 688), you also need not specify the structure of
your documents before inserting them into the collection.
1. From the mongo shell, confirm you are in the mydb database by issuing the following:
db
2. If mongo does not return mydb for the previous operation, set the context to the mydb database, with the
following operation:
use mydb
3. Create two documents named j and k by using the following sequence of JavaScript operations:
44 Chapter 2. Install MongoDB