Try this, no any errors:
# Install HAProxy 1.5 and Upgrade to 1.7
sudo yum -y install haproxy # Install Generic Version (1.5) this will
create necessary folders, config files, etc.
wget https://www.haproxy.org/download/1.7/src/haproxy-1.7.9.tar.gz
tar -xzf haproxy-1.7.9.tar.gz
cd haproxy-1.7.9
make TARGET=linux2628 USE_PCRE=1 USE_PCRE_JIT=1 USE_OPENSSL=1 USE_ZLIB=1
USE_REGPARM=1
sudo make install
sudo cp -f /usr/local/sbin/haproxy /usr/sbin # Overwrite
version 1.5 with new 1.7
sudo service haproxy restart
sudo chkconfig haproxy on
Respectfully,
*Denis Astahov*DevOps Engineer
On Wed, Aug 30, 2017 at 12:03 PM, James Moore <jamesaamo...@gmail.com>
wrote:
> Good evening,
>
>
>
> Hope you’re well, this is a bit cheeky but I’m hoping you may be able to
> advise …..
>
>
>
> When I install haproxy on Centos 7 via the repo “ sudo yum install
> haproxy” it installs 1.5 and eveyrthings fine
>
>
>
> When I install via the below method I get an error saying the service is
> bad, I have a work around however I think it’s impacting my ability to
> track the service via keepalived for failover purposes,
>
>
>
> Any ideas would be appreciated :
>
>
>
>
>
>
>
> sudo yum install gcc pcre-static pcre-devel -y
>
> wget https://www.haproxy.org/download/1.7/src/haproxy-1.7.8.tar.gz -O
> ~/haproxy.tar.gz
>
> tar xzvf ~/haproxy.tar.gz -C ~/
>
> cd ~/haproxy-1.7.8
>
> make TARGET=linux2628
>
> sudo make install
>
> sudo mkdir -p /etc/haproxy
>
> sudo mkdir -p /run/haproxy
>
> sudo chmod +x /run/haproxy
>
> sudo mkdir -p /var/lib/haproxy
>
> sudo touch /var/lib/haproxy/stats
>
> sudo ln -s /usr/local/sbin/haproxy /usr/sbin/haproxy
>
> sudo cp ~/haproxy-1.7.8/examples/haproxy.init /etc/init.d/haproxy
>
> sudo chmod 755 /etc/init.d/haproxy
>
> sudo systemctl daemon-reload
>
> sudo useradd -r haproxy
>
> haproxy -v
>
>
>
>
>
>
>
>
> Create service file to stop "sudo systemctl status haproxy" throwing "bad"
> errors
>
>
>
>
>
>
> # Create a file as per below :
>
>
>
> sudo vi /etc/systemd/system/haproxy.service
>
>
>
> #To edit press "I" , the bottom left should popup saying "insert"
>
> #Paste in the below config :
>
>
>
>
>
> #*
>
> [Unit]
>
> Description=HAproxy
>
> After=network.target
>
>
>
> [Service]
>
> Type=forking
>
> ExecStart=/etc/rc.d/init.d/haproxy start
>
> ExecStop=/etc/rc.d/init.d/haproxy stop
>
>
>
> [Install]
>
> WantedBy=multi-user.target
>
> #*
>
>
>
>
> --
>
>
>