生活随笔
收集整理的這篇文章主要介紹了
自动化运维之SaltStack实践
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
? ? ? ? ? ? ? ? ? ? ? ? ? ?自動(dòng)化運(yùn)維之SaltStack實(shí)踐
1.1、環(huán)境
| linux-node1(master服務(wù)端) | 192.168.0.15 |
| linux-node2(minion客戶端) | 192.168.0.16 |
1.2、SaltStack三種運(yùn)行模式介紹
| Local | 本地 |
| Master/Minion | 傳統(tǒng)運(yùn)行方式(server端跟agent端) |
| Salt SSH | SSH |
1.3、SaltStack三大功能 ●遠(yuǎn)程執(zhí)行 ●配置管理 ●云管理 1.4、SaltStack安裝基礎(chǔ)環(huán)境準(zhǔn)備 [root@linux-node1 ~]# cat /etc/redhat-release ?##查看系統(tǒng)版本 CentOS release 6.7 (Final) [root@linux-node1 ~]# uname -r?##查看系統(tǒng)內(nèi)核版本 2.6.32-573.el6.x86_64 [root@linux-node1 ~]# getenforce?##查看selinux的狀態(tài) Enforcing [root@linux-node1 ~]# setenforce 0?##關(guān)閉selinux [root@linux-node1 ~]# getenforce ? Permissive [root@linux-node1 ~]# /etc/init.d/iptables stop [root@linux-node1 ~]# /etc/init.d/iptables stop [root@linux-node1 ~]# ifconfig eth0|awk -F '[: ]+' 'NR==2{print $4}'?##過(guò)濾Ip地址 192.168.0.15 [root@linux-node1 ~]# hostname?##查看主機(jī)名 linux-node1.zhurui.com [root@linux-node1 yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo?http://mirrors.aliyun.com/repo/epel-6.repo??##安裝salt必須使用到epel源? 1.4、安裝Salt 服務(wù)端: [root@linux-node1 yum.repos.d]# yum install -y salt-master salt-minion?##salt-master包跟salt-minion包 [root@linux-node1 yum.repos.d]# chkconfig salt-master on ?##加入到開(kāi)機(jī)自動(dòng)啟動(dòng) [root@linux-node1 yum.repos.d]# chkconfig salt-minion on ?##加入到開(kāi)機(jī)自動(dòng)啟動(dòng) [root@linux-node1 yum.repos.d]# /etc/init.d/salt-master start ??##啟動(dòng)salt-master Starting salt-master daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??[ ?OK ?] 啟動(dòng)到這里需要修改minion配置文件,才能啟動(dòng)salt-minion服務(wù) [root@linux-node1 yum.repos.d]# grep '^[a-z]' /etc/salt/minion ?? master: 192.168.0.15 ?##指定master主機(jī) [root@linux-node1 yum.repos.d]# cat /etc/hosts 192.168.0.15 linux-node1.zhurui.com linux-node1??##確認(rèn)主機(jī)名是否解析 192.168.0.16 linux-node2.zhurui.com linux-node2 解析結(jié)果:
[root@linux-node1 yum.repos.d]#?ping linux-node1.zhurui.comPING linux-node1.zhurui.com?(192.168.0.15)56(84)?bytes of data.64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=1?ttl=64?time=0.087?ms64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=2?ttl=64?time=0.060?ms64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=3?ttl=64?time=0.053?ms64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=4?ttl=64?time=0.060?ms64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=5?ttl=64?time=0.053?ms64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=6?ttl=64?time=0.052?ms64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=7?ttl=64?time=0.214?ms64?bytes?from?linux-node1.zhurui.com?(192.168.0.15):?icmp_seq=8?ttl=64?time=0.061?ms [root@linux-node1 yum.repos.d]# /etc/init.d/salt-minion start ?##啟動(dòng)minion客戶端 Starting salt-minion daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] [root@linux-node1 yum.repos.d]# 客戶端: [root@linux-node2 ~]# yum install -y salt-minion ?##安裝salt-minion包,相當(dāng)于客戶端包 [root@linux-node2 ~]# chkconfig salt-minion on ?##加入開(kāi)機(jī)自啟動(dòng) [root@linux-node2 ~]# grep '^[a-z]' /etc/salt/minion ??##客戶端指定master主機(jī) master: 192.168.0.15 [root@linux-node2 ~]# /etc/init.d/salt-minion start ?##接著啟動(dòng)minion Starting salt-minion daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] 1.5、Salt秘鑰認(rèn)證設(shè)置 1.5.1使用salt-kes -a linux*命令之前在目錄/etc/salt/pki/master目錄結(jié)構(gòu)如下
1.5.2使用salt-kes -a linux*命令將秘鑰通過(guò)允許,隨后minions_pre下的文件會(huì)轉(zhuǎn)移到minions目錄下
[root@linux-node1 minion]#?salt-key?-a linux*The?following keys are going to be accepted:UnacceptedKeys:linux-node1.zhurui.comlinux-node2.zhurui.comProceed?[n/Y]?YKeyfor?minion linux-node1.zhurui.com accepted.Keyfor?minion linux-node2.zhurui.com accepted.[root@linux-node1 minion]#?salt-keyAcceptedKeys:linux-node1.zhurui.comlinux-node2.zhurui.comDeniedKeys:UnacceptedKeys:RejectedKeys: 1.5.3此時(shí)目錄機(jī)構(gòu)變化成如下:
1.5.4并且伴隨著客戶端/etc/salt/pki/minion/目錄下有master公鑰生成 1.6、salt遠(yuǎn)程執(zhí)行命令詳解 1.6.1?salt '*' test.ping 命令 [root@linux-node1 master]# salt '*' test.ping ?##salt命令 ?test.ping的含義是,test是一個(gè)模塊,ping是模塊內(nèi)的方法 linux-node2.zhurui.com: True linux-node1.zhurui.com: True [root@linux-node1 master]#? 1.6.2 ?salt '*' cmd.run 'uptime' 命令
1.7、saltstack配置管理 1.7.1編輯配置文件/etc/salt/master,將file_roots注釋去掉
1.7.2接著saltstack遠(yuǎn)程執(zhí)行如下命令 [root@linux-node1 master]# ls /srv/ [root@linux-node1 master]# mkdir /srv/salt [root@linux-node1 master]# /etc/init.d/salt-master restart Stopping salt-master daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] Starting salt-master daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] [root@linux-node1 salt]# cat apache.sls ??##進(jìn)入到/srv/salt/目錄下創(chuàng)建 [root@linux-node1 salt]# salt '*' state.sls apache ?##接著執(zhí)行如下語(yǔ)句 接著會(huì)出現(xiàn)如下報(bào)錯(cuò):
便捷apache.sls文件添加如下: 最后成功如下:
[root@linux-node1 salt]#?salt?'*'?state.sls apachelinux-node2.zhurui.com:----------ID:?apache-installFunction:?pkg.installedName:?httpdResult:TrueComment:Package?httpd is already installed.Started:22:38:52.954973Duration:1102.909?msChanges:----------ID:?apache-installFunction:?pkg.installedName:?httpd-develResult:TrueComment:Package?httpd-devel is already installed.Started:22:38:54.058190Duration:0.629?msChanges:----------ID:?apache-serviceFunction:?service.runningName:?httpdResult:TrueComment:Service?httpd has been enabled,?and is runningStarted:22:38:54.059569Duration:1630.938?msChanges:----------httpd:TrueSummary------------Succeeded:3(changed=1)Failed:0------------Total?states run:3linux-node1.zhurui.com:----------ID:?apache-installFunction:?pkg.installedName:?httpdResult:TrueComment:Package?httpd is already installed.Started:05:01:17.491217Duration:1305.282?msChanges:----------ID:?apache-installFunction:?pkg.installedName:?httpd-develResult:TrueComment:Package?httpd-devel is already installed.Started:05:01:18.796746Duration:0.64?msChanges:----------ID:?apache-serviceFunction:?service.runningName:?httpdResult:TrueComment:Service?httpd has been enabled,?and is runningStarted:05:01:18.798131Duration:1719.618?msChanges:----------httpd:TrueSummary------------Succeeded:3(changed=1)Failed:0------------Total?states run:3[root@linux-node1 salt]# 1.7.3驗(yàn)證使用saltstack安裝httpd是否成功
linux-node1: [root@linux-node1 salt]# lsof -i:80 ?##已經(jīng)成功啟動(dòng) COMMAND ?PID ? USER ? FD ? TYPE DEVICE SIZE/OFF NODE NAME httpd ? 7397 ? root ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7399 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7400 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7401 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7403 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7404 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7405 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7406 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 7407 apache ? ?4u ?IPv6 ?46164 ? ? ?0t0 ?TCP *:http (LISTEN)
linux-node2: [root@linux-node2 pki]# lsof -i:80 COMMAND ? PID ? USER ? FD ? TYPE DEVICE SIZE/OFF NODE NAME httpd ? 12895 ? root ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12897 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12898 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12899 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12901 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12902 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12906 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12908 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) httpd ? 12909 apache ? ?4u ?IPv6 ?47532 ? ? ?0t0 ?TCP *:http (LISTEN) [root@linux-node2 pki]#? 1.7.4使用saltstack狀態(tài)管理 [root@linux-node1 salt]# salt '*' state.highstate 2.1、SaltStack之Grains數(shù)據(jù)系統(tǒng) ●Grains ●Pillar 2.1.1使用salt命令查看系統(tǒng)版本
[root@linux-node1 salt]#?salt?'linux-node1*'?grains.lslinux-node1.zhurui.com:-SSDs-?biosreleasedate-?biosversion-?cpu_flags-?cpu_model-?cpuarch-?domain-?fqdn-?fqdn_ip4-?fqdn_ip6-?gpus-?host-?hwaddr_interfaces-?id-?init-?ip4_interfaces-?ip6_interfaces-?ip_interfaces-?ipv4-?ipv6-?kernel-?kernelrelease-?locale_info-?localhost-?lsb_distrib_codename-?lsb_distrib_id-?lsb_distrib_release-?machine_id-?manufacturer-?master-?mdadm-?mem_total-?nodename-?num_cpus-?num_gpus-?os-?os_family-?osarch-?oscodename-?osfinger-?osfullname-?osmajorrelease-?osrelease-?osrelease_info-?path-?productname-?ps-?pythonexecutable-?pythonpath-?pythonversion-?saltpath-?saltversion-?saltversioninfo-?selinux-?serialnumber-?server_id-?shell-?virtual-?zmqversion[root@linux-node1 salt]# 2.1.2系統(tǒng)版本相關(guān)信息:
[root@linux-node1 salt]#?salt?'linux-node1*'?grains.itemslinux-node1.zhurui.com:----------SSDs:biosreleasedate:07/31/2013biosversion:6.00cpu_flags:-?fpu-?vme-?de-?pse-?tsc-?msr-?pae-?mce-?cx8-?apic-?sep-?mtrr-?pge-?mca-?cmov-?pat-?pse36-?clflush-?dts-?mmx-?fxsr-?sse-?sse2-?ss-?syscall-?nx-?rdtscp-?lm-?constant_tsc-?up-?arch_perfmon-?pebs-?bts-?xtopology-?tsc_reliable-?nonstop_tsc-?aperfmperf-?unfair_spinlock-?pni-?ssse3-?cx16-?sse4_1-?sse4_2-?x2apic-?popcnt-?hypervisor-?lahf_lm-?arat-?dtscpu_model:Intel(R)Core(TM)?i3 CPU M?380@2.53GHzcpuarch:x86_64domain:zhurui.comfqdn:linux-node1.zhurui.comfqdn_ip4:-192.168.0.15fqdn_ip6:gpus:|_----------model:SVGA II?Adaptervendor:unknownhost:linux-node1hwaddr_interfaces:----------eth0:00:0c:29:fc:ba:90lo:00:00:00:00:00:00id:linux-node1.zhurui.cominit:upstartip4_interfaces:----------eth0:-192.168.0.15lo:-127.0.0.1ip6_interfaces:----------eth0:-?fe80::20c:29ff:fefc:ba90lo:-::1ip_interfaces:----------eth0:-192.168.0.15-?fe80::20c:29ff:fefc:ba90lo:-127.0.0.1-::1ipv4:-127.0.0.1-192.168.0.15ipv6:-::1-?fe80::20c:29ff:fefc:ba90kernel:Linuxkernelrelease:2.6.32-573.el6.x86_64locale_info:----------defaultencoding:UTF8defaultlanguage:en_USdetectedencoding:UTF-8localhost:linux-node1.zhurui.comlsb_distrib_codename:Finallsb_distrib_id:CentOSlsb_distrib_release:6.7machine_id:da5383e82ce4b8d8a76b5a3e00000010manufacturer:VMware,Inc.master:192.168.0.15mdadm:mem_total:556nodename:linux-node1.zhurui.comnum_cpus:1num_gpus:1os:CentOSos_family:RedHatosarch:x86_64oscodename:Finalosfinger:CentOS-6osfullname:CentOSosmajorrelease:6osrelease:6.7osrelease_info:-6-7path:/sbin:/usr/sbin:/bin:/usr/binproductname:VMwareVirtualPlatformps:ps?-efHpythonexecutable:/usr/bin/python2.6pythonpath:-/usr/bin-/usr/lib64/python26.zip-/usr/lib64/python2.6-/usr/lib64/python2.6/plat-linux2-/usr/lib64/python2.6/lib-tk-/usr/lib64/python2.6/lib-old-/usr/lib64/python2.6/lib-dynload-/usr/lib64/python2.6/site-packages-/usr/lib64/python2.6/site-packages/gtk-2.0-/usr/lib/python2.6/site-packagespythonversion:-2-6-6-?final-0saltpath:/usr/lib/python2.6/site-packages/saltsaltversion:2015.5.10saltversioninfo:-2015-5-10-0selinux:----------enabled:Trueenforced:Permissiveserialnumber:VMware-564d8f43912d3a99-eb c4?3b?a9?34?fc ba?90server_id:295577080shell:/bin/bashvirtual:VMwarezmqversion:3.2.5 2.1.3系統(tǒng)版本相關(guān)信息:
2.1.4查看node1所有ip地址:
[root@linux-node1 salt]# salt 'linux-node1*' grains.get ip_interfaces:eth0?##用于信息的收集 linux-node1.zhurui.com: - 192.168.0.15 - fe80::20c:29ff:fefc:ba90 2.1.4使用Grains收集系統(tǒng)信息: [root@linux-node1 salt]# salt 'linux-node1*' grains.get os? linux-node1.zhurui.com: CentOS [root@linux-node1 salt]# salt -G os:CentOS cmd.run 'w' ?## ?-G:代表使用Grains收集,使用w命令,查看登錄信息 linux-node2.zhurui.com: 20:29:40 up 2 days, 16:09, ?2 users, ?load average: 0.00, 0.00, 0.00 USER ? ? TTY ? ? ?FROM ? ? ? ? ? ? ?LOGIN@ ? IDLE ? JCPU ? PCPU WHAT root ? ? tty1 ? ? - ? ? ? ? ? ? ? ?Sun14 ? 29:07m ?0.32s ?0.32s -bash root ? ? pts/0 ? ?192.168.0.101 ? ?Sun20 ? 21:41m ?0.46s ?0.46s -bash linux-node1.zhurui.com: 02:52:01 up 1 day, 22:31, ?3 users, ?load average: 4.00, 4.01, 4.00 USER ? ? TTY ? ? ?FROM ? ? ? ? ? ? ?LOGIN@ ? IDLE ? JCPU ? PCPU WHAT root ? ? tty1 ? ? - ? ? ? ? ? ? ? ?Sat20 ? 24:31m ?0.19s ?0.19s -bash root ? ? pts/0 ? ?192.168.0.101 ? ?Sun02 ? ?1.00s ?1.33s ?0.68s /usr/bin/python root ? ? pts/1 ? ?192.168.0.101 ? ?Sun04 ? 21:36m ?0.13s ?0.13s -bash [root@linux-node1 salt]#? 截圖如下: 2.1.5 使用Grains規(guī)則匹配到memcache的主機(jī)上運(yùn)行輸入hehe [root@linux-node1 salt]# vim /etc/salt/minion ##編輯minion配置文件,取消如下幾行注釋 88 grains: 89 ? roles: 90 ? ? - webserver 91 ? ? - memcache 截圖如下: [root@linux-node1 salt]# /etc/init.d/salt-minion restart ? ## Stopping salt-minion daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] Starting salt-minion daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] [root@linux-node1 salt]#? [root@linux-node1 salt]# salt -G 'roles:memcache' cmd.run 'echo zhurui' ?##使用grains匹配規(guī)則是memcache的客戶端機(jī)器,然后輸出命令 linux-node1.zhurui.com: zhurui [root@linux-node1 salt]# 截圖如下:
2.1.5 也可以通過(guò)創(chuàng)建新的配置文件/etc/salt/grains文件來(lái)配置規(guī)則
[root@linux-node1 salt]# cat /etc/salt/grains? web: nginx [root@linux-node1 salt]# /etc/init.d/salt-minion restart ?##修改完配置文件以后需要重啟服務(wù) Stopping salt-minion daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] Starting salt-minion daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] [root@linux-node1 salt]#? [root@linux-node1 salt]# salt -G web:nginx cmd.run 'w' ?##使用grains匹配規(guī)則為web:nginx的主機(jī)運(yùn)行命令w linux-node1.zhurui.com: 03:31:07 up 1 day, 23:11, ?3 users, ?load average: 4.11, 4.03, 4.01 USER ? ? TTY ? ? ?FROM ? ? ? ? ? ? ?LOGIN@ ? IDLE ? JCPU ? PCPU WHAT root ? ? tty1 ? ? - ? ? ? ? ? ? ? ?Sat20 ? 25:10m ?0.19s ?0.19s -bash root ? ? pts/0 ? ?192.168.0.101 ? ?Sun02 ? ?0.00s ?1.41s ?0.63s /usr/bin/python root ? ? pts/1 ? ?192.168.0.101 ? ?Sun04 ? 22:15m ?0.13s ?0.13s -bash grains的用法: 1.收集底層系統(tǒng)信息 2、遠(yuǎn)程執(zhí)行里面匹配minion 3、top.sls里面匹配minion 2.1.5 也可以/srv/salt/top.sls配置文件匹配minion [root@linux-node1 salt]# cat /srv/salt/top.sls? base: 'web:nginx': - match: grain - apache [root@linux-node1 salt]#? 2.2、SaltStack之Pillar數(shù)據(jù)系統(tǒng) 2.2.1 首先在master配置文件552行打開(kāi)pillar開(kāi)關(guān) [root@linux-node1 salt]# grep '^[a-z]' /etc/salt/master? file_roots: pillar_opts: True [root@linux-node1 salt]# /etc/init.d/salt-master restart ? ##重啟master Stopping salt-master daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] Starting salt-master daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] [root@linux-node1 salt]# salt '*' pillar.items??##使用如下命令驗(yàn)證 截圖如下: [root@linux-node1 salt]# grep '^[a-z]' /etc/salt/master 529 pillar_roots:??##打開(kāi)如下行 530 ? base: 531 ? ? - /srv/pillar 截圖如下: [root@linux-node1 salt]# mkdir /srv/pillar [root@linux-node1 salt]# /etc/init.d/salt-master restart ?##重啟master Stopping salt-master daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] Starting salt-master daemon: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?] [root@linux-node1 salt]# vim /srv/pillar/apache.sls [root@linux-node1 salt]# cat /srv/pillar/apache.sls {%if grains['os'] == 'CentOS' %} apache: httpd {% elif grains['os'] == 'Debian' %} apache: apache2 {% endif %} [root@linux-node1 salt]#? 截圖如下: 接著指定哪個(gè)minion可以看到: [root@linux-node1 salt]# cat /srv/pillar/top.sls? base: '*': - apache
[root@linux-node1 salt]# salt '*' pillar.items?##修改完成以后使用該命令驗(yàn)證 linux-node1.zhurui.com: ---------- apache: httpd linux-node2.zhurui.com: ---------- apache: httpd 截圖如下: 2.2.1 使用Pillar定位主機(jī) 報(bào)錯(cuò)處理: [root@linux-node1 salt]# salt '*' saltutil.refresh_pillar ?##需要執(zhí)行刷新命令 linux-node2.zhurui.com: True linux-node1.zhurui.com: True [root@linux-node1 salt]#? 截圖如下:
[root@linux-node1 salt]# salt -I 'apache:httpd' test.ping linux-node1.zhurui.com: True linux-node2.zhurui.com: True [root@linux-node1 salt]#? 2.3、SaltStack數(shù)據(jù)系統(tǒng)區(qū)別介紹
| 名稱 | 存儲(chǔ)位置 | 數(shù)據(jù)類型 | 數(shù)據(jù)采集更新方式 | 應(yīng)用 |
| Grains | minion端 | 靜態(tài)數(shù)據(jù) | minion啟動(dòng)時(shí)收集,也可以使用saltutil.sync_grains進(jìn)行刷新。 | 存儲(chǔ)minion基本數(shù)據(jù),比如用于匹配minion,自身數(shù)據(jù)可以用來(lái)做資產(chǎn)管理等。 |
| Pillar | master端 | 動(dòng)態(tài)數(shù)據(jù) | 在master端定義,指定給對(duì)應(yīng)的minion,可以使用saltutil.refresh_pillar刷新 | 存儲(chǔ)Master指定的數(shù)據(jù),只有指定的minion可以看到,用于敏感數(shù)據(jù)保存。 |
########## 今天的苦逼是為了不這樣一直苦逼下去!########## 分類:?【Saltstack | 自動(dòng)化運(yùn)維】
轉(zhuǎn)載于:https://www.cnblogs.com/xiexun/p/10693924.html
總結(jié)
以上是生活随笔為你收集整理的自动化运维之SaltStack实践的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。