在 LDAP 中匯入資料庫會產生錯誤

在 LDAP 中匯入資料庫會產生錯誤

我已使用以下函數匯出資料庫slapcat > ldif

當我在其他 LDAP 伺服器中匯入資料庫時,它會產生錯誤。我正在使用以下功能slapadd -l ldif

這會產生以下錯誤

560d7819 The first database does not allow slapadd; using the first available one (2)
560d7819 => hdb_tool_entry_put: id2entry_add failed: BDB0067 DB_KEYEXIST: Key/data pair already exists (-30994)
560d7819 => hdb_tool_entry_put: txn_aborted! BDB0067 DB_KEYEXIST: Key/data pair already exists (-30994)
slapadd: could not add entry dn="dc=dmdomain,dc=com" (line=1): txn_aborted! BDB0067 DB_KEYEXIST: Key/data pair already exists (-30994)
_#####                 26.09% eta   none elapsed            none spd 957.4 k/s 
Closing DB...

我該怎麼辦?

答案1

您的 LDAP 資料庫不為空。如果您想要遷移到新機器,請繼續閱讀。如果您嘗試將先前的資料庫中的更多內容新增至新電腦上已填入的資料庫中,請停止。

如果你slapcat你的新伺服器你會得到你的

dc=dmdomain,dc=com 

作為條目。我建議您做什麼(請使用快照或其他方法來確保您可以在執行此操作之前從任何其他錯誤中恢復)。

刪除 /etc/ldap/slapd.d 中的所有內容。這將使您的 ldap 恢復正常。

slapadd -l 檔案位置

相關內容