[[email protected] ~]$ sudo wget http://soft.51yuki.cn/haproxy-1.8.3.tar.gz
--2018-01-28 16:34:02-- http://soft.51yuki.cn/haproxy-1.8.3.tar.gz
Resolving soft.51yuki.cn (soft.51yuki.cn)... 180.101.217.117, 180.101.217.192, 180.101.217.115, ...
Connecting to soft.51yuki.cn (soft.51yuki.cn)|180.101.217.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2043861 (1.9M) [application/gzip]
Saving to: ‘haproxy-1.8.3.tar.gz’
100%[=========================================================================================================================================>] 2,043,861 2.39MB/s in 0.8s
2018-01-28 16:34:03 (2.39 MB/s) - ‘haproxy-1.8.3.tar.gz’ saved [2043861/2043861]
[[email protected] ~]$ tar xf haproxy-1.8.3.tar.gz
[[email protected] ~]$ cd haproxy-1.8.3
[[email protected] haproxy-1.8.3]$ sudo make TARGET=linux2628 PREFIX=/application/haproxy && make install PREFIX=/usr/local/haproxy ( 要确保application目录,admin用户有写入权限)
2)找到配置文件和启动脚本
[[email protected] examples]$ pwd
/home/admin/haproxy-1.8.3/examples
[[email protected] examples]$ sudo vim haproxy.init (更改里面的)
BIN=/application/haproxy/sbin/$BASENAME (这个更改在haproxy安装的目录) ---------------然后如果通过saltstack管理,就需要把这个haproxy.init启动脚本放到saltstack指定目录