Saltstack File/directory synchronization update

Source: Internet
Author: User
Tags egrep saltstack

Saltstack Master-side configuration file

Cat/etc/salt/master | Egrep-v ' ^$|^# ' worker_threads:60cachedir:/data1/var/cache/salt/master # #存储缓存信息, especially salt work executes the command Timeout:30open_mode : trueauto_accept:trueautosign_timeout:0modules:-Cmdrunner_dirs: []file_roots:base:-/srv/salt/dev:-/SR  V/salt/dev/services-/srv/salt/dev/states prod:-/srv/salt/prod/services-/srv/salt/prod/statespillar_roots: Base:-/srv/pillarlog_level:infolog_level_logfile:info

Base,dev,prod is configured for a multi-environment directory, which is started in the base environment by default

Saltstack Minion configuration File Cat/etc/salt/minion | Egrep-v ' ^$|^# ' master: *****.com.cnid:192.168.1.11cachedir:/data1/var/cache/salt/minion # #缓存信息目录, Can be used to cache the master side to synchronize files/directories Random_reauth_delay:600auth_timeout:160auth_tries:5recon_default:6000recon_max: 590000recon_randomize:true

Master side:

[[Email protected] salt]# pwd/srv/salt[[email protected] salt]# lldrwxr-xr-x  3 root root   4096 Jul 24 17:38 dappclusterdrwxr-xr-x  3 root root   4096 oct 27 14:57 dbclusterdrwxr-xr-x 2  Root root   4096 aug 25 15:11 filepooldrwxr-xr-x 2 root  root   4096 oct  8 17:09 _grainsdrwxr-xr-x 2 root  root   4096 Aug 29 06:18 _modulesdrwxr-xr-x 2 root  Root   4096 aug 26 11:08 _returnersdrwxr-xr-x 3 root root    4096 jul 20 21:21 rpms-rw-r--r-- 1 root root 101510  oct 20 15:33 salt.logdrwxr-xr-x 5 root root   4096 sep  16 14:02 sysinit-rw-r--r-- 1 root root    199 aug 27 11:50 top.sls[[ email protected] salt]# more top.sls  #state的入口文件, Top.sls, the entry file base:  ' * ' for synchronous file operation:    - dappcluster.init   - dbcluster.init   -  Sysinit.conf   - sysinit.package
[[email protected] salt]# more dbcluster/init.sls/etc/dbcluster:  # #如果没有这个目录, This directory is created   file.directory: # #目录管理     - user: root  # #权限     - group: root    - dir_mode: 755     - file_mode: 755    - makedirs: true# #如果没有则创建/etc/ dbcluster/2slave_become_1slave.sh:  # #同步文件, files will be synced if changes are detected                                                 Keep master, minion consistent   file.managed:    - source: salt:// dbcluster/script/2slave_become_1slave.sh    - mode: 644    -  user: root     - group: root/etc/dbcluster/alert.pl:# #同步文件   file.managed:    -  source: salt://dbcluster/script/alert.pl    - mode: 755      - user: root    - group: root

minion End:

pwd/data1/var/cache/salt/minion/files/base # #缓存目录, directories and files synchronized from the master side are lltotal 24drwx------ 2  ROOT ROOT 4096 OCT 26 15:19 DAPPCLUSTERDRWX------ 3 root  ROOT 4096 OCT 26 15:19 DBCLUSTERDRWX------ 2 root root 4096  OCT 26 15:19 _GRAINSDRWX------ 2 root root 4096 oct 26 15:19  _MODULESDRWX------ 3 root root 4096 Oct 26 15:19  SYSINIT-RW------- 1 root root  199 Oct 26 15:19 top.slsmore  top.sls base:  ' * ':    - dappcluster.init   - dbcluster.init    - sysinit.conf   - sysinit.package   ## You can see that the Minion-side cache synchronization files are cached according to the Top.sls file defined by the master side,dappcluster/dbcluster/   sysinit  _modules and _ Grains is the salt itself cache, the specific cache of which files, need to look at each directory under the SLS&NBSPHow;   is defined. 


This article is from the "Python Random Notes" blog, so be sure to keep this source http://6252961.blog.51cto.com/6242961/1706834

Saltstack File/directory synchronization update

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.