zoukankan      html  css  js  c++  java
  • Ansible优化

    1.开启SSH长连接

        openssh版本高于5.6(multiplexing)

    sh_args = -o ControlMaster=auto -o ControlPersist=5d
    

      ControlPersist=5d 设置整改长连接保持5天,

    2.开启pipelinling

        目标机器需要编辑/etc/sudoers文件

    编辑当前ansible用户的配置为requiretty
    pipelinling = True

    3.开启accelerate模式

        使用python在被控机器上运行一个守护进程,然后Ansible通过整改守护进程监听的端口进行通信

        注意:中控机和被控机需要安装pyhton-keyczar

    [accelerate]
    accelerate_port = 5099
    accelerate_timeout = 30
    accelerate_connect_timeout = 5.0
    

    4.设置facts缓存

        Ansible收集每台主机的facts信息

        关闭facts,可以直接设置为False,提高playbook效率

        但是如果我们每次执行playbook时能收集facts,又想加速playbook效率,那么就需要配置facts缓存了

    •    文件缓存
      gathering = smart
      fact_caching_timeout = 86400
      fact_caching = jsonfile
      fact_caching_connection = /dev/shm/ansible_fact_cache
    •  redis
      gathering = smart
      fact_caching_timeout = 86400
      fact_caching = redis
    • memcached
      gathering = smart
      fact_caching_timeout = 86400
      fact_caching = memcached
      

        

  • 相关阅读:
    ios开源项目2
    Cocoa 框架 For iOS(一) 框架的介绍
    iPhone开源项目大全
    8款iOS的日历开源代码
    二维码扫描工具和开发包 ZBar
    图文解释XCode常用快捷键的使用
    常用的iOS高效开源类库
    static_cast
    [转]SecureCRT rz 上传文件失败问题
    Linux中的EAGAIN含义
  • 原文地址:https://www.cnblogs.com/jachin/p/9853721.html
Copyright © 2011-2022 走看看