隨筆-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 我愛佳娃 閱讀(565) 評論(0)  編輯  收藏 所屬分類: 網管工具使用
          主站蜘蛛池模板: 新安县| 阳山县| 盘山县| 同江市| 永善县| 介休市| 贵南县| 和平县| 安达市| 饶平县| 潮州市| 六安市| 泉州市| 申扎县| 蓬安县| 临高县| 定安县| 长沙市| 县级市| 永德县| 新龙县| 宁乡县| 郁南县| 二连浩特市| 大悟县| 南乐县| 万源市| 托克托县| 天津市| 扶绥县| 新昌县| 西充县| 南开区| 宁化县| 中超| 浏阳市| 梧州市| 中宁县| 上虞市| 金门县| 沂水县|