9/12/2011

製作 AIX rootvg 的 mirror

 

以下適用於 AIX 4.3.3, AIX 5.1, AIX 5.2 及 AIX 5.3。

  1. 確認有空的硬碟可以做 mirror (假設是 hdisk1)
    1. cfgmgr
    2. lsdev -Cc disk
  2. 加入 hdisk1 至 rootvg 使用 "extendvg rootvg hdisk1"
  3. 輸入 "mirrorvg rootvg" 來執行 mirror
  4. 把VG Quorum關閉chvg -Qn rootvg
  5. 修改開機清單如下 (其實 AIX 也會提示你做)
    1. 先看現在的開機順序 bootlist –o –m normal
    2. 修改順序 bootlist –m normal hdisk0 hdisk1
  6. 執行 bosboot 對 hdisk0, hdisk1 建立開機檔案
    1. bosboot -a
  7. 重新開機。 (聽說5300-07後不必重新開機)

參考資料:

Howto mirror an AIX rootvg


tar 指令備份小技巧

 

tar 可以透過 pipe line 做一些特別的備份方式。

像是使用

[root@/tmp]# tar -cvf - /etc | tar -xvf -
這邊以|(pipe line)為分隔說明兩部份,
前半部的參數是
c 建立被 tar 的資料。
v verbose 的意思,就是會顯示 tar 了什麼。
f 這個參數後要接 tar 完後的檔名,比方說 tar –cvf backup.tar 要tar的來源
- 這符號是表示標準輸入或標準輸出,要看使用的位置,這邊的例子是標準輸出。
因此前半部就是叫 tar 指令將 /etc 內的所有資料,tar 到 – (標準輸出)內。
後半部的參數是
x 解開被 tar 的資料。
v verbose 的意思,就是會顯示 tar 了什麼。
f 這個參數後要接 tar 完後的檔名,比方說 tar –xvf backup.tar 解tar的目地
- 這符號是表示標準輸入或標準輸出,要看使用的位置,這邊的例子是標準輸入。
所以後半部就是讓 tar 指令將 – (標準輸入,將前半部的標準輸入拿來用),
內的資料解 tar 到目前所在的目錄(因為我們沒在最後”解tar的目的”中輸入參數)。
 
或者是
# (cd source-Folder ;tar -cf - .)|(cd target-Folder ; tar -xBpf –)


 

7/27/2011

Storage 雜記

 

近期的SSD硬碟,在Storage system遇到效能上瓶頸時,常常可能會被提出來改善 Storage 效能上瓶頸,

但我們在認為 Storage 遇到瓶頸的時候,

可能需要了解一下一些名詞

Read Hit / Write Hit

Read Miss / Read Miss

一般來說,我們的主機若有連接至Storage system,則其資料的讀 / 寫有些部份是會依靠 Storage System 的 Cache 來完成。

當主機的資料寫到 Storage 的 Cache 後,主機就會覺的 OK,這個資料寫入了。
(接下來Storage會自已把資料從Cache寫入後端的磁碟。)

而當主機要讀 / 寫的資料直接就在 Storage System Cache中時,則就是稱為 Read Hit, Write Hit。

若主機要讀 / 寫的資料不在 Storage System Cache 中時,則稱為 Read miss, Write miss。

假設我們的 Storage System Cache 非常大,則資料永遠在 Read hit, Write hit 的狀態..
Storage System 的效能會非常好...

這也就是說若Storage System Cache非常大,則資料是不會需要到後端的硬碟做讀 / 寫,因為在 Cache 的地方就完成了。

但現實來說,Storage System Cache 通常不會非常大,因此到達某一程度的時候,主機的讀 / 寫資料就會常常發生 read miss, write miss ,而 SSD 硬碟的存在,正好可以解決這個問題。

就資料的讀寫性能來說。Storage System Cache >  SSD > FC > SAS > SATA

因此,若我們在考慮加裝 SSD 硬碟前,可能需要考慮 Storage System Cache 是否足夠...

因為若是我們的資料90%都是在 Storage System Cache 中讀寫完成,

則其實 SSD 發揮的作用只是剩下的 10%而已…


7/11/2011

Accessing the IBM ASMI using a Web browser

 

摘錄自 System Hardware information Center

POWER7 Accessing the ASMI using a web browser

POWER6 Accessing the ASMI using a web browser

POWER6及POWER7的共同注意事項:

If you plan to connect your server to your network, this PC or notebook temporarily connects directly to the server for setup purposes only. After setup, you can use any PC or notebook on your network that is running Netscape 9.0.0.4, Microsoft Internet Explorer 7.0, Opera 9.24, or Mozilla Firefox 2.0.0.11 as your ASMI console.

Note: Complete the following steps to disable the TLS 1.0 option in Microsoft Internet Explorer to access the ASMI using Microsoft Internet Explorer 7.0 running on Windows® XP:

  1. From the Tools menu in Microsoft Internet Explorer, select Internet Options.
  2. From the Internet Options window, click the Advanced tab.
  3. Clear the Use TLS 1.0 check box (in the Security category) and click OK.

POWER6及POWER7適用的ASMI Default IP

image

 

以下為POWER5專用

POWER5 Accessing the ASMI using a web browser

P5-ASMI-IP


7/10/2011

vi 及 sed 置換字串的小技巧

 

工作中常常會需要將設定檔或script內的很多字替換掉,

當然這本身是一個很簡單的事情。

比方檔案內容如下:

[xxooxp@blogsopt ~]# cat xyz.txt
/uuu/abc
/uuu/abc
/uuu/abc
/uuu/abc

而我們想將 uuu 置換為 xyz 可透過簡單的幾個方法達成。

使用 vi 置換,
[xxooxp@blogsopt ~]# vi xyz.txt
/uuu/abc
/uuu/abc
/uuu/abc
/uuu/abc                                                      
~                                                                       
~                                                                       
:1,$s:/uuu/:/xyz/:g

使用 sed 置換

[xxooxp@blogsopt ~]# sed –i ‘s:/uuu/:/xyz/:g’ xyz.txt



7/08/2011

檢查 Windows 記憶體大小 (DIMM size)及實體CPU數量(CPU socket counts)

 

這個方法應可適用於Windows 2003以上之版本。

先啟動命令提示字元,接著輸入以下指令。

C:\>wmic
wmic:root\cli>/NAMESPACE:CIMV2
wmic:root\cli>CPU LIST BRIEF
Caption                                DeviceID  Manufacturer  MaxClockSpeed  Name                                             SocketDesignation
Intel64 Family 6 Model 23 Stepping 10  CPU0      GenuineIntel  2534           Intel(R) Core(TM)2 Duo CPU     P8700  @ 2.53GHz  None

wmic:root\cli>MEMORYCHIP LIST BRIEF
Capacity    DeviceLocator  MemoryType  Name             Tag                TotalWidth
4294967296  DIMM 1         0           Physical Memory  Physical Memory 0  64
4294967296  DIMM 2         0           Physical Memory  Physical Memory 1  64

wmic:root\cli>

 

5/06/2011

使用 IBM Dynamic System Analysis (DSA) 蒐集 ESXi 主機硬體 Log

 

IBM 官方的 Log 蒐集工具,IBM Dynamic System Analysis (DSA) 可使用在 Linux, Windows, VMware ESX等平台。

而要蒐集 VMware ESXi 也是可以的,只要透過以下參數 (下列使用 Windows 版 DSA 示範):

以下是在命令提示字元:

C:\>ibm_utl_dsa_dsyt85t-3.40_portable_windows_x86-64.exe –h
注意下面這個參數的說明
--vmware-esxi <userid:password@IP [:port]>
         Retrieve system information from the remote target system loaded
         with VMWare Embedded Hypervisor.

C:\>ibm_utl_dsa_dsyt85t-3.40_portable_windows_x86-64.exe --vmware-esxi root:password@192.168.1.1
上例假設 ESXi 主機的帳號為 root 密碼為 password , @後為 ESXi 主機 IP。DSA 會使用 TCP 5989 與 ESXi 主機溝通。並將 Log 蒐集至本機的 C:\IBM_Support 目錄。


1/07/2011

RHEL Login shells v.s. non-login shells

 

Login Shells

  1. Login Shells 使用的 Startup scripts 如下順序: (紅色只有 Login shells 才有)
    1. /etc/profile (global configuration)
    2. /etc/profile.d/*.sh
    3. $HOME/.bash_profile (user configuration)
    4. $HOME/.bashrc
    5. /etc/bashrc
  2. 有哪些是 Login Shells ?,任何在登入時建立的 shells,舉例有
    • Virtual Console (Ctrl + Alt F1 ~ F6)
    • X Login
    • Remote Login (SSH, Telnet …etc.)
    • su -
    • 用 su - 切換時使用者也是 login shells。

 

Non-Login Shells

  1. Non-Login Shells 使用的 Startup scripts 如下順序:
    1. $HOME/.bashrc
    2. /etc/bashrc
    3. /etc/profile.d/*.sh
  2. 有哪些是 Non-Login Shells ?,沒有登入的 shells (打帳號 / 密碼),舉例有
    • su
    • graphical terminals.
    • any other bash instances.
    • executed scripts.

 

應用方式

依 Login shells 與 Non-Login shells 使用不同 Startup script 的特色,來做一些環境變數(Environment variables)的調整。