2332323 发表于 2017-8-22 08:36:58

salt install fastdfs

# 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


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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.防火墙问题

页: [1]
查看完整版本: salt install fastdfs