隨筆-124  評論-194  文章-0  trackbacks-0

          主要功能

          在多至上萬臺主機的系統中,集中定義配置,然后自動應用到所有主機。

          自動進行哪些配置呢?主要有:

          ²       網口配置

          ²       修改各種配置文件

          ²       建立并保持符號鏈接

          ²       掛接(mount)NFS文件系統

          ²       檢查和保持文件的權限信息

          ²       檢查重要文件

          ²       幫助運行用戶腳本

          ²       進程管理


          組件結構

          cfagent從cfservd下載規則及需要的文件,然后通過規則配置本地系統,達到整個網絡的集中配置。

          其規則定義有專門的結構。

          Cfagent一般可以配作定時任務定期“被動”運行。Cfservd除用作“文件服務”外,還有個特殊功能,可以“主動”運行本機的cfagent,這是通過遠端的cfrun來激發的。

          規則語言:

          即一個節一個節的定義動作類型,動作類型是預定義好的,用戶不能添加。

          節中可以用“類”來對特定的一組主機進行的操作,類以兩個冒號結尾。

          action-type:

          class1::

          list of things to do...

          class2::

          list of things to do...

          action-type

          groups, control, copy, homeservers, binservers, mailserver, mountables,

          import, broadcast, resolve, defaultroute, directories, miscmounts,

          files, ignore, tidy, required, links, disable, shellcommands, strategies

          editfiles, processes

          Control節中的actionsequence就表示全部動作的執行順序,之后的節就定義需要執行的動作。

          如下面即表示,在SUN4的操作系統上創建/bin->/usr/bin的符號鏈接

          # Comment...

          control:

          actionsequence = ( links )

          links:

          sun4::

          /bin -> /usr/bin

          # other links

          osf::

          # other links


          舉例

          從policyhost拷貝文件到本地:

          copy:

          $(master_cfinput) dest=$(workdir)/inputs

          r=inf

          mode=700

          type=binary

          exclude=*.lst

          exclude=*~

          exclude=#*

          server=$(policyhost)

          刪除多余的過期文件:

          tidy:

          #

          # Cfexecd stores output in this directory.

          # Make sure we don't build up files and choke on our own words!

          #

          $(workdir)/outputs pattern=* age=7

          向文件.cshrc添加行:

          { home/.cshrc

          AppendIfNoSuchLine "# Sys admin/cfengine: put next line here"

          AppendIfNoSuchLine "setenv PRINTER newprinter"

          }


          鏈接:

          Intro to cfengine for system administration

          Tutorial/Reference

          posted on 2008-07-28 11:12 我愛佳娃 閱讀(569) 評論(0)  編輯  收藏 所屬分類: 網管工具使用
          主站蜘蛛池模板: 德惠市| 神木县| 成都市| 井研县| 时尚| 德阳市| 松阳县| 同仁县| 彰武县| 广南县| 乌拉特后旗| 揭东县| 乌苏市| 岱山县| 枣庄市| 绵竹市| 高密市| 郑州市| 万盛区| 怀集县| 通山县| 宁明县| 莱州市| 青浦区| 迁西县| 军事| 中山市| 杭锦旗| 洛隆县| 汉川市| 乌拉特中旗| 民乐县| 赣州市| 禄丰县| 宣武区| 高雄市| 通榆县| 湖北省| 瑞金市| 广安市| 澄城县|