###################初始化时定义好的包########################################## include: - pkg.pkg-init ###################HAPROXY安装########################################### haproxy-install: file.managed: - name: /usr/local/src/haproxy-1.7.2.tar.gz - source: salt://haproxy/files/haproxy-1.7.2.tar.gz - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src/ && tar zxf haproxy-1.7.2.tar.gz && cd haproxy-1.7.2 && make TARGET=linux26 PREFIX=/usr/loc al/haproxy && make install PREFIX=/usr/local/haproxy - unless: test -d /usr/local/haproxy - require: - pkg: pkg-init - file: haproxy-install haproxy-init: file.managed: - name: /etc/init.d/haproxy - source: salt://haproxy/files/haproxy.init - user: root - group: root - mode: 755 - require: - cmd: haproxy-install cmd.run: - name: chkconfig --add haproxy - unless: chkconfig --list |grep haproxy - require: - file: /etc/init.d/haproxy net.ipv4.ip_nonlocal_bind: sysctl.present: - value: 1 haproxy-config-dir: file.directory: - name: /etc/haproxy - user: root - group: root - mode: 755我们提供的服务有:成都网站设计、做网站、微信公众号开发、网站优化、网站认证、永德ssl等。为近1000家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的永德网站制作公司
########################haproxy-outside.sls###################################### include: - haproxy.install haproxy-service: file.managed: - name: /etc/haproxy/haproxy.cfg - source: salt://cluster/files/haproxy-outside.cfg - user: root - group: root - mode: 644 cmd.run: - name: useradd -s /sbin/nologin haproxy - onlyif: id haproxy|echo $? service.running: - name: haproxy - enable: True - reload: True - require: - cmd: haproxy-init - watch: - file: haproxy-service
#########################top.sls################################################### base: '*' : - init.env_init prod: 'web12.limingyu.com': - cluster.haproxy-outside 'web13.limingyu.com': - cluster.haproxy-outside
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。