天天看點

haproxy配置

cd haproxy-1.5.10/

  make TARGET=linux26 ARCH=x86_64

  make install

  mkdir /etc/haproxy

  cp examples/haproxy.cfg /etc/haproxy

  cp examples/haproxy.init /etc/init.d/haproxy

  chmod +x /etc/init.d/haproxy

  ln -s /usr/local/sbin/haproxy /usr/sbin/

  mkdir /usr/share/haproxy

  vim /etc/haproxy/haproxy.cfg

  cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.new

  mkdir /etc/haproxy/error

添加haproxy日志資訊:

vi /etc/rsyslog.conf

local0.* /var/log/haproxy.log

/etc/init.d/rsyslog restart

keepalived安裝:

  unzip prce-8.36.zip

  unzip pcre-8.36.zip

  cd pcre-8.36

  ./configure && make &&make install

  cd

  cd keepalived-1.2.15/

  ls

  ./configure 

  make

  mkdir /etc/keepalived/

  cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/

  cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/

  cp /usr/local/sbin/keepalived /usr/sbin/

cp /root/keepalived-1.2.15/keepalived/etc/init.d/keepalived.sysconfig /etc/sysconfig/keepalived

/etc/init.d/keepalived restart

繼續閱讀