安装优化

pull/504/head
Mr Chen 2 years ago
parent d27db369dc
commit 2a16e1d262
  1. 4
      plugins/haproxy/conf/haproxy.conf
  2. 22
      plugins/haproxy/versions/2.6/install.sh

@ -1,12 +1,12 @@
global global
daemon daemon
log 127.0.0.1 local0 #一般情况下,可关闭
log 127.0.0.1 haproxy0
pidfile /tmp/haproxy.pid pidfile /tmp/haproxy.pid
maxconn 4000 maxconn 4000
user haproxy user haproxy
group haproxy group haproxy
defaults defaults
mode http mode http
log global log global

@ -20,8 +20,7 @@ VERSION=2.6.4
MIN_VERSION=2.6 MIN_VERSION=2.6
Install_App() Install_App()
{ {
echo '正在安装Haproxy软件...'
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/haproxy mkdir -p $serverPath/haproxy
APP_DIR=${serverPath}/source/haproxy APP_DIR=${serverPath}/source/haproxy
@ -64,7 +63,22 @@ Install_App()
fi fi
echo $MIN_VERSION > $serverPath/haproxy/version.pl echo $MIN_VERSION > $serverPath/haproxy/version.pl
echo 'Install_HA' > $install_tmp echo '安装Haproxy成功' > $install_tmp
#Haproxy日志配置
if [ -f /etc/rsyslog.conf ];then
find_ha=`cat /etc/rsyslog.conf | grep haproxy`
if [ $find_ha != "" ];then
echo $find_ha
else
echo "---------------------------------------------"
echo "haproxy0.* ${serverPath}/haproxy/haproxy.log" > /etc/rsyslog.conf
systemctl restart syslog
echo "syslog默认的haproxy配置"
echo "haproxy0.* ${serverPath}/haproxy/haproxy.log"
echo "---------------------------------------------"
fi
fi
#删除解压源码 #删除解压源码
if [ -d ${APP_DIR}/haproxy-${VERSION} ];then if [ -d ${APP_DIR}/haproxy-${VERSION} ];then
@ -79,7 +93,7 @@ Uninstall_App()
fi fi
rm -rf $serverPath/haproxy rm -rf $serverPath/haproxy
echo "Uninstall_HA" > $install_tmp echo "卸载Haproxy成功"
} }
action=$1 action=$1

Loading…
Cancel
Save