Sun Java System Directory Server Enterprise Edition 6.2 管理指南

為部分複寫篩選 LDIF 檔案

使用 DSCC 時,不會感覺到正在初始化配置有部分複寫的複本。初始化期間僅會將選取的屬性傳送至用戶。

如果已配置部分複寫,應剔除所有未使用的屬性,再將匯出的 LDIF 檔案複製到用戶伺服器。目錄伺服器為此用途提供有 fildif 工具。此工具會篩選指定的 LDIF 檔案,僅保留複寫協議中定義之屬性集所允許的屬性。

此工具會讀取伺服器的配置,以決定屬性集定義。若要讀取配置檔案,必須以超級使用者身份或以擁有程序與檔案 (由 nsslapd-localuser 屬性所指定) 的使用者身份執行 fildif 工具。例如,下列指令會篩選上一範例內 dc=example,dc=com 尾碼所匯出的檔案:


$ fildif -i /local/ds1/ldif/example_master.ldif \
 -o /local/ds1/ldif/filtered.ldif -b "cn=host2.example.com:1389, \
 cn=replica,cn=\\"dc=example,dc=com\\",cn=mapping tree,cn=config" -p /local/ds1

如需瞭解 fildif 指令的位置,請參閱指令位置

-i-o 選項分別是輸入與輸出檔案。-b 選項是定義部分複寫的複寫協議之 DN。您可以使用此指令尋找此 DN:


$ ldapsearch -h host -p port -D cn=admin,cn=Administrators,cn=config -w - \
 -b "cn=config" "(&(objectclass=nsds5replicationagreement) (nsDS5ReplicaPort=replica-port) \
 (nsDS5ReplicaHost=replica-host))" dn

例如:


$ ldapsearch -h host2 -p 1389 -D cn=admin,cn=Administrators,cn=config -w - \
 -b "cn=config" "(&(objectclass=nsds5replicationagreement) \
 (nsDS5ReplicaPort=2090)(nsDS5ReplicaHost=host2))" dn
Enter bind password:
version: 1
dn: cn=host2:1389,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config

如需 fildif 工具完整的指令行語法,請參閱 fildif(1) 線上手冊。

您接著可以使用 fildif 產生的 filtered.ldif 檔案,初始化此複寫協議中的用戶。如從 LDIF 檔案匯入資料中所述,傳輸檔案至用戶伺服器並匯入檔案。