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

Package installation

To install MongoDB on an Ubuntu/Debian server, you will need root access. A unique feature of Debian-based Linux distributions is that direct login as root is not allowed for security reasons. Accordingly, you can promote yourself to root using su, or you can precede the various commands with sudo, which instructs the OS to process this command as root.

Please proceed as follows:

  1. Import the public key from the MongoDB key server. This is needed so that the package manager can authenticate the MongoDB package:
  1. Add the MongoDB repository to the Linux server's sources list:
The commands listed should be on one line. We use a backslash ( \) to indicate a line of text that is too long to fit the printed page. When typing the command, omit the backslash ( \) and do not hit enter until the command has been fully entered.
  1. Refresh the package database from the sources list by running:
      sudo apt-get update
Ubuntu version 18.04 is code-named bionic. You will note this name is used in step #2 here, where the MongoDB repository is added to the sources list. If this source is not found, you will receive an error message:
The repository ... bionic/mongodb-org/4.0 ... does not have a Release file
In this situation, substitute the code name xenial (Ubuntu 16.04) in place of bionic (Ubuntu 18.04).
  1. Install the latest (stable) version of MongoDB. Here, we install only the composite package, which alleviates the need to separately install the four primary packages listed previously:
      sudo apt-get install -y mongodb-org
You will note, at the end of the installation, that the installer creates a user mongodb who belongs to a group mongodb, which is also newly created. This is the system user MongoDB uses when it runs.
主站蜘蛛池模板: 东海县| 舞钢市| 弥渡县| 姚安县| 独山县| 浦江县| 六安市| 武安市| 华池县| 芜湖县| 白水县| 德化县| 宣汉县| 昌图县| 崇左市| 金山区| 桃江县| 榕江县| 河间市| 山阳县| 策勒县| 陈巴尔虎旗| 离岛区| 五大连池市| 綦江县| 敦化市| 保靖县| 普安县| 阿克| 平罗县| 瑞丽市| 乡城县| 沅江市| 青冈县| 阆中市| 宜宾市| 萝北县| 元氏县| 乌苏市| 文山县| 宁武县|