码迷,mamicode.com
首页 > 其他好文 > 详细

salt install fastdfs

时间:2017-08-22 00:23:51      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:salt


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


技术分享



技术分享

[root@node1 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
[root@node1 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

标签:salt

原文地址:http://szgb17.blog.51cto.com/340201/1958204

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!