设为首页 收藏本站
查看: 1642|回复: 0

[经验分享] SaltStack实战之配置管理-LAMP自动化部署

[复制链接]

尚未签到

发表于 2018-8-1 12:23:06 | 显示全部楼层 |阅读模式
[root@salt-master112 salt]# salt-key -L  Accepted Keys:
  master.test.com
  node1.test.com
  node2.test.com
  Denied Keys:
  Unaccepted Keys:
  Rejected Keys:
  [root@salt-master112 salt]# salt '*' state.highstate
  master.test.com:
  ----------
  ID: /etc/resolv.conf
  Function: file.managed
  Result: True
  Comment: File /etc/resolv.conf is in the correct state
  Started: 23:20:50.495770
  Duration: 23.706 ms
  Changes:
  Summary for master.test.com
  ------------
  Succeeded: 1
  Failed:    0
  ------------
  Total states run:     1
  Total run time:  23.706 ms
  node1.test.com:
  ----------
  ID: /etc/resolv.conf
  Function: file.managed
  Result: True
  Comment: File /etc/resolv.conf is in the correct state
  Started: 15:23:33.990342
  Duration: 32.918 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: httpd
  Result: True
  Comment: Package httpd is already installed
  Started: 15:23:34.603609
  Duration: 649.913 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php-pdo
  Result: True
  Comment: Package php-pdo is already installed
  Started: 15:23:35.253716
  Duration: 0.539 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php-fpm
  Result: True
  Comment: Package php-fpm is already installed
  Started: 15:23:35.254347
  Duration: 0.359 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: mysql-server
  Result: True
  Comment: Package mysql-server is already installed
  Started: 15:23:35.254807
  Duration: 0.346 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php-mysql
  Result: True
  Comment: Package php-mysql is already installed
  Started: 15:23:35.255233
  Duration: 0.367 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: mysql
  Result: True
  Comment: Package mysql is already installed
  Started: 15:23:35.255688
  Duration: 0.355 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php
  Result: True
  Comment: Package php is already installed
  Started: 15:23:35.256129
  Duration: 0.348 ms
  Changes:
  ----------
  ID: apache-service
  Function: file.managed
  Name: /etc/httpd/conf/httpd.conf
  Result: False
  Comment: Unable to manage file: none of the specified sources were found
  Started: 15:23:35.256569
  Duration: 6.275 ms
  Changes:
  ----------
  ID: apache-service
  Function: service.running
  Name: httpd
  Result: False
  Comment: Service httpd has been enabled, and is dead
  Started: 15:23:35.275736
  Duration: 230.013 ms
  Changes:
  ----------
  httpd:
  True
  ----------
  ID: mysql-service
  Function: file.managed
  Name: /etc/my.cnf
  Result: False
  Comment: Unable to manage file: none of the specified sources were found
  Started: 15:23:35.505956
  Duration: 6.35 ms
  Changes:
  ----------
  ID: mysql-service
  Function: service.running
  Name: httpd
  Result: False
  Comment: Service httpd is already enabled, and is dead
  Started: 15:23:35.512412
  Duration: 134.002 ms
  Changes:
  ----------
  ID: php-fpm-service
  Function: service.running
  Name: php-fpm
  Result: True
  Comment: Service php-fpm is already enabled, and is running
  Started: 15:23:35.646635
  Duration: 196.639 ms
  Changes:
  ----------
  php-fpm:
  True
  Summary for node1.test.com
  ------------
  Succeeded: 9 (changed=2)
  Failed:    4
  ------------
  Total states run:    13
  Total run time:   1.258 s
  node2.test.com:
  ----------
  ID: /etc/resolv.conf
  Function: file.managed
  Result: True
  Comment: File /etc/resolv.conf is in the correct state
  Started: 15:23:34.682679
  Duration: 103.617 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: httpd
  Result: True
  Comment: The following packages were installed/updated: httpd
  Started: 15:23:38.021487
  Duration: 46521.648 ms
  Changes:
  ----------
  apr:
  ----------
  new:
  1.3.9-5.el6_2
  old:
  apr-util:
  ----------
  new:
  1.3.9-3.el6_0.1
  old:
  apr-util-ldap:
  ----------
  new:
  1.3.9-3.el6_0.1
  old:
  httpd:
  ----------
  new:
  2.2.15-59.el6.centos
  old:
  httpd-tools:
  ----------
  new:
  2.2.15-59.el6.centos
  old:
  mailcap:
  ----------
  new:
  2.1.31-2.el6
  old:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php-pdo
  Result: True
  Comment: The following packages were installed/updated: php-pdo
  Started: 15:24:24.562565
  Duration: 8749.133 ms
  Changes:
  ----------
  php-common:
  ----------
  new:
  5.3.3-49.el6
  old:
  php-pdo:
  ----------
  new:
  5.3.3-49.el6
  old:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php-fpm
  Result: True
  Comment: The following packages were installed/updated: php-fpm
  Started: 15:24:33.336866
  Duration: 8477.529 ms
  Changes:
  ----------
  php-fpm:
  ----------
  new:
  5.3.3-49.el6
  old:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: mysql-server
  Result: True
  Comment: The following packages were installed/updated: mysql-server
  Started: 15:24:41.843441
  Duration: 28414.553 ms
  Changes:
  ----------
  mysql:
  ----------
  new:
  5.1.73-8.el6_8
  old:
  mysql-libs:
  ----------
  new:
  5.1.73-8.el6_8
  old:
  mysql-server:
  ----------
  new:
  5.1.73-8.el6_8
  old:
  perl-DBD-MySQL:
  ----------
  new:
  4.013-3.el6
  old:
  perl-DBI:
  ----------
  new:
  1.609-4.el6
  old:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php-mysql
  Result: True
  Comment: The following packages were installed/updated: php-mysql
  Started: 15:25:10.289755
  Duration: 8122.46 ms
  Changes:
  ----------
  php-mysql:
  ----------
  new:
  5.3.3-49.el6
  old:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: mysql
  Result: True
  Comment: Package mysql is already installed
  Started: 15:25:18.458202
  Duration: 1.519 ms
  Changes:
  ----------
  ID: lamp-pkg-install
  Function: pkg.installed
  Name: php
  Result: True
  Comment: The following packages were installed/updated: php
  Started: 15:25:18.459996
  Duration: 14374.708 ms
  Changes:
  ----------
  php:
  ----------
  new:
  5.3.3-49.el6
  old:
  php-cli:
  ----------
  new:
  5.3.3-49.el6
  old:
  ----------
  ID: apache-service
  Function: file.managed
  Name: /etc/httpd/conf/httpd.conf
  Result: False
  Comment: Unable to manage file: none of the specified sources were found
  Started: 15:25:32.846614
  Duration: 38.9 ms
  Changes:
  ----------
  ID: apache-service
  Function: service.running
  Name: httpd
  Result: False
  Comment: Service httpd has been enabled, and is dead
  Started: 15:25:32.916084
  Duration: 674.943 ms
  Changes:
  ----------
  httpd:
  True
  ----------
  ID: mysql-service
  Function: file.managed
  Name: /etc/my.cnf
  Result: False
  Comment: Unable to manage file: none of the specified sources were found
  Started: 15:25:33.591498
  Duration: 23.162 ms
  Changes:
  ----------
  ID: mysql-service
  Function: service.running
  Name: httpd
  Result: False
  Comment: Service httpd is already enabled, and is dead
  Started: 15:25:33.614954
  Duration: 357.977 ms
  Changes:
  ----------
  ID: php-fpm-service
  Function: service.running
  Name: php-fpm
  Result: True
  Comment: Service php-fpm is already enabled, and is running
  Started: 15:25:33.973402
  Duration: 512.95 ms
  Changes:
  ----------
  php-fpm:
  True
  Summary for node2.test.com
  ------------
  Succeeded: 9 (changed=8)
  Failed:    4
  ------------
  Total states run:    13
  Total run time: 116.373 s
  ERROR: Minions returned with non-zero exit code
  [root@salt-master112 salt]#

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-544780-1-1.html 上篇帖子: 自动化运维之saltstack(三)常用模块使用之file 下篇帖子: 网址 saltstack-12452511
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表