提示信息

Keepalived脚本

峰子 已关注
  • [root@s1 keepalived-2.0.18]# pwd
  • /alidata1/server/keepalived-2.0.18
  • [root@s1 keepalived-2.0.18]# ll
  • total 0
  • drwxr-xr-x. 2 root root 21 Sep 24 05:18 bin
  • drwxr-xr-x. 4 root root 41 Sep 24 05:18 etc
  • drwxr-xr-x. 2 root root 24 Sep 24 05:18 sbin
  • drwxr-xr-x. 5 root root 40 Sep 24 05:18 share
    1. [root@s1 keepalived-2.0.18]# more etc/keepalived/keepalived.conf
    2. ! Configuration File for keepalived
    3. global_defs {
    4. router_id server1
    5. vrrp_skip_check_adv_addr
    6. # vrrp_strict
    7. vrrp_garp_interval 0
    8. vrrp_gna_interval 0
    9. }
    10. vrrp_script hf_check{
    11. script "/alidata1/haifeng/sh/check_health.sh"
    12. interval 5
    13. weight -10
    14. }
    15. vrrp_instance VI_1 {
    16. state MASTER
    17. interface ens33
    18. virtual_router_id 50
    19. priority 100
    20. advert_int 1
    21. authentication {
    22. auth_type PASS
    23. auth_pass 1111
    24. }
    25. virtual_ipaddress {
    26. 192.168.1.220/32 dev ens33
    27. }
    28. track_script{
    29. hf_check weight -5
    30. }
    31. notify_master "/alidata1/haifeng/sh/notify_master.sh"
    32. notify_backup "/alidata1/haifeng/sh/notify_backup.sh"
    33. notify_fault "/alidata1/haifeng/sh/notify_fault.sh"
    34. notify "/alidata1/haifeng/sh/notify.sh"
    35. }
    峰子 关注 已关注

    最近一次登录:2019-10-10 14:28:58   

    暂时还没有签名,请关注我或评论我的文章

    峰子
      10月12日
    1. firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 --in-interface ens33 --destination 224.0.0.18 --protocol vrrp -j ACCEPT
    2. firewall-cmd --direct --permanent --add-rule ipv4 filter OUTPUT 0 --out-interface ens33 --destination 224.0.0.18 --protocol vrrp -j ACCEPT
    峰子
      10月12日
    1. firewall-cmd --zone=public --add-port=3306/tcp --permanent
    2. service firewalld restart
    ×
    分享到朋友圈