5.PHP Redis模塊php
[root@salt-master-1 ~]# cd /srv/salt/prod/php/files/ [root@salt-master-1 files]# wget # [root@salt-master-1 files]# cat /srv/salt/prod/php/php-redis.sls redis-plugin: file.managed: - name: /usr/local/src/2.8.23.tar.gz - source: salt://php/files/2.8.23.tar.gz - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src && tar zxf 2.8.23.tar.gz && cd 2.8.23 && /usr/local/php-fastcgi/bin/phpize && ./configure --with-php-config=/usr/local/php-fastcgi/bin/php-config && make && make install - unless: test -f /usr/local/php-fastcgi/lib/php/extensions/*/redis.so require: - file: redis-plugin - cmd: php-install /usr/localphp-fastcgi/etc/php.ini: file.append: - text: - extension=redis.so
6、PHP Memcached模塊redis
PHP鏈接Memcache有兩個擴展模塊:Memcache和Memcached,須要根據實際狀況進行選擇。shell
PHP Memcache擴展包:app
[root@salt-master-1 files]# cd /srv/salt/prod/php/files/ [root@salt-master-1 files]# wget # [root@salt-master-1 files]# cat /srv/salt/prod/php/php-memcache.sls memcache-plugin: file.managed: - name: /usr/local/src/memcached-1.4.25.tar.gz - source: salt://php/files/memcached-1.4.25.tar.gz - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src/ && tar zxf memcached-1.4.25.tar.gz && cd memcached-1.4.25 && /usr/local/php-fastcgi/bin/phpize && ./configure --enable-memcache --with-php-config=/usr/local/php-fastcgi/bin/php-config && make && make install - unless: test -f /usr/local/php-fastcgi/lib/php/extensions/*/memcache.so require: - file: mamcache-plugin - cmd: php-install /usr/local/php-fastcgi/etc/php.ini: file.append: - text: - extension=memcache.so
7、案例擴展less
使用Grains區分不一樣的操做系統memcached
使用Pillar實現更靈活的配置文件的管理ui
修改案例的狀態文件,使用更好的編寫方法操作系統
如何將現有環境中的各類服務使用SaltStack進行管理。code