当前位置: 首页 > backend >正文

Ldap高效数据同步- MirrorMode双主复制模式配置详解(下)

#作者:朱雷

上篇:《Ldap高效数据同步- MirrorMode双主复制模式配置详解(上)》
链接: link

文章目录

  • 三、配置Mirror复制类型
    • 3.3. 在ldap-0上增加test2用户
    • 3.4. 在ldap-1上查看
    • 3.5. 在ldap-1上增加test4用户
    • 3.7. 最终两台LDAP数据情况
  • 四、总结

三、配置Mirror复制类型

3.3. 在ldap-0上增加test2用户

[root@ldap-0 openldap]# cat test2_user.ldif
#dn: ou=oa,dc=zltest,dc=com
#ou: oa
#objectclass: organizationalUnit
dn: cn=test2,ou=oa,dc=zltest,dc=com
ou: oa
cn: test2
sn: test2
mail: test2@zltest.com
objectclass: inetOrgPerson
objectclass: organizationalPerson
userPassword:: e1NTSEF9eTZZVktFUmMraG0vcFZYTkVVbzBFcDJyZlQ0MWxUM1g=[root@ldap-0 openldap]# ldapadd -x -D 'cn=admin,dc=zltest,dc=com' -W -f test2_user.ldif
Enter LDAP Password: 
adding new entry "cn=test2,ou=oa,dc=zltest,dc=com"

3.4. 在ldap-1上查看

[root@ldap-1 openldap]# ldapsearch -x -b 'dc=zltest,dc=com' '(cn=test2)'
# extended LDIF
#
# LDAPv3
# base <dc=zltest,dc=com> with scope subtree
# filter: (cn=test2)
# requesting: ALL
## test2, oa, zltest.com
dn: cn=test2,ou=oa,dc=zltest,dc=com
ou: oa
cn: test2
sn: test2
mail: test2@zltest.com
objectClass: inetOrgPerson
objectClass: organizationalPerson
userPassword:: e1NTSEF9eTZZVktFUmMraG0vcFZYTkVVbzBFcDJyZlQ0MWxUM1g=# search result
search: 2
result: 0 Success# numResponses: 2
# numEntries: 1

3.5. 在ldap-1上增加test4用户

[root@ldap-1 openldap]# ldapadd -x -D 'cn=admin,dc=zltest,dc=com' -W -f test4_user.ldif
Enter LDAP Password: 
adding new entry "cn=test4,ou=oa,dc=zltest,dc=com"
3.6. 在ldap-0上查看用户同步
[root@ldap-0 openldap]# ldapsearch -x -b 'dc=zltest,dc=com' '(cn=test4)'
# extended LDIF
#
# LDAPv3
# base <dc=zltest,dc=com> with scope subtree
# filter: (cn=test4)
# requesting: ALL
## test4, oa, zltest.com
dn: cn=test4,ou=oa,dc=zltest,dc=com
ou: oa
cn: test4
sn: test4
mail: test4@zltest.com
objectClass: inetOrgPerson
objectClass: organizationalPerson
userPassword:: e1NTSEF9eTZZVktFUmMraG0vcFZYTkVVbzBFcDJyZlQ0MWxUM1g=# search result
search: 2
result: 0 Success# numResponses: 2
# numEntries: 1

3.7. 最终两台LDAP数据情况

在这里插入图片描述
在这里插入图片描述
可以看到数据是保持一致的。

四、总结

MirrorMode双主同步复制机制可以实现两端服务器同时实现读写,且数据会相互同步最终保持一致性。同时还提供高可用性,在MirrorMode模式下两台服务器互为主备模式对外同时提供服务,前端使用负载均衡器(如: HAProxy、Nginx等)将请求定位到双主的任一台服务器。
本文从MirrorMode的原理介绍,到具体的安装部署,再到实际的数据操作验证,最终实现了MirrorMode模式的功能,读者可以按照本文操作步骤独自配置执行并实现和本文一致的结果。

http://www.xdnf.cn/news/2495.html

相关文章:

  • spring项目rabbitmq es项目启动命令
  • 【Pandas】pandas DataFrame rfloordiv
  • 查回来的数据除了 id,其他字段都是 null
  • 【音视频】SDL事件
  • AI 发展历史与关键里程碑_附AI 模型清单及典型应用场景以及物流自动化适合的模型选择
  • 从零开始开发一个简易的五子棋游戏:使用 HTML、CSS 和 JavaScript 实现双人对战
  • windows安装docker,发现没有hyper
  • JVM常见的垃圾回收器
  • RT Thread Studio创建USB虚拟串口工程
  • 生物医学AI的特种算力需求:冷冻电镜数据处理中的GPU加速方案
  • 互斥量函数组
  • List 的介绍 [数据结构 初阶]
  • Missashe考研日记-day28
  • 海关 瑞数 后缀分析 rs
  • 详解React Fiber架构中,reconcile阶段的具体工作流程
  • 使用 Doxygen 生成类似官网的专业文档
  • 【黑马JavaWeb+AI知识梳理】前端Web基础02 - JS+Vue+Ajax
  • WSL2里手动安装Docker 遇坑
  • 234. 回文链表(java)
  • 李沐动手深度学习(pycharm中运行笔记)——07.自动求导
  • Kaamel白皮书:IoT设备安全隐私评估实践
  • Golang | 向倒排索引上添加删除文档
  • 每天五分钟深度学习框架pytorch:使用visdom绘制损失函数图像
  • 布隆过滤器(Bloom Filter)简介
  • Vue Router 核心指南:构建高效单页应用的导航艺术
  • 用Python做有趣的AI项目4:AI 表情识别助手
  • Linux:基础IO 文件系统
  • 吴恩达深度学习作业之风格转移Neural Style Transfer (pytorch)
  • 【创新实训项目博客】数据库搭建
  • pikachu靶场-敏感信息泄露