1 / 18
文档名称:

HAProxy Pacemaker实现MySQL的高可用负载均衡.doc

格式:doc   大小:16KB   页数:18页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

HAProxy Pacemaker实现MySQL的高可用负载均衡.doc

上传人:好用的文档 2022/2/19 文件大小:16 KB

下载得到文件列表

HAProxy Pacemaker实现MySQL的高可用负载均衡.doc

相关文档

文档介绍

文档介绍:HAProxy + Pacemaker实现MySQL的高可用负载均衡
HAProxy + Pacemaker实现MySQL的高可用负载均衡 Posted on 2013 年 5 月 20 日 by JoseHAProxy + 7
user stats insecure-password 123456
# HAProxy的管理界面
listen stats *:8081
mode http
stats enable
stats refresh 60s
stats uri /
stats hide-version
acl AuthOkay_ReadOnly http_auth(STATSUSERS)
acl AuthOkay_Admin http_auth_group(STATSUSERS) admin
stats http-request auth realm Haproxy_Admin_Page unless AuthOkay_ReadOnly
stats admin if AuthOkay_Admin
HAProxy的启动管理脚本:
# cat /etc/
#!/bin/bash
#
# chkconfig: 2345 85 15
# description: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited # for high availability environments.
# processname: haproxy
# config: /etc/
# pidfile: /var/run/
# Source function library.
if [ -f /etc/ ]; then
. /etc/
elif [ -f /etc//functions ] ; then
. /etc//functions
else
exit 0
fi
CONF_FILE="/etc/haproxy/"
HAPROXY_BINARY="/usr/local/sbin/haproxy"
PID_FILE="/var/run/"
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f ${CONF_FILE} ] || exit 1
RETVAL=0
start() {
$HAPROXY_BINARY -c -q -f $CONF_FILE
if [ $? -ne 0 ]; then
echo "Errors found in configuration file."
return 1
fi
echo -n "Starting HAproxy: "
daemon $HAPROXY_BINARY -D -f $CONF_FILE -p $PID_FILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/haproxy
return $RETVAL
}
stop() {
echo -n "Shutting down HAproxy: "
killproc haproxy -USR1
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/haproxy
[ $RETVAL -eq 0 ] && rm -f $PID_FILE
return $RETVAL
}
restart() {
$HAPROXY_BINARY -c -q -f $CONF_FILE
if [ $? -ne 0 ]; then
echo "Errors found in configuration file, check it with '