Loading... ## 背景 上次新建了一个从节点之后,发现从节点上一直存在部分员工无法通过uid这个索引搜索出来。但是其他的又有员工是可以的,这个问题困扰了我好久.....准备把索引删除在重建试试看,解决还真可以了。目前操作方式如下 ## 查询当前拥有的索引 ```shell ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(olcDatabase={2}bdb)' olcDbIndex ```  这里可以看到其实我事有uid索引的,但是就是部分员工搜索不出来 ## 删除uid索引 ### 新建删除索引的 ldif 文件 ```shell vim deleteIndex.ldif ----------------------------- dn: olcDatabase={2}bdb, cn=config changetype:modify delete:olcDbIndex olcDbIndex: uid eq ``` ### 执行 ldif 文件 ```shell ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f deleteIndex.ldif ```  ## 新建UID索引 ### 新建新增索引的 ldif 文件 ```shell vim index.ldif ----------------------------- dn: olcDatabase={2}bdb, cn=config changetype:modify add:olcDbIndex olcDbIndex: uid eq ``` ### 执行 ldif 文件 ```shell ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f index.ldif ```  ## 结果  成功~解决 最后修改:2024 年 10 月 23 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏