分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
slave:/root# cat /etc/keepalived/keepalived.confglobal_defs { router_id MySQL-ha}vrrp_instance VI_1{# 在初始化状态下定义为主设备state BACKUP# 注意网卡接口interface eth1virtual_router_id 71# 优先级,另一台改为90priority 90advert_int 1# 不主动抢占资源nopreemptauthentication {# 认证方式,可以是PASS或AH两种认证方式auth_type PASS# 认证密码auth_pass 1111}virtual_ipaddress {# 虚拟IP地址,随着state的变化而增加删除192.168.32.66}notify_master /etc/keepalived/send_master.sh}virtual_server 192.168.32.66 3306 {# 每个2秒检查一次real_server状态delay_loop 2# LVS算法lb_algo wrr# LVS模式lb_kind DR# 会话保持时间persistence_timeout 60protocol TCPreal_server 192.168.32.116 3306 {# 权重weight 3# 检测到服务down后执行的脚本notify_down /etc/keepalived/keepalived.shTCP_CHECK {# 连接超时时间connect_timeout 10# 重连次数nb_get_retry 3# 重连间隔时间delay_before_retry 3# 健康检查端口connect_port 3306}}} slave:/root# cat /etc/keepalived/send_master.sh. ~/.bash_profileperl /root/sbin/smail.pl "wo haha"