官术网_书友最值得收藏!

Linux installation instructions

Once again, we will face a slightly more challenging installation process with Linux versus Windows or Mac. The official website http://docs.MongoDB.org/manual/administration/install-on-linux/ has great instructions on how to install MongoDB on a number of different Linux distributions.

We will continue to use Ubuntu as our flavor of choice and use the APT package manager for the installation:

    $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 
7F0CEB10
$ echo 'deb http://downloads-distro.MongoDB.org/repo/ubuntu-upstart
dist 10gen' | sudo tee /etc/apt/sources.list.d/MongoDB.list
$ sudo apt-get update $ sudo apt-get install MongoDB-10gen

Once these steps are completed, MongoDB should be installed and ready to run on your system. Execute the following command in the terminal to be sure. This gets the MongoDB daemon up and running, listening for connections:

    $ mongod
2017-08-04T10:10:47.853+0530 I NETWORK [thread1] waiting for
connections on port 27017

Success! Your MongoDB server is up and running. You can type Ctrl-C to cancel and shut down the server.

As you are performing local development on your development machine and not a production server, you don't need the MongoDB server to always be up and running. This will be an unnecessary strain on your machine for the majority of the time you're not developing against the server. Because of this, throughout the remainder of this book, it will always be a requirement that you manually launch the server every time you launch code that expects to connect to a MongoDB server. If you want, you can certainly configure MongoDB to run locally as a service and always be up, but the instructions to do so are beyond the scope of this chapter.
主站蜘蛛池模板: 四会市| 文登市| 安图县| 庆阳市| 青海省| 营口市| 新田县| 望谟县| 荔浦县| 厦门市| 元江| 高尔夫| 茂名市| 中阳县| 云浮市| 乐安县| 铁岭县| 海丰县| 临城县| 崇阳县| 右玉县| 普兰县| 临西县| 镇江市| 金阳县| 阿勒泰市| 三明市| 广宁县| 南江县| 玉龙| 漳浦县| 谷城县| 特克斯县| 武山县| 苏州市| 连州市| 定西市| 岚皋县| 卢龙县| 密云县| 犍为县|