1. 程式人生 > >salt install fastdfs

salt install fastdfs

salt


參考https://chegva.com/794.html


技術分享



技術分享

[[email protected] prod]# cat cluster/fastdfs.sls 
include:
  - modules.fastdfs.install
fastdfs-service:
  file.managed:
    - name: /etc/fdfs/storage.conf
    - source: salt://cluster/files/storage.conf
    - mode: 644
    - user: root
    - group: root
    - template: jinja
    - IP: {{ grains[‘fqdn_ip4‘] }}
  service.running:
    - name: fdfs_storaged
    - enable: True
    - reload: True
    - require:
      - cmd: fastdfs-source-install
    - watch:
      - file: fastdfs-service
[[email protected] modules]# for i in `find . -name "*.sls"`;do echo $i &&cat $i;done
./libfast/install.sls
libfast-source-install:
  file.managed:
    - name: /usr/local/src/libfastcommon-1.0.7.tar.gz
    - source: salt://modules/libfast/files/libfastcommon-1.0.7.tar.gz
    - user: root
    - group: root
    - mode: 755
  cmd.run:
    - name: cd /usr/local/src && tar zxf libfastcommon-1.0.7.tar.gz && cd libfastcommon-1.0.7 && ./make.sh && ./make.sh install
    - unless: test -d /usr/local/src/libfastcommon-1.0.7
    - require:
      - file: libfast-source-install
./fastdfs/install.sls
include:
  - modules.pkg.make
  - modules.libfast.install
fastdfs-source-install:
  file.managed:
    - name: /usr/local/src/FastDFS_v5.05.tar.gz
    - source: salt://modules/fastdfs/files/FastDFS_v5.05.tar.gz
    - user: root
    - group: root
    - mode: 755
  cmd.run:
    - name: mkdir -p /data/fastdfs && cd /usr/local/src && tar zxf FastDFS_v5.05.tar.gz && cd FastDFS && ./make.sh && ./make.sh install && sed -i ‘s%/usr/local/bin%/usr/bin%g‘ /etc/init.d/fdfs_storaged
    - unless: test -d /usr/local/src/FastDFS && test -d /data/fastdfs
    - require:
      - file: fastdfs-source-install
      - pkg: make-pkg
fastdfs-init:
  cmd.run:
    - name: chkconfig --add fdfs_storaged
    - unless: chkconfig --list | grep fdfs_storaged
    - require:
      - cmd: fastdfs-source-install
./pkg/make.sls
make-pkg:
  pkg.installed:
    - pkgs:
      - gcc
      - gcc-c++
      - glibc
      - make
      - autoconf
      - openssl
      - openssl-devel
      - pcre
      - pcre-devel
      - gd
      - gd-devel
      - lua-devel


1.ln -s /data/fastdfs/data /data/fastdfs/data/M00

2.防火墻問題


本文出自 “要有夢想,萬一實現了呢” 博客,請務必保留此出處http://szgb17.blog.51cto.com/340201/1958204

salt install fastdfs