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

Chapter 3. Switching a database to read-only mode


Databases of Directory Server run in read-write mode by default, in which users can both retrieve and store data.

When you need a faithful image of a database at a given time, for example before a backup or before a manual initialization of a consumer, you may switch a database to read-only mode that prevents users from creating, modifying, or deleting entries.

3.1. Prerequisites

  • The database is in read-write mode.
  • The database is not used in replication, since enabling read-only mode disables replication.

3.2. Switching a database to read-only mode using the command line

This procedure instructs you how to switch a Directory Server database to read-only mode on the command line.

Procedure

  1. List the suffixes and their corresponding databases:

    # dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix listdsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix listdsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix listdsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix listdsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix list
    dc=example,dc=com (userroot)
    o=test (test_database)
    Copy to Clipboard Toggle word wrap

    Note the name or suffix of the database that you want to switch.

  2. Enable read-only mode with the --enable-readonly parameter and specify the database either by name or suffix:

    # dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix set --enable-readonly "test_database"dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix set --enable-readonly "test_database"dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix set --enable-readonly "test_database"dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix set --enable-readonly "test_database"dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix set --enable-readonly "test_database"dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix set --enable-readonly "test_database"dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix set --enable-readonly "test_database"
    Copy to Clipboard Toggle word wrap

Verification

  • Attempt a write operation to the directory, such as:

    # ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x
    dn: dc=example,dc=com
    changetype: modify
    add: description
    description: foo
    Copy to Clipboard Toggle word wrap

    The server should refuse to perform.

    modifying entry "dc=example,dc=com"
    ldap_modify: Server is unwilling to perform (53)
    	additional info: Server is read-only
    Copy to Clipboard Toggle word wrap

3.3. Switching a database to read-only mode using the web console

This procedure instructs you how to switch a Directory Server database to read-only mode in a browser.

Prerequisites

  • You are logged in to the instance in the web console.

Procedure

  1. Under Database, select the suffix in the configuration tree.
  2. Check the Database Read-Only Mode option.
  3. Click Save Configuration.

Verification

  • Attempt a write operation to the directory, such as:

    # ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -xldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x
    dn: dc=example,dc=com
    changetype: modify
    add: description
    description: foo
    Copy to Clipboard Toggle word wrap

    The server should refuse to perform.

    modifying entry "dc=example,dc=com"
    ldap_modify: Server is unwilling to perform (53)
    	additional info: Server is read-only
    Copy to Clipboard Toggle word wrap
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