手机版
你好,游客 登录 注册
背景:
阅读新闻

Heartbeat3.x基本安装、配置与维护

[日期:2012-05-29] 来源:Linux社区  作者:flykite [字体:大 中 小]

    4. 安装Pacemaker监控软件以及Pacemaker-GUI图形管理工具(可选)。

  1. tar zxvf ClusterLabs-pacemaker-* 
  2. cd ClusterLabs-pacemaker-* 
  3. ./autogen.sh && ./configure --prefix=$PREFIX --enable-fatal-warnings 
  4. find . -name "Makefile" -exec sed -i 's/-Werror//' {} \; 
  5. make && make install 
  6. cd .. 
  7.  
  8. ldconfig -v 
  9.  
  10. tar jxvf Pacemaker-Python-GUI-* 
  11. cd Pacemaker-Python-GUI-* 
  12. ./bootstrap && ./configure --prefix=$PREFIX --enable-fatal-warnings 
  13. find . -name "Makefile" -exec sed -i 's/-Werror//' {} \; 
  14. make && make install 
  15. cd .. 

    5. 生成随机密钥,配置authkeys文件(权限必须为600)。

  1. (echo -ne "auth 1\n1 sha1 ";dd if=/dev/urandom bs=512 count=1 | openssl md5) > authkeys 

    6. 配置文件ha.cf详细说明。

  1. # debugfile /var/log/ha-debug 
  2. logfile /var/log/ha-log    # 指定日志存放位置, 前提必须有写权限 
  3. # logfacility local0 
  4.  
  5. keepalive 2    # 心跳时间间隔, 也就是节点之间通信的时间间隔 
  6. deadtime 30    # 如果备用节点在30秒内没有收到主节点的心跳信号后, 立刻接管主节点 
  7. warntime 10    # 如果备用节点在10秒内没有收到主节点的心跳信号后, 就会往日志中写入一个警告日志, 但此时不会切换服务 
  8. initdead 120   # 在某些系统上, 系统启动或重启之后需要经过一段时间网络才能正常工作, 该选项用于解决这种情况产生的时间间隔, 取值至少为deadtime的两倍 
  9.  
  10. udpport 694    # 设置广播通信使用的端口, 694为默认使用的端口号 
  11.  
  12. # baud 19200 
  13. # serial /dev/ttyS0 
  14. # serial /dev/cuaa0 
  15. # serial /dev/cuad0 
  16. # serial /dev/cua/a 
  17.  
  18. # bcast eth0 
  19. bcast eth0 eth1    # 指明心跳使用以太网广播方式, 这里使用的是双网卡 
  20. # bcast le0 
  21. # bcast le0 le1 
  22. # mcast eth0 225.0.0.1 694 1 0 
  23. # ucast eth0 10.11.203.2 
  24.  
  25. auto_failback off    # 当备用节点接管资源后, 是否允许主节点在恢复之后进行接管(资源是否允许迁回) 
  26.  
  27. # stonith baytech /etc/ha.d/conf/stonith.baytech 
  28. # stonith_host *     baytech 10.0.0.3 mylogin mysecretpassword 
  29. # stonith_host ken3  rps10 /dev/ttyS1 kathy 0 
  30. # stonith_host kathy rps10 /dev/ttyS1 ken3 0 
  31.  
  32. # watchdog /dev/watchdog 
  33.  
  34. node node1.example.com    # 主节点主机名, 可以通过命令"uname –n"查看 
  35. node node2.example.com    # 备用节点主机名 
  36.  
  37. # ping 10.11.203.254 
  38. ping_group group1 10.11.203.254 10.13.203.254    # 选择双网卡的网关作为ping节点 
  39. # hbaping fc-card-name 
  40.  
  41. # respawn userid /path/name/to/run 
  42. # respawn hacluster /usr/lib/heartbeat/ipfail 
  43. respawn hacluster /usr/lib64/heartbeat/ipfail    # 指定ping功能的监控脚本 
  44.  
  45. # apiauth client-name gid=gidlist uid=uidlist 
  46. apiauth ipfail gid=haclient uid=hacluster        # 设置监控脚本的运行gid和uid 
  47.  
  48. # hopfudge 1 
  49. deadping 30                                      # 节点在30秒内无法ping通指定ping节点, 则认为死亡 
  50. # hbgenmethod time 
  51. # realtime off 
  52. # debug 1 
  53.  
  54. # apiauth ipfail uid=hacluster 
  55. # apiauth ccm uid=hacluster 
  56. # apiauth cms uid=hacluster 
  57. # apiauth ping gid=haclient uid=alanr,root 
  58. # apiauth default gid=haclient 
  59.  
  60. # msgfmt classic/netstring 
  61.  
  62. # use_logd yes/no 
  63. # conn_logd_time 60 
  64.  
  65. # 传输的数据进行压缩, 可选项 
  66. compression bz2 
  67. compression_threshold 2 
  68.  
  69. # 开启gui功能, 可选项 
  70. crm respawn 
  71. apiauth mgmtd uid=root 
  72. respawn root /usr/lib64/heartbeat/mgmtd -v 
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款