隨筆-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 我愛佳娃 閱讀(564) 評論(0)  編輯  收藏 所屬分類: 網管工具使用
          主站蜘蛛池模板: 延寿县| 芦山县| 罗平县| 秦皇岛市| 凉山| 荆州市| 四川省| 浦东新区| 习水县| 新竹县| 台山市| 和平区| 永清县| 东乡县| 江源县| 漠河县| 兴隆县| 嘉峪关市| 山阳县| 罗定市| 新余市| 河北区| 浠水县| 中阳县| 新丰县| 虹口区| 松潘县| 娱乐| 洛川县| 永吉县| 曲麻莱县| 苍溪县| 永丰县| 灵山县| 贵定县| 尖扎县| 武功县| 昌吉市| 安龙县| 谷城县| 隆回县|