HAProxy双机高可用方案之HAProxy+Keepalived
发布时间:2025-11-03 21:07:10 作者:玩站小弟
我要评论
复制#!/bin/sh #chkconfig35on #description:HAProxyisaTCP/HTTPreverseproxywhichi
。

复制#!/bin/sh # chkconfig 35 on # description: HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments. # Source function library. if [ -f /etc/init.d/functions ]; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -f /usr/local/haproxy/conf/haproxy.cfg ] || exit 1 RETVAL=0 start() { /usr/local/haproxy/sbin/haproxy -c -q -f /usr/local/haproxy/conf/haproxy.cfg if [ $?机高 -ne 0 ]; then echo "Errors found in configuration file." return 1 fi echo -n "Starting HAproxy: " daemon /usr/local/haproxy/sbin/haproxy -D -f /usr/local/haproxy/conf/haproxy.cfg -p /var/run/haproxy.pid 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 /var/run/haproxy.pid return $RETVAL } restart() { /usr/local/haproxy/sbin/haproxy -c -q -f /usr/local/haproxy/conf/haproxy.cfg if [ $? -ne 0 ]; then echo "Errors found in configuration file, check it with haproxy check." return 1 fi stop start } check() { /usr/local/haproxy/sbin/haproxy -c -q -V -f /usr/local/haproxy/conf/haproxy.cfg } rhstatus() { status haproxy } condrestart() { [ -e /var/lock/subsys/haproxy ] && restart || : } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) restart ;; condrestart) condrestart ;; status) rhstatus ;; check) check ;; *) echo $"Usage: haproxy {start|stop|restart|reload|condrestart|status|check}" RETVAL=1 esac exit $RETVAL 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.
相关文章
苹果电脑如何安装Win10系统(一步步教你在苹果电脑上安装Windows10系统)
摘要:在过去,苹果电脑一直使用自家研发的MacOS系统,而Windows系统则是微软公司的杰作。然而,由于某些原因,许多用户希望在自己的苹果电脑上也能安装Windows10系统。本文将详...2025-11-03- 摘要:在现代社会,导航仪器已经成为人们出行必备的工具之一。而e路航x100作为一款备受关注的导航仪器,它的功能和性能如何呢?本文将从多个方面来详细介绍。外观与设计...2025-11-03
美的天翼星空调的优势与特点(舒适静音,智能节能,高效降温,品质保障)
摘要:随着科技的不断发展,空调成为了我们生活中不可或缺的家电之一。而美的天翼星空调作为市场上备受瞩目的产品,以其卓越的性能和出色的品质赢得了广大消费者的青睐。本文将为大家介绍美的天翼星空...2025-11-03G540CPU(深度剖析G540CPU的特点和优势,为你的计算机提供卓越性能)
摘要:计算机的性能对于许多用户来说至关重要,而选择一款强劲的处理器是提升计算机性能的关键。在众多处理器中,G540CPU凭借其卓越的性能和出色的特点成为用户的首选之一。本文将深入探讨G5...2025-11-03- 摘要:随着技术的不断发展,操作系统也在不断更新迭代。Windows作为最常用的操作系统之一,经常推出更新清理功能以改善性能和修复漏洞。然而,有人认为这只是浪费时间,而有人坚信更新清理是保...2025-11-03
- 摘要:作为音响领域的知名品牌,爱华音响以其出色的音质表现和卓越的品质赢得了广大消费者的青睐。无论是家庭娱乐还是专业音乐演出,爱华音响都能带来令人陶醉的听觉享受。本文将详细介绍爱华音响的特...2025-11-03

最新评论