tar -zxvf haproxy-1.8.20.tar.gz
cd haproxy-1.8.20
make TARGET=linux2628 ARCH=x86_64 PREFIX=/usr/local/haproxy
make install PREFIX=/usr/local/haproxy
1 | 参数说明 |
cd /usr/local/haprpxy
1 | # ls |
mkdir conf
vim conf/haproxy.cfg
1 | ###########全局配置######### |
启动haproxy
sbin/haproxy -f conf/haproxy.cfg
配置日志
https://blog.51cto.com/zhangshijie/1742746
https://www.cnblogs.com/saneri/p/5234101.html
vim /etc/rsyslog.conf
1 | 13 $ModLoad imudp #将13行注释去除 |
重启
/etc/init.d/rsyslog restart
在master 上创建用户,并授权
1 | use mysql; |
访问测试
mysql -h 192.168.159.102 -udev -pp4ssword -P6033 -e “show variables like ‘server_id’”