???????????????????д??SaltStack?? LVS????????? ?? LVS service????????? ?? LVS server????????? ??????????SaltStack??? Loadblance(DR)??RealServer?????ù???.
??????????
????LVS-DR????????? ????????????LVS-DR???????????????·?????????????????ip_forward???????б???? ????? LVS DR?????????
???????????
?????????????????LVS????????????????lvs??????????loadblance???????IP????192.168.36.10?????????web-01??web-02???????????????RealServer?? ?????IP???????192.168.36.11??192.168.36.12
????LVS VIP: 192.168.36.33?? Port: 80?? VIP????lvs??eth1??
???????????loadblance?????Linux????????ipvsadm?? Windows/Unix??????????????????????????......
????????
????Note
???????????в???????Master?????
????????SaltStack LVS???
???????????Salt?汾?????????lvs??飬????????????????????:
????salt 'lvs' cmd.run "python -c 'import salt.modules.lvs'"
???????????? ImportError ???????????????а??????????????2???:
????test -d /srv/salt/_modules || mkdir /srv/salt/_modules
????test -d /srv/salt/_states || mkdir /srv/salt/_states
????wget https://raw.github.com/saltstack/salt/develop/salt/modules/lvs.py -O /srv/salt/_modules/lvs.py
????wget https://raw.github.com/saltstack/salt/develop/salt/states/lvs_service.py -O /srv/salt/_states/lvs_service.py
????wget https://raw.github.com/saltstack/salt/develop/salt/states/lvs_server.py -O /srv/salt/_states/lvs_server.py
????????pillar
/srv/pillar/lvs/loadblance.sls
lvs-loadblance:
- name: lvstest
vip: 192.168.36.33
vip-nic: eth1
port: 80
protocol: tcp
scheduler: wlc
realservers:
- name: web-01
ip: 192.168.36.11
port: 80
packet_forward_method: dr
weight: 10
- name: web-02
ip: 192.168.36.12
port: 80
packet_forward_method: dr
weight: 30
/srv/pillar/lvs/realserver.sls
lvs-realserver:
- name: lvstest
vip: 192.168.36.33
/srv/pillar/top.sls
base:
'lvs':
- lvs.loadblance
'web-0*':
- lvs.realserver