/var/cluster/logs/commandlog ASCII 文字檔案包含執行於叢集中所選取的 Sun Cluster 指令的記錄。當您設定叢集時,會自動開始記錄指令,而當您關閉叢集時,則會結束記錄。指令會記錄至所有在叢集模式中開啟與啟動的節點。
未記錄到此檔案的的指令包括顯示叢集配置與目前狀態的指令。
記錄在此檔案中的指令包括配置與變更叢集目前狀態的指令:
claccess
cldevice
cldevicegroup
clinterconnect
clnasdevice
clnode
clquorum
clreslogicalhostname
clresource
clresourcegroup
clresourcetype
clressharedaddress
clsetup
clsnmphost
clsnmpmib
clnsmpuser
cltelemetryattribute
cluster
scconf
scdidadm
scdpm
scgdevs
scrgadm
scsetup
scshutdown
scswitch
commandlog 檔案中的記錄可包含下列元素:
日期和時間戳記
執行指令的主機名稱
指令的程序 ID
執行指令的使用者登入名稱
使用者執行的指令,包含所有選項和運算元
在 commandlog 檔案中會使用引號標示指令選項,可讓您很快地在 shell 中辨識、複製、貼上與執行它們。
已執行指令的結束狀況
如果指令因不明原因異常中斷,Sun Cluster 不會在 commandlog 檔案中顯示結束狀況。
根據預設,commandlog 檔案會定期歸檔,且一週一次。若要變更 commandlog 檔案的歸檔策略,請在叢集中的每個節點上使用 crontab 指令。請參閱 crontab(1) 線上手冊以取得更多資訊。
Sun Cluster 可於任何時間在各個叢集節點上最多維護 8 個先前已歸檔的 commandlog 檔案。目前這週的 commandlog 檔案命名為 commandlog。最新完成的週檔案命名為 commandlog.0 。最舊完成的週檔案被命名為 commandlog.7。
檢視目前這週的 commandlog 檔案內容,一次一個畫面。
# more /var/cluster/logs/commandlog |
下列範例顯示 more 指令所顯示的 commandlog 內容。
more -lines10 /var/cluster/logs/commandlog 11/11/2006 09:42:51 phys-schost-1 5222 root START - clsetup 11/11/2006 09:43:36 phys-schost-1 5758 root START - clrg add "app-sa-1" 11/11/2006 09:43:36 phys-schost-1 5758 root END 0 11/11/2006 09:43:36 phys-schost-1 5760 root START - clrg set -y "RG_description=Department Shared Address RG" "app-sa-1" 11/11/2006 09:43:37 phys-schost-1 5760 root END 0 11/11/2006 09:44:15 phys-schost-1 5810 root START - clrg online "app-sa-1" 11/11/2006 09:44:15 phys-schost-1 5810 root END 0 11/11/2006 09:44:19 phys-schost-1 5222 root END -20988320 12/02/2006 14:37:21 phys-schost-1 5542 jbloggs START - clrg -c -g "app-sa-1" -y "RG_description=Joe Bloggs Shared Address RG" 12/02/2006 14:37:22 phys-schost-1 5542 jbloggs END 0 |