Configuring a read-only server
The PingDirectory server provides a means to configure a hub-like, read-only server for legacy systems that require it.
About this task
The read-only PingDirectory server participates in replication but cannot respond to any update requests from an external client. You can configure the PingDirectory server by setting the writability mode to internal-only, which makes the server operate in read-only mode. The Read-only mode PingDirectory server can process update operations from internal operations but reject any write requests from external clients. Because the PingDirectory server cannot accept write requests, you can configure the server to send a referral, which redirects a client’s request to a primary server. The client must perform the operation again on the server named in the referral.
For Implementers of third party extensions, many Server SDK extensions use the |
Steps
-
Install two replicating PingDirectory servers.
For more information on various ways to set up your servers, see Enabling replication.
-
On the second server, run the
dsconfig
command to set the writability mode of the server to internal-only.Example:
$ bin/dsconfig set-global-configuration-prop \ --set writability-mode:internal-only
-
On the second server, run the
dsconfig
command to create a referral that instructs the server to redirect client write requests underdc=example,dc=com
to server1.example.com:1389.The referral itself is defined as a plugin of type
referral-on-update
. This command sets up the server to process read operations but redirects all write operations underdc=example,dc=com
to another server.Example:
$ bin/dsconfig create-plugin --plugin-name "Refer Updates" \ --type referral-on-update \ --set enabled:true \ --set referral-base-url:ldap://server1.example.com:1389/ \ --set "base-dn:dc=example,dc=com"
-
To test the referral, attempt to modify an entry and confirm that the server responds with the result code of 10.
The resulting message is available in the server’s access log.
Example:
$ bin/ldapmodify -p 2389 -D "cn=Directory Manager" -w password dn: uid=user.12,ou=People,dc=example,dc=com changetype:modify replace:telephoneNumber telephoneNumber: +1 408 555 1155
Result:
[06/Aug/2012:15:28:21.468 -0400] MODIFY RESULT conn=86 op=1 msgID=1 requesterIP="127.0.0.1" dn="uid=user.12,ou=People,dc=example,dc=com" resultCode=10 referralURLs="ldap://server1.example.com:1389/uid=user.12, ou=People,dc=example,dc=com" etime=0.223