Compile HAProxy 1.8x CentOS 7

Installing Haproxy 1.8.9 CentOS core 7

Tambahkan beberapa file dibawah ini :

/etc/security/limit.conf
haproxy soft nofile 1000000
haproxy hard nofile 1000000
#root soft nofile 1000000
#root hard nofile 1000000


/etc/sysctl.conf
fs.file-max = 1000000
fs.nr_open = 1000000
net.ipv4.ip_local_port_range = 1000 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_nonlocal_bind = 1

## Override limit
ulimit -n 1000000
ulimit -u 1000000
ulimit -Hn
ulimit -Sn

## Install Haproxy + Dependency
yum install gcc pcre-static pcre-devel systemd-devel -y
wget https://www.haproxy.org/download/1.8/src/haproxy-1.8.9.tar.gz
tar -xzvf haproxy-1.8.9.tar.gz && cd haproxy-1.8.9
make TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_OPENSSL=1 USE_SYSTEMD=1 USE_PCRE=1
make install

## Create system service to /usr/lib/systemd/system/haproxy.service
[Unit]
Description=HAProxy Load Balancer
After=syslog.target network.target

[Service]
#EnvironmentFile=/etc/sysconfig/haproxy
Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid"
ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q
ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE $OPTIONS
ExecReload=/usr/sbin/haproxy -f $CONFIG -c -q
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
Type=notify

[Install]
WantedBy=multi-user.target

## Reload and enable haproxy to systemd
systemctl daemon-reload
systemctl enable haproxy
systemctl start haproxy
systemctl status haproxy

Sekian tutorial meng-compile haproxy 1.8x from source di CentOS 7
Semoga Bermanfaat..
Category: , , ,
Reaksi: 

0 komentar:

Post a Comment