Skip to content

Deployment Overview of MongoDB on Server

Prerequisites and Basic Requirements

The deployment of MongoDB requires a Debian-based operating system. The installation process utilizes the APT package manager and requires root privileges to execute system-level commands. The following software components are installed as part of the setup: - curl - gnupg - nano - vim - htop - net-tools - dnsutils

Application Installation Process

The application is installed using the official MongoDB repository. The process involves adding the GPG key and configuring the repository source before installing the mongodb-org package.

  1. The GPG key is retrieved from https://www.mongodb.org/static/pgp/server-{{ mongo_version }}.asc.
  2. A repository list file is created at /etc/apt/sources.list.d/mongodb-org-{{ mongo_version}}.list with the following content:
    deb [arch=amd64,arm64] https://repo.mongodb.org/apt/{{ distribution }}/mongodb-org/{{ mongo_version}} multiverse
    
  3. The mongodb-org package is installed via APT.

Starting, Stopping, and Updating

The MongoDB service is managed using systemd. After installation, the service is started and enabled to run automatically on system boot.

  • To start the service:
    systemctl start mongod
    
  • To enable the service:
    systemctl enable mongod
    
  • To stop the service:
    systemctl stop mongod
    
  • To restart the service:
    systemctl restart mongod
    
  • To check the status of the service:
    systemctl status mongod
    
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×