Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

7.5.2. Configuring MongoDB


The MongoDB configuration consists of three main steps:
  • Configuring authentication
  • Configuring default database size
  • Configuring the firewall and mongod daemon

Procedure 7.9. To Configure Authentication and Default Database Size for MongoDB:

  1. Open the /etc/mongodb.conf file.
  2. Locate the line beginning with auth = and ensure it is set to true:
    auth = true
    Copy to Clipboard Toggle word wrap
  3. Add the following line at the end of the file:
    smallfiles = true
    Copy to Clipboard Toggle word wrap
  4. Ensure no other lines exist that begin with either auth = or smallfiles =.
  5. Save and close the file.

Procedure 7.10. To Configure the Firewall and Mongo Daemon:

  1. Ensure the mongod daemon starts on boot:
    # chkconfig mongod on
    Copy to Clipboard Toggle word wrap
  2. Start the mongod daemon immediately:
    # service mongod start
    Copy to Clipboard Toggle word wrap

Note

If you use the kickstart or bash script, the configure_datastore function performs these steps.
Verifying MongoDB Configuration

Before continuing with further configuration, verify that you can connect to the MongoDB database:

# mongo
Copy to Clipboard Toggle word wrap
This command starts a MongoDB interactive session. Press CTRL+D to leave this session and return to the command shell.

Important

The start and restart actions of MongoDB return before the daemon is ready to accept connections. As a result, MongoDB takes time to initialize the journal, which can take several minutes. If you receive the message "Error: couldn't connect to server 127.0.0.1" with the mongo command, wait and try again. When MongoDB is ready, it will write a "waiting for connections" message in the /var/log/mongodb/mongodb.log file. A connection to the MongoDB database is required for the ensuing steps.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat