IBM P系列小型機故障的基本定位(包括陣列和常用命令)

IBM P系列小型機故障的基本定位
一 故障的定義
.弄清楚系統發生了什麼問題
.系統現在能做什麼?不能做什麼?
.故障什麼時候發生的?
.有沒有做平時不同的操作?
.故障有沒有規律?定時還是不定時?發生的頻率有多高?
.是一臺機器出現故障還是多臺機器故障?故障現象是否相同?
.最近有沒有做改動?如安裝了新的硬件、軟件,改變了系統的一些設置。
二 故障信息的收集
1)收集故障信息對於判斷、診斷故障原因,修復系統非常重要。
2)系統故障記錄(errorlog)
errdemon 進程在系統啓動時自動運行
記錄包括硬件、軟件及其他操作信息
故障記錄文件爲/var/adm/ras/errlog,可備份下來或拷貝到別的機器上分析
errpt 命令的使用(普通用戶權限也可使用)
#errpt |more 列出簡短出錯信息

ERROR_ID TIMESTAMP T C RESOURCE_NAME ERROR_DESCRIPTION
192AC071 0723100300 T 0 errdemon Error logging turned off
0E017ED1 0720131000 P H mem2 Memory failure
9DBCFDEE 0701000000 T 0 errdemon Error logging turned on
038F2580 0624131000 U H scdisk0 UNDETERMINED ERROR
AA8AB241 0405130900 T O OPERATOR OPERATOR NOTIFICATION

TIMESTAMP: MMDDHHMMYY (月日時分年)
T(類型): P 永久; T 臨時; U 未知 (永久性的錯誤應引起重視)
C(分類): H 硬件; S 軟件; O 用戶; U未知

#errpt -d H 列出所有硬件出錯信息
#errpt -d S 列出所有軟件出錯信息
#errpt -aj ERROR_ID 列出詳細出錯信息
# errpt -aj 0502f666 <--- ERROR_ID用大小寫均可
例:
LABEL: SCSI_ERR1
ID: 0502F666

Date/Time: Jun 19 22:29:51
Sequence Number: 95
Machine ID: 123456789012
Node ID: host1
Class: H
Type: PERM
Resource Name: scsi0
Resource Class: adapter
Resource Type: hscsi
Location: 00-08
VPD: <--- Virtal Product Data
Device Driver Level.........00
Diagnostic Level............00
Displayable Message.........SCSI
EC Level....................C25928
FRU Number..................30F8834
Manufacturer................IBM97F
Part Number.................59F4566
Serial Number...............00002849
ROS Level and ID............24
Read/Write Register Ptr.....0120
Description
ADAPTER ERROR

Probable Causes
ADAPTER HARDWARE CABLE
CABLE TERMINATOR DEVICE

Failure Causes
ADAPTER
CABLE LOOSE OR DEFECTIVE

Recommended Actions
PERFORM PROBLEM DETERMINATION PROCEDURES
CHECK CABLE AND ITS CONNECTIONS

Detail Data
SENSE DATA
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
3)控制面板上的LED 代碼

.8 位代碼,通常系統故障燈會同時亮起。某些機型還會同時顯示故障設備位置代碼。
.4 位代碼,通常是Exxx。
.3 位代碼,通常爲0yyy,只看後3位。
.8 位和4位代碼可查看系統服務手冊 (Service Guide)。
3 位代碼可查看系統診斷手冊(Diagnostic Information for Multiple Bus System)。
.閃動的 888, 系統崩潰,硬件或軟件原因造成。按reset 鍵會顯示更多內容。

888-102 一般爲軟件故障(888-102-207 例外)
系統會產生一個dump。
888-102-xxx-0C9 系統正在做dump, 請等待。
888-102-xxx-0C0 系統dump完成,可關電重啓。
888-103 或 105
硬件故障,一般有 SRN 代碼及位置代碼。
4)SMS (System Management Service) 故障記錄

如何進入SMS 菜單
當主控臺出現鍵盤圖標後(LED 顯示E1F1時)按1鍵。
選擇"Utilities"
選擇"Error Log", 抄下8位故障代碼
(在SMS 中還可以更改系統啓動順序表)
5) MAIL
#mail
系統會向root用戶發mail報告出錯信息。通常系統出現故障後沒有進行檢查修復,系統會定時提醒root。
6)運行故障診斷程序(Diagnostic),對系統硬件進行檢查和診斷。

當發現有硬件故障時應立即使用diag

#diag
> 選高級診斷(Advance Diagnostic)
> 選問題診斷(Problem Determination) 或
選系統檢查(System Verification)
(選PD 會對系統錯誤記錄進行分析)
diag運行後會給出SRN 代碼,故障設備名稱及百分比,地址代碼等。
對於PCI機型應在系統報錯7天之內運行diag程序對出錯記錄裏的sense數據進行分析。
7)其他用於收集系統信息的命令
lsdev -C 系統設備信息
#lsdev -Cc disk
hdisk0 Available 00-06-00-2,0 4.5 GB 16 Bit SCSI Disk Drive
hdisk1 Available 00-06-00-1,0 4.5 GB 16 Bit SCSI Disk Drive
hdisk2 Defined 00-06-00-4,0 16 Bit SCSI Disk Drive

lspv 查看物理卷信息
#lspv
hdisk0 0007821160af3d76 rootvg
hdisk1 000782117f571294 rootvg
hdisk2 0000000045c45bde datavg

lsvg 查看卷組信息
#lsvg datavg
VOLUME GROUP: datavg VG IDENTIFIER: 0000000055e2458b
VG STATE: active PP SIZE: 4 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 2169 (8676 megabyt
MAX LVs: 256 FREE PPs: 1 (4 megabytes)
LVs: 3 USED PPs: 2168 (8672 megabyt
OPEN LVs: 2 QUORUM: 2
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per PV: 2032 MAX PVs: 16

#lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
...
lv00 jfs 51 102 1 closed/stale /ibmcxx
lv01 jfs 1 1 1 open/syncd /cics_regions
lv02 jfs 4 4 1 open/syncd /var/mqm

lslpp 查看文件組信息
# lslpp -L |grep 23100020
....
devices.pci.23100020.rte 4.3.2.7 C IBM PCI 10/100 Ethernet Adapt
看某個文件組是否已安裝,如以太網卡驅動。也用於查詢補丁程序的版本。

lsattr 查看設備參數設置
# lsattr -El ent2
busio 0x7fffc00 Bus I/O address False
busintr 9 Bus interrupt level False
intr_priority 3 Interrupt priority False
tx_que_size 512 TRANSMIT queue size True
rx_que_size 256 RECEIVE queue size True
rxbuf_pool_size 384 RECEIVE buffer pool size True
media_speed 10_Half_Duplex Media Speed True
use_alt_addr no Enable ALTERNATE ETHERNET address True
alt_addr 0x000000000000 ALTERNATE ETHERNET address True
ip_gap 96 Inter-Packet Gap True
lscfg 查看VPD信息(Virtual Product Data)
# lscfg -vl ssa1
DEVICE LOCATION DESCRIPTION

ssa1 30-68 IBM SSA Enhanced RAID Adapter
(14104500)

Part Number.................097H0645
FRU Number..................097H0645 <-- 備件號
Serial Number...............C8217227
EC Level....................0000F20825
Manufacturer................IBM053
ROS Level and ID............7201 <-- 微碼版本
Loadable Microcode Level....04
Device Driver Level.........00
Displayable Message.........SSA-ADAPTER
Device Specific.(Z0)........DRAM=032
Device Specific.(Z1)........CACHE=0
Device Specific.(Z2)........000000062955dab2
Device Specific.(YL)........P2-I7 <-- 槽號

不同的硬件設備有不同的VPD,所含的格式和信息都不一樣。通常備件號和微碼
版本最有參考價值。注:FRU(Field Replace Unit)纔是真正的備件號。
三 硬件故障定位方法
IBM 小型機故障定位方法包括小型機I/O櫃上的顯示面板上的Checkpoints信息,Error Code 和SRNs。

Checkpoints 檢查點是系統加電CMOS初始化程序(initial program load (IPL))運行後顯示在 I/O櫃的顯示面板上一系列信息。
IPL 流程
當交流電源接到系統後,IPL流程就開始了,IPL流程包括四個步驟:
. Phase 1: Service Processor 的初始化
Phase 1 開始於交流電源接到系統後,直到OK顯示在I/O櫃上的顯示面板上爲止。在這個步驟會顯示 8xxx 或9xxx checkpoints代碼 。
. Phase 2: 由 Service Processor 引導的硬件初始化
Phase 2 開始於按下I/O櫃上的白色電源開關。在這個步驟會顯示 9xxx checkpoints 。91FF 是最後的代碼標誌着第三步驟的開始
. Phase 3: 系統固件的初始化
在 Phase 3, 一個系統處理器接管控制並繼續初始化系統資源, 在這個步驟會顯示 Exxx。E105是最後的代碼標誌着第四步驟AIX啓動的開始。在這個過程中還會顯示各種位置碼( 位置碼代表着系統的每一個部分)
. Phase 4: AIX 啓動
當AIX開始啓動時,顯示面板上的代碼爲 0xxx ,同時位置碼會出現在第二行。當AIX的登錄窗口出現在控制檯上時第四步驟結束同時顯示面板上再無任何信息出現。

Error Code 當系統運行有錯誤發現時,一個8位碼會顯示在顯示面板上,同時在第二行顯示相對應問題硬件的位置碼。

SRNs (Service request numbers,服務請求碼 )當系統運行有錯誤發現時,SRNs碼會以 xxx-xxx的形式顯示在顯示面板上,同時在AIX的error log中也會有記載。

以上所有代碼都會有相應的步驟解決。由於代碼繁多,請在出現問題後記錄下代碼,並致電IBM服務熱線。
系統的啓動順序:


.系統不能啓動
系統停在Stage 1,可能爲電源、系統板、CPU、內存等硬件故障。記錄故障代碼通知IBM工程師。

系統停在Stage 2,可能是啓動順序表(bootlist)損壞或I/O子系統故障。可嘗試進入SMS 菜單檢查啓動順序表,並修改。若在選擇bootlist時沒有硬盤設備可選或顯示的硬盤信息不正確則可能是硬盤故障。若根本沒有SCSI設備可選則鏈路有問題。

系統停在Stage3,可能是硬盤數據損壞,系統設置文件出錯,或I/O子系統故障。
.系統停在551,555或557
發生在系統啓動的第三階段 (Stage 3),可能是:
文件系統損壞
文件系統日誌(jfslog)損壞
rootvg中有壞硬盤

修復方法
用系統光盤或系統備份帶啓動(必須與硬盤中的操作系統版本一致)

啓動後選擇選項3
"Start Maintenance Mode for System Recovery"
> "Access a Root Volume Group"
> "Access this volume group and start a shell
before mounting the file systems"
格式化文件系統日誌(jfslog)
# /usr/sbin/logform /dev/hd8

檢查修復文件系統
# fsck -y /dev/hd1 (/home 文件系統)
# fsck -y /dev/hd2 (/usr 文件系統)
# fsck -y /dev/hd3 (/tmp 文件系統)
# fsck -y /dev/hd4 (/ 文件系統)
# fsck -y /dev/hd9var (/var 文件系統)
... ...
用 exit 命令退出,文件系統會自動 mount 起來。

重建bootimage
# lslv -m hd5 找出bootimage所在的硬盤,如hdisk0
# bosboot -ad /dev/hdisk0
# bootlist -m normal /dev/hdisk0 重建啓動順序表。
重啓動系統
# shutdown -Fr

如上述步驟不奏效
用系統備份帶恢復系統。

如備份帶不能恢復,用診斷光盤(Diagnostic CDROM)檢查是否壞硬盤。

.CDE圖形界面掛死
CDE 運行時不要更改網絡參數(如:主機名和IP 地址)
更改網卡設置,請先退出CDE圖形環境,選擇命令行方式登錄,在字符界面下更改。
如CDE 已經掛死
遠程 telnet 登錄
找出所有dt有關的進程用kill命令殺掉
# ps -ef |grep dt
... ...
# kill PID
檢查當前主機名
# hostname
tscf50
查看主機名是否對應有效的IP地址
# netstat -i |grep tscf50
tr0* 1500 9.185.40 tscf50 506049 0 28247 0 0
更改主機名或IP地址,使主機名與當前有效的IP地址存在對應關係。
# smitty tcpip
重新啓動CDE界面
# /etc/rc.dt
HACMP環境下可把主機名alias到127.0.0.1上
# cat /etc/hosts
127.0.0.1 loopback localhost tscf50 # loopback (lo0) name/addressbvg

.系統dump
發生在系統崩潰時,AIX會做dump(系統內存的快照)。
此時機器會顯示閃動的888 102 xxx 0cx 代碼:
0c9 系統dump 進行中。0c9狀態可能會維持超過2分鐘,
不要關電和按reset, 等待dump做完。
0c0 dump 成功完成,這時可以斷電重起。
0c2 手動啓動dump 功能
0c4 dump 設備空間不足,只有部分信息保存下來

0c5 不明原因導致dump 失敗
一般dump是由於軟件出錯引起(888-102-207 除外),機器通常可以重啓。重啓時可能提示用戶插入磁帶拷貝dump文件,不要選擇退出,這樣會丟失重要的故障信息。
dump的有關設置
估算系統dump的大小,在系統最繁忙時(內存使用最多)
# sysdumpdev -e
0453-041 Estimated dump size in bytes: 53477376
# lsps -a
Page Space Physical Volume Volume Group Size %Used Active
paging00 hdisk0 rootvg 480MB 1 yes
hd6 hdisk1 rootvg 544MB 1 yes
當前的設置
#sysdumpdev -l
primary /dev/hd6 <-- dump的主設備
secondary /dev/sysdumpnull
copy directory /var/adm/ras <-- dump拷貝的目錄
forced copy flag TRUE
always allow dump TRUE
hd6應比估算值稍大。
/var/adm/ras 是默認的dump拷貝目錄,比較估算值,保證/var文件系統有足夠的剩餘空間拷貝dump文件。否則機器重起時會提示用戶插入磁帶。
dump文件名爲vmcore.#
對PCI機型如要手動做dump,須把" always allow dump" 先設成true。
# sysdumpdev -K
dump打包
# snap -a -o /dev/rmt# 或
# snap -a -c 把/tmp/ibmsupt目錄做成一個壓縮文件
snap.tar.Z如果/tmp文件系統空間不夠,
可用-d directory 參數指定別的目錄代替/tmp/ibmsupt

四 7133-D40 SSA磁盤櫃的故障定位
當 SSA磁盤櫃出現故障時,在磁盤櫃前面板的液晶顯示屏上會顯示相應的SRNs,同時黃色的顯示燈會閃動,在AIX的error log中也會有記載錯誤信息,如:DISK_ERR1,DISK_ERR4,SSA_ARRAY_ERROR等。請在出現問題後記錄下代碼,並致電IBM 服務熱線。

五 軟件故障定位方法
軟件故障情況錯綜複雜,下面列舉幾個常見案例的故障處理方法。

1) 文件系統空間不夠。
查看有沒有“滿”的文件系統。特別是/、/var、/tmp,不要超過90%。文件系統滿可導致系統不能正常工作,尤其是AIX的基本文件系統。如/ (根文件系統)滿則會導致用戶不能登錄。用df –k 查看。
# df -k (查看AIX的基本文件系統)
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 24576 1452 95% 2599 22% /
/dev/hd2 614400 28068 96% 22967 15% /usr
/dev/hd9var 8192 4540 45% 649 32% /var
/dev/hd3 167936 157968 6% 89 1% /tmp
/dev/hd1 16384 5332 68% 1402 35% /home
除/usr文件系統,其他文件系統都不應太滿,一般不超過80%。

處理方法1:刪除垃圾文件
# du -sk * |sort -rn |head
查找出當前目錄下佔空間最大的子目錄,逐層往下直到找出佔空間最大的文件。(要區分哪些目錄是文件系統的 mount point,哪些是文件系統的子目錄)刪除文件,釋放空間。有時刪除文件後空間並不馬上釋放,這是由於你刪除的文件正被某個程序打開。只有當這個程序停止後空間才釋放,有時甚至需要重起系統。
處理方法2:增加文件系統大小
# smitty chjfs
文件系統可以在任何時候加大,前提是卷組(VG)中有剩餘空間。

2) 檢查文件系統的完整性
# umount filesystem_name
# fsck -y filesystem_name

注意:文件系統必須先umount,再做檢查和修復,否則可導致未
知的後果。

3)查看卷組信息(lsvg -l vg_name):
有沒有"stale"狀態的邏輯卷。 若有,用syncvg 命令修復"stale"邏輯卷。

4)檢查內存交換區(paging space)使用率(lsps -s):
使用率是否超過70% ,若有則用chps –sX pgname增加X個PP或用 mkps –a –n –sX myvg在myvg上增加一個PP數爲X的內存交換區。

5) 小型機內存泄漏問題
小型機出現內存泄漏,即系統或應用進程無法將使用過的內存釋放,使可用內存的容量逐漸減少。如果可用內存降到某最小值將造成系統或應用程序無法FORK子進程,就會造成系統癱瘓。
通常我們可以用ps和sar命令來查看小型機內存和CPU佔用率的大概情況以及各進程的內存和CPU佔用率的發展趨勢。
(a) ps
# ps gv|head -n 1; ps gv|egrep -v "RSS" | sort +6b -7 -n -r |head -n 5
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
15674 pts/11 A 0:01 0 36108 36172 32768 5 24 0.6 24.0 ./tctestp
22742 pts/11 A 0:00 0 20748 20812 32768 5 24 0.0 14.0 ./backups
10256 pts/1 A 0:00 0 15628 15692 32768 5 24 0.0 11.0 ./tctestp
2064 - A 2:13 5 64 6448 xx 0 6392 0.0 4.0 kproc
1806 - A 0:20 0 16 6408 xx 0 6392 0.0 4.0 kproc
SIZE virtual size (in the pagingspace), in kilobytes,
RSS real-memory (resident set) size in kilobytes of the process.
通過不同時間輸出的比較,就能觀察出內存和CPU佔用率的基本情況。找出其中佔用內存數不斷變大的進程,這個進程可能就已經發生了內存泄漏。
(b) sar 指令也可以查看CPU佔用率,但統計的結果不是很準確。通常使用sar令的格式爲:
#sar -P ALL 2 10
09:29:37 cpu %usr %sys %wio %idle
09:29:39 0 0 0 4 95
1 1 0 4 95
- 0 0 4 95
09:29:41 0 0 2 6 92
1 3 4 2 91
- 2 3 4 92
09:29:43 0 3 1 2 94
1 2 2 2 95
- 2 1 2 94
09:29:45 0 2 2 7 90
1 4 5 6 86
- 3 3 6 88
09:29:47 0 1 1 2 96
1 1 2 2 96
- 1 1 2 96
09:29:49 0 0 0 0 100
1 0 1 0 99
- 0 0 0 100
09:29:51 0 2 0 0 98
1 0 1 0 98
- 1 0 0 98
09:29:53 0 7 1 6 86
1 2 2 5 90
- 5 2 5 88
09:29:55 0 4 5 56 35
1 12 2 55 32
- 8 4 55 33
09:29:57 0 16 8 14 64
1 15 9 11 65
- 15 8 12 64

Average 0 3 2 10 85
1 4 3 8 85
- 4 2 9 85

表示2秒鐘輸出一次結果總共有10次結果,然後平均。
目前,如果發現內存泄漏,最好重新啓動系統。

六 HACMP環境下的排錯
在一般情況下,HACMP軟件很少需要手工干預,但一旦有問題發生,診斷和恢復的技巧是很重要的.需要能很快地斷定問題然後運用你對HACMP的理解來恢復HACMP的正常運作.
一般地,HACMP環境下的排錯包括:
.瞭解問題的存在.
.判斷問題的出處.
.解決問題.
一 瞭解問題的存在
您可以通過以下途徑瞭解到一個CLUSTER環境下出現了問題.
.最終用戶的投訴,他們無法訪問應用程序.
.控制檯上出現一些HACMP的信息.

1.應用服務無法訪問
最終用戶的抱怨通常預示CLUSTER出現了問題.他們無法正常執行應用或是無法登錄到系統.我們必須採集到詳細的信息以判斷到底那裏出現了問題.是否有錯誤的信息提示?如果可能的話,讓用戶重複步驟以確定那裏是錯誤的開始.您也可以在自己的系統上重複.要知道用戶應用不可用並不代表HACMP有問題.問題可能出現在應用程序本身或是它的啓動或終止腳本出現了問題.因此應用程序本身的排錯也應是HA排錯的一部分.
2.控制檯上出現一些HACMP的信息
在HACMP啓動,終止或出錯時,控制檯上會出現一些HACMP的信息,同時也會寫入相應的文件中.

二 判斷問題的出處
當錯誤出現時,我們應嘗試發現錯誤的所在.但我們常常被錯誤的表面所誤導.以下的步驟可以使我們得到更詳細的信息.
1.保存好一些LOG文件.(/tmp/hacmp.out & /tmp/cm.log).因爲它們可能被覆蓋.
2.仔細檢查HACMP所產生的LOG文件.它們能提供最初的判斷線索.
3.用HACMP的工具和AIX的命令來檢查HACMP的部件是否正常.
4.打開HACMP的跟蹤工具來產生更詳細的信息.

.HACMP的LOG文件:以下文件都是文本文件,可以用VI來看.每個日誌文件都含有每個信息的產生時間.
/usr/adm/cluster.log :記錄了HACMP的狀態,由HA的守護進程所產生.
/tmp/hacmp.out :記錄了HA的詳細腳本.
/usr/sbin/cluster/history/cluster.mmdd :記錄了HA的各個事件的發生.
/tmp/cm.log :由clstrmgr進程產生,每次HA重起時會被覆蓋.

.HACMP FOR AIX的結構

應用層
HACMP軟件層
LVM & TCPIP 層
AIX 層
物理網絡層
物理硬盤層
硬件層

在物理網絡層,物理硬盤層,硬件層,LVM & TCPIP 層,AIX 層我們可以用AIX系統命令來看是否硬件和系統出現了問題.一般地,在用errpt命令來看沒有類型爲PH的錯誤,lsvg -o 來看我們所須的VG已varyon,mount來看我們所須的文件系統已安裝, netstat -i來看我們所須的service IP是UP的狀態(或用ifconfig en*),cluster node 之間的service 與service IP ,standby與 standby IP 互相可以ping通.在各個節點上執行stty<</dev/tty* 有相應的信息出現.說明硬件層,LVM & TCPIP 層,AIX 層沒有問題,問題可能出現在應用層與HACMP軟件層上.否則問題就出現在相應的層次上.
在HACMP軟件層上,我們可以用vi /tmp/hacmp.out來看,如果出現event failed的字段,則有可能問題出現在該層,如果在問題出現的時段,hacmp.out無信息出現,則問題可能出現在應用層.


以下是HA排錯的一些守則:
.在第一時間保存好相關的日誌文件,特別是那些會被覆蓋的文件.
.嘗試去重複問題的出現.不要被用戶所反映的問題迷惑.
.漸進地去重複問題,如果有多個可能導致問題的出現,一個一個地去重複,而不要一次重複多個可能.
.不要憑經驗來判斷問題,而是要在各種測試後,由結果來判斷.
.隔離問題的來源,根據我們上面所敘述的層次關係,至頂向下地診斷.
.由簡到繁地做測試,我們先從一個簡單的環境來做測試,不要嘗試在一個複雜的環境中測試.
.一次做一次改動,否則我們無法知道是那個改動解決了問題.
.不要忽略各種可能,因小可失大,留心繫統的每一個細節,包括電源,插頭,連線等.
.保持各種測試的記錄以及解決的步驟,用做將來排錯的參考.
.撥打IBM服務熱線,將問題現象和您所做的測試結果告訴IBM的工程師,他們將在CALL CENTER的測試中心重複試驗,必要時會派工程師到場解決問題.
三 IBM HACMP 雙機系統的管理和維護
本節將說明HACMP 雙機軟件的一些基本管理和維護命令這些命令將會在HACMP 雙機
系統的日常工作中經常用到.
1 HACMP 雙機系統的啓動
要啓動HACMP 雙機系統必須要有root 用戶的特權分別進入到系統各節點主機在命令
行上執行下述命令即可.
# smit clstart

# /usr/sbin/cluster/etc/rc.cluster -boot -N –I
需要注意的是在雙機系統中HACMP 雙機軟件先啓動的節點將成爲主節點擁有資源
並對外提供關鍵服務後啓動的節點將成爲備節點.
另外在啓動HACMP 前需要啓動雙機上的INFORMIX 和SCP 應用.
2 HACMP 雙機系統的關閉
要關閉某節點上的HACMP 雙機軟件必須要有該節點root 用戶的特權以root 用戶進入到
該節點主機在命令行上執行下述命令即可.
# smit clstop

# clstop -gr
需要注意的是若該節點是主節點並且備節點上的HACMP 軟件亦正常運行則需注意
clstop 關閉模式的三種選項的不同1 forced 是指立即關閉雙機軟件不調用任何客戶應用的
善後處理例程.2 graceful 是指在關閉雙機軟件時將調用客戶應用預定義的善後處理例程.3
takeover 是指該節點將關閉雙機軟件並釋放資源請求備節點進行接管.如該節點是備節點
則關閉模式選項沒有多大意義.
另外關閉HACMP 將關閉manager 和informix.
3 查詢HACMP 雙機系統的狀態
在雙機系統的運行當中操作員經常需要知道雙機系統的當前狀態纔有可能對雙機系
統出現的異常情況進行恢復處理才能保證雙機系統的高可用性和高容錯性.查詢HACMP 雙機系統的狀態只需以root 用戶進入需要查詢的節點進行下列操作
首先檢查HACMP 雙機軟件在該節點是否已啓動命令如下
# lssrc -g cluster
若是系統顯示出下面類似的信息則說明HACMP 雙機軟件已正常啓動.
Subsystem Group PID Status
clstrmgr cluster 22500 active
clsmuxpd cluster 23674 active
clinfo cluster 28674 active
在已確認雙機軟件HACMP 正常啓動的情況下在命令行執行下述命令來察看雙機系統的當前狀態
# /usr/sbin/cluster/clstat -a
如果雙機系統一切工作正常則系統將顯示下述類似信息
clstat - HACMP for AIX Cluster Status Monitor
-------------------------------------------------------------------------------------
Cluster: scp_cluster(80) Thu Jan 20 08:45:17 TAIST 2000
State: UP Nodes: 2
SubState: STABLE
Node: mscp1 State: UP
Interface: mscp1_svc (0) Address: 192.9.1.60
State: UP
Interface: mscp1_tty (1) Address: 0.0.0.0
State: UP
Node: mscp2 State: UP
Interface: mscp2_svc (0) Address: 192.9.1.61
State: UP
Interface: mscp2_tty (1) Address: 0.0.0.0
State: UP
七 常用的系統狀態查詢命令:
# lsdev –C –s scsi
列出各個SCSI設備的所有相關信息:如邏輯單元號,硬件地址及設備文件名等。
# ps -ef
列出正在運行的所有進程的各種信息:如進程號及進程名等。
# netstat -rn
列出網卡狀態及路由信息等。
# netstat -in
列出網卡狀態及網絡配置信息。
# df -k
列出已加載的邏輯卷及其大小信息。
# mount
列出已加載的邏輯卷及其加載位置。
# uname -a
列出系統ID 號,系統名稱,OS版本等信息。
# hostname
列出系統網絡名稱。
# lsvg –l rootvg,lsvg –p rootvg
顯示邏輯卷組信息,如包含哪些物理盤及邏輯卷等。
# lslv –l datalv,lslv –p datalv
顯示邏輯卷各種信息,如包含哪些盤,是否有鏡像等。
八 網絡故障定位方法
網絡不通的診斷過程:
ifconfig 查看網卡是否啓動 (up)
netstat –i 查看網卡狀態
Ierrs/Ipkts 和 Oerrs/Opkts是否>1%
ping自己網卡地址 (ip 地址)
ping其它機器地址,如不通,在其機器上用diag檢測網卡是否有問題。
在同一網中, subnetmask 應一致。
網絡配置的基本方法:
(1) 如需修改網絡地址、主機名等,一定要用 chdev 命令
# chdev –l inet0 –a hostname=myhost
# chdev -l en0 -a netaddr='9.3.240.58' -a netmask=255.255.255.0’
(2) 查看網卡狀態:# lsdev –Cc if
(3) 確認網絡地址:# ifconfig en0
(4) 啓動網卡:# ifconfig en0 up
(5) 配置路由
有兩種方式加入路由:
永久路由
# chdev -l inet0 -a route=’10.47.0.0’,’9.3.240.59’
臨時路由
# route add 10.47.1.2 9.3.240.59
用命令 netstat -rn 查看路由表
附:常用命令列表:
Any XXXX, ####, ****, or X is to be substituted by a name, resource name or #,
fn = filename
DIR = Directory
| = pipe symbol

bosboot -a -d /dev/hdiskx -rebuilds boot record/image on boot device(hdiskx)
cat -view contents of a file
cat /tmp/****.1 -view a file, look at output
cat fn fn > newfile -combines two files to a single file
cd -will return you to default DIR
cd / -will put in root DIR
cd /xxxx -change you to a DIR anywhere is system
cd .. -will drop you out of 1 DIR at a time
cd xxxxx -will change you to a DIR in current dir
cfgmgr -will auto config devices
cfgmgr -v & -(-v) shows processes (&) puts in background
chps -s xx hd# -increase paging space (xx=# of addt'l PPs)
cp oldfn newfn -copy a file
cp oldfn Dirn -copy a file to another directory
crontab -l -list crontab entries for the current user
ctrl + v -will page down 1 page
ctrl + 6 -will page up 1 page
del fn -same as rm -i,promts to remove fn
df -I -shows status of file systems (no inodes)
df -Ik -(k) show status in 1024 bites(1mb)(only AIX 4
diag -a -updates changes in hardware configuration
diag ***** -****= a device type(as tape,disk....Fastpath)
diag -cd rmtX -resets tape drive
dosformat -formats a diskette to DOS
dosdir -list files on dos formated diskette
dosread XX YY -copies dos file XX to aix file YY
doswrite YY XX -copies aix file YY to dos file XX
errpt -generates a one line synopsis of logged errors
errpt | pg -list errorlog 1 page @ a time(1st column is ID)
errpt -a -displays detailed information of logged errors
errpt -s Mmddhhmmyy -select entries posted later than date
errpt -aj XXXXXXX -list detail error by ID number.(XXX=1st column)
errpt -d S -list software errors
errpt -j XXXXXXX -list summary report by ID number.
errpt -aN XXXXXX -list detailed report by resource name column
errpt -N XXXXXXX -list summary report by resource name column
errclear 0 -clears errorlog
errclear -N XXXXX 0 -clears errorlog by resource name, 0=all enter
errclear -j XXXXX 0 -clears errorlog by ID number.
finger -same as who but with more details
flcopy -copies a diskette to another diskette
format -formats a diskette in default diskette drive
format -l -formats in lower denity: 1.44 on 2.44 / 720 on 1.44
hostname -responds with host system name
host (hostname) -responds with internet address
instfix -ik IPAR# -lists ipar fix was completely installed
lppchk -v -checks install status of LPPs
lppchk -v 2> /dev/lpX -sends output of lppchk to printer lpx
lpstat -a all -view all printer queues
lptest 80 5 > /dev/lp0 -send test pattern to lp0
ls -list names of files & directories in current dir
ls -lia -list details of files, current dir & subdir
ls -al -list details of files or dir in current dir
lsattr -El xxxxxx -list specific settings on a device
lsdev -C | sort -d -f -list system hardware (devices)
lsdev -C | grep 00-0X -list resourses for a adapter
lsdev -Cc xxxxx -H -list devices(xxx=tty,printer,disk,memory,adpt
lsdev -Cs scsi -list scsi devices(not serial or raid)
lsdev -Cc tape -list tape devices
lsdev -Cs pci -list pci devices
lsdev -Cs isa -list isa devices
lscons -lists the assigned console
lscfg -list hardware list (same as diags list)
lscfg -rl mem* |pg -lists the memory on PCI bus machines
lscfg -vl XXXXX -list config info from a device.(rmt0,hdisk,etc)
lscfg -vl sysplanar0 -lists the machine type, model, s/n on SMP
lsfs -list all filesystems + data from "df" cmd
lslpp -l | grep BROKEN -lists incomplete ptfs
lslv -m hd5 -finds boot drive under pv1 column
lsps -a -checks available paging space
lsps -s -checks available paging space
lspv -lists information about the physical volumes
lspv hdisk# -list drive info
lspv -l hdisk# -lists logical volume group disk in
lsuser -f ALL -lists all attributes for all users
lsvg -lists volume groups
lsvg -p XXXXXX -lists disks in volume group (xxxxx= volume name)
more -reads files and displays the text one screen at a time.
mpcfg -df -list all setting the machine is set to (smp)
mpcfg -cf 11 1 -changes to fast IPL on SMP machines (smp)
mv fn (path fn) -move and rename a file
oslevel -shows AIX version (3.2.4 and above)
pg -reads and displays text one screen at a time.
pdisable -makes unavailable or shows all disabled tty's
pdisable tty# -disables a tty
penable -makes available or shows all enabled tty's
penable tty# -enables a tty
ps -el |pg -look at process running on system
pwd -list what DIR you are currently in
r -repeats last command
rm -i ******* -remove a file & will prompt you if you are sure
rmdev -l XXXXX -removes a device and defines it to data base
rmdev -l XXXXX -d -removes a device and deletes it from data base
set -o vi -sets up to veiw cammands that have been run
:wq -write(save) and quit file
Esc + k -used with SET command to list last command
k,l -k=list next command ran, l=steps you thru command
I -use with SET command inserts characters
j -steps you backwards
cw -cw=removes a word,just type in new word
(use with Esc)
a,x,r -a=added text, x=delete text, r=replace text(r+letter)
R -lets you type over letters or words
smit ***** -(*****= tape,disk,tty,etc.fastpath)
su -stands for switch user,(NOT super user)
su -switches to root id or prompts you for password
su XXXXXX -switches to XXXXXX's id
tar -cvf /dev/rmtX /etc -will copy /etc to a tape drive
tar -tvf /dev/rmtX -will read a tape drive
tctl -f /dev/rmtX rewoffl -rewind & eject tape
tctl -f /dev/rmtX.1 fsf 3 -forward advances a tape to be read by TAR
tctl -F -list avail commands(-F flag is not correct)
tctl retension -retensions tape in tape drive
& -put any command in background with process ID
uptime -how long since last IPL and how many users on system
vmstat # # -reports virtual memory statistics and more
iostat # # -reports CPU,disk & cdrom statistics
use with vm & iostat -1st #(how many sec to repeat), 2nd #(how many times)
who -shows users on system
who am i -shows user id on your terminal & tty number
USE the following with other commands.
---------------------------------------------------
>/tmp/****.1 -creates a file (used with lsXXX command)
>/dev/lp# -redirectes output to a printer(use with a comd)
|grep -is useful to search for text in a file.
|pg -use after any command to view one page at a time
| -pipe sign - Takes the output of one command and
feeds it to the input of another.
> -redirect sign or greater than sign
/ -slash sign
-back slash sign
>> -double redirect will add text to end of file
& -put any command in background with process ID
MUST unmount file system 1st to run fsck & dfsck/only use with a problem
----------------------------------------------------------------------------------------------
fsck XXXXXXX -will check a file system for errors & prompt
dfsck /XXXX /XXXX -will check 2 different file sys at the same time
FOLLOWING command lines will delete a group of devices as a group, the #,
sign is the hdisk#'s that you want to delete.(this is an exampe.)
--------------------------------------------------------------------------------------------------
for disk in # # # # -this line and the next 3 line work together
do -the prompt will be > (REMEMBER to hit enter)
rmdev -l hdisk# {disk} -d -the prompt will be > (brackets around disk change)
done -the prompt will be > (on a printout. change to -)
SSA RELATED COMMANDS
-----------------------------------------
lsattr -El ssaX -list attributes of SSA adapters
lscfg -vl ssaX -list VPD of SSA adapters
lsdev -C | grep SSA -list all SSA devices
lslpp -L | grep SSA -list SSA device drivers
maymap -ap -maymap display of SSA loop
maymap -alph -maymap display of SSA loop
lscfg -vl pdisk* -list VPD of pdisks
ssaxlate -l hdiskX -list hdisk to pdisk assignment
ssaxlate -l pdiskX -list pdisk to hdisk assignment
ssa_rescheck -l hdiskX -show hdisk reservation status
FOLLOWING CMDS LIST, COPY, AND RESTORE FOR cpio,tar,dd,backup,dos:
NOTE: The fd0 is just a dev. so you may use any media you desire.
-----------------------------------------------------------------------------------
LIST COPY
------ --------
cpio -itv < /dev/fd0 ls /tmp/fn | cpio -ov > /dev/fd0
tar -tvf /dev/fd0 tar -cvf /dev/fd0 fn
dd li -l | dd dd if=fn of=/dev/fd0
restore -Tf /dev/fd0 backup -0 -uf /dev/fd0 fn By INODE
restore -Tf /dev/fd0 find / -print | backup -i -f/dev/fd0 By NAME
dosdir doswrite -a (AIX fn) (fn.ext)
TO RESTORE
-------------------
cpio -iv fn < /dev/fd0
tar -xvf /dev/fd0
dd of=/dev/fd0 if=fn
restore -xvf /dev/fd0 fn BY NAME/INODE, restore understands unless special
flags were used.
dosread -a (fn.ext) (AIX fn)
TO DOCUMENT THE SYSTEM
-------------------------------------------
lscfg -v > /dev/lpx -to list sys config/VPD
lsuser -f ALL > /dev/lpX -to list users
lsdev -Cc tty -H -to list all tty's
lsdev -Cc lp -H -to list all lp's
lsattr -El ttyX > /dev/lpX -to list ttyX parameters (do for each tty)
lsattr -El lpX > /dev/lpX -to list lpX parameters (do for each lp)
lpstat > /dev/lpX -to list queues
lsfs > /dev/lpx -to list filesystems
lspv > /dev/lpx -to list hard drives
lspv hdiskx -to list hard drive config (do for each drive)
lspv -l hdiskx -to list files on drive
lsvg rootvg -to list rootvg data
plus printout of or save to diskette:
------------------------------------------
/etc/inittab
/etc/objrepos/Cu*
/etc/passwd
/etc/filesystems
/etc/security/passwd
/etc/hosts
/sbin/rc.boot

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章