顯示具有 Troubleshooting 標籤的文章。 顯示所有文章
顯示具有 Troubleshooting 標籤的文章。 顯示所有文章

5/27/2012

設定 SuSE Linux Enterprise Server bonding 介面

 

xxooxp:/etc/sysconfig/network # mkdir ~/worktmp
xxooxp:/etc/sysconfig/network #
xxooxp:/etc/sysconfig/network # mv ifcfg-eth0 ifcfg-eth1 ~/worktmp/.
xxooxp:/etc/sysconfig/network #

xxooxp:/etc/sysconfig/network # ls /proc/net/bonding/
xxooxp:/etc/sysconfig/network # cat <<EOF > /etc/sysconfig/network/ifcfg-bond0
> BONDING_MASTER='yes'
> BONDING_MODULE_OPTS='mode=active-backup miimon=100'
> BOOTPROTO='static'
> BROADCAST=''
> ETHTOOL_OPTIONS=''
> IPADDR='192.168.75.11/24'
> MTU=''
> NAME=''
> NETWORK=''
> REMOTE_IPADDR=''
> STARTMODE='auto'
> USERCONTROL='no'
> BONDING_SLAVE0='eth0'
> BONDING_SLAVE1='eth1'
> EOF
xxooxp:/etc/sysconfig/network # service network restart
xxooxp:/etc/sysconfig/network #
xxooxp:/etc/sysconfig/network # ip addr show bond0
xxooxp:/etc/sysconfig/network #
xxooxp:/etc/sysconfig/network # ls /proc/net/bonding
xxooxp:/etc/sysconfig/network # cat /proc/net/bonding/bond0



 

5/26/2012

SLES Disable IPv6

 

直接編輯 /etc/modprobe.d/50-ipv6.conf 這個檔案就可以.

停用 IPv6

[root@rh6 ~]# cat /etc/modprobe.d/50-ipv6.conf
install ipv6 /bin/true

 

啟用IPv6

[root@rh6 ~]# cat /etc/modprobe.d/50-ipv6.conf
#install ipv6 /bin/true


RHEL 5, 6 Disable IPv6

 

  1. 檢查IPv6目前是否有載入了.

    [root@rh6 ~]# lsmod | egrep 'ipv6'
    [root@rh6 ~]# ip addr show | egrep 'inet6'


  2. 編輯 conf 檔..有3個方法達成同樣的效果. (no-ipv6.conf 檔要自己建立)

    方法1:
    [root@rh6 ~]# cat /etc/modprobe.d/no-ipv6.conf
    alias net-pf-10 off
    alias ipv6 off

    方法2:
    [root@rh6 ~]# cat /etc/modprobe.d/no-ipv6.conf
    install ipv6 /bin/true

    方法3:
    [root@rh6 ~]# cat /etc/modprobe.d/no-ipv6.conf
    options ipv6 disable=1

  3. 編輯 /etc/sysconfig/network

    [root@rh6 ~]# cat /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=xxooxp.blogspot.com
    GATEWAY=172.16.1.254
    NETWORKING_IPV6=off

  4. 關閉 ip6tables

    [root@rh6 ~]# service ip6tables stop
    [root@rh6 ~]# chkconfig ip6tables off

  5. 重新開機,讓設定生效.

    [root@rh6 ~]# shutdown –r now

  6. 確認重開機後,ipv6 就不會載入了.

    [root@rh6 ~]# lsmod | egrep 'ipv6'
    [root@rh6 ~]# ip addr show | egrep 'inet6'

11/30/2011

讓人看來專業的 Windows *.msc 指令

 
admgmt.msc AD 管理
azman.msc 授權管理員
certmgr.msc 憑證管理員
certtmpl.msc 憑證範本
ciadv.msc 索引服務程序
comexp.msc 元件服務
compmgmt.msc 電腦管理
devmgmt.msc 裝置管理員
dfrg.msc 磁碟重組工具
dfsgui.msc 分散式檔案系統
dhcpmgmt.msc DHCP 管理
diskmgmt.msc 磁牒管理
dnsmgmt.msc DNS 管理
domain.msc AD 網域及信任
dsa.msc AD 使用者及電腦
dssite.msc AD 站台及服務
eventvwr.msc 事件檢視器
fsmgmt.msc 共用資料夾管理
gpedit.msc 群組原則
iis.msc IIS 管理
ipaddrmgmt.msc IP 位址管理
lusrmgr.msc 本機使用者和群組
mscorcfg.msc .NET 設定
ntmsmgr.msc 卸除式存放裝置
ntmsoprq.msc 卸除式存放裝置管理員請求
perfmon.msc 效能檢視器
pkmgmt.msc 公開金鑰管理
rsadmin.msc 遠端存放
rsop.msc 原則結果組
schmmgmt.msc Schema 管理
secpol.msc 本機安全性設定
services.msc 服務
tapimgmt.msc 電話語音
tsmmc.msc 遠端桌面
uddi.msc UDDI服務主控站
winsmgmt.msc WINS 管理
wmimgmt.msc WMI 管理


11/27/2011

設定 Red hat Enterprise Linux bonding 介面.

 

設定Red hat Enterprise Linux bonding 介面流程如下:

  1. 確認主機上至少有兩張網卡.
  2. 編輯或新增4個檔案:
    1. 編輯 /etc/sysconfig/network-scripts/ifcfg-eth0
    2. 編輯 /etc/sysconfig/network-scripts/ifcfg-eth1
    3. 新增 /etc/sysconfig/network-scripts/ifcfg-bond0
    4. 新增 /etc/mdoprobe.d/bonding.conf
  3. 重新啟動網路服務.
  4. 確認 bond0 介面,是否啟用.
  5. 查看目前 bond0,使用之實體網路埠.
  6. 手動切換 bond0,使用之實體網路埠.

我們接著看每個步驟較詳細的設定/檢查方法.

  1. 確認主機至少有兩張網卡.
    [root@XXOOXp ~]# dmesg | egrep 'eth.:'
    e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
    e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection

  2. 編輯或新增4個檔案:
    1. 編輯 /etc/sysconfig/network-scripts/ifcfg-eth0 的內容.
      [root@XXOOXp network-scripts]# cat ifcfg-eth0
      DEVICE=eth0
      BOOTPROTO=static
      MASTER=bond0
      SLAVE=yes
      ONBOOT=yes

    2. 編輯 /etc/sysconfig/network-scripts/ifcfg-eth1 的內容.
      [root@XXOOXp network-scripts]# cat ifcfg-eth1
      DEVICE=eth1
      MASTER=bond0
      SLAVE=yes
      ONBOOT=yes

    3. 新增 /etc/sysconfig/network-scripts/ifcfg-bond0
      [root@XXOOXp network-scripts]# cat ifcfg-bond0
      DEVICE=bond0
      IPADDR=192.168.75.55
      NETMASK=255.255.255.0
      ONBOOT=yes
      BOOTPROTO=static
      BONDING_OPTS="mode=1 miimon=50"

    4. 新增 /etc/mdoprobe.d/bonding.conf
      [root@XXOOXp modprobe.d]# cat bonding.conf
      alias bond0 bonding

  3. 重新啟動網路服務:
    [root@XXOOXp ~]# service network restart

  4. 確認 bond0 介面,是否啟用.
    [root@XXOOXp ~]# ip addr show bond0
    5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue
        link/ether 00:0c:29:0f:d7:c6 brd ff:ff:ff:ff:ff:ff
        inet 192.168.75.55/24 brd 192.168.75.255 scope global bond0
        inet6 fe80::20c:29ff:fe0f:d7c6/64 scope link
           valid_lft forever preferred_lft forever

  5. 查看目前 bond0,使用之實體網路埠.
    [root@XXOOXp ~]# cat /proc/net/bonding/bond0
    Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

    Bonding Mode: fault-tolerance (active-backup)
    Primary Slave: None
    Currently Active Slave: eth0
    MII Status: up
    MII Polling Interval (ms): 50
    Up Delay (ms): 0
    Down Delay (ms): 0

    Slave Interface: eth0
    MII Status: up
    Link Failure Count: 0
    Permanent HW addr: 00:0c:29:0f:d7:c6

    Slave Interface: eth1
    MII Status: up
    Link Failure Count: 0
    Permanent HW addr: 00:0c:29:0f:d7:d0
    [root@XXOOXp ~]#

  6. 手動切換 bond0,使用之實體網路埠.
    [root@XXOOXp ~]# ifenslave --change-active bond0 eth1
    [root@XXOOXp ~]# cat /proc/net/bonding/bond0 | egrep 'Currently'
    Currently Active Slave: eth1

參考資料:

Network Card Bonding On CentOS (bonding 不同 mode 的說明)

8.2.2. Channel Bonding Interfaces

23.7.2. Using Channel Bonding

Bonding on Debian

[root@XXOOXp ~]# modinfo bonding

[root@XXOOXp ~]# man modprobe.conf


10/13/2011

如何檢查 RHEL 5.X and AIX 的網卡連接狀態?

 

How to check RHEL 5.x (or above) and IBM AIX NIC link status?

 

這個是滿實用的一個功能...

有時人不在機器旁邊又不確定線到底有沒有接,

又或是線到底有沒有感應到...就會派上用場了!

 

關於 RHEL 5.x (或以上),可透過下面的指令..

[xxooxp ~]# ethtool eth0 | egrep 'Link'
        Link detected: yes

或是

[xxooxp ~]# mii-tool –v eth0

 

而在IBM AIX上,可透過下面的指令

root@aix61 / # netstat -v | egrep '(ETHERNET|Link)'
ETHERNET STATISTICS (ent3) :
Logical Port Link State: Up
Physical Port Link State: Down
ETHERNET STATISTICS (ent2) :
Logical Port Link State: Up
Physical Port Link State: Down
ETHERNET STATISTICS (ent0) :
Link Status : Up
ETHERNET STATISTICS (ent1) :
Link Status : UNKNOWN


9/25/2011

AIX版的Linux watch指令...(監控指令的輸出狀態)

 

標題有些繞舌...不過不影響我們的主題需求...

Linux上有個好用的指令叫做watch,

能夠持續的監控指令的輸出狀態,讓系統管理員能夠隨時嘗握狀況。

比方說我們想要監控 netstat -ant 的輸出狀況,隨時觀查連線狀態的變化。

則可以使用

# watch -d -n 1 ‘netstat –ant'

-n 表示每一秒更新一次輸出。
-d 表示將有變更的部份以高亮標示(Highlight)

輸出如下圖

image

很方便對吧!!

可惜...在IBM AIX上沒有這個好東西...( AIX上的watch指令是別的奇怪用途..)

不過別擔心! 因為這種問題在網路上早就一堆解答了...

這篇只是把他們整理一下,方便日後查找而已 ;-)

AIX 上的 watch 指令替代方案

其實也不難! 就是寫個迴圈來一直進行~

root@aix # cat watch.sh
#!/bin/ksh
#
# $1 = 監控的間隔時間,以秒為單位.
# $2 = 請將所有要輸入的指令以雙引號(")或單引號(')包起來.
#

# Exit the watch.sh use Ctrl + C
#

while true
do
  clear
  echo "Interval $1 sec, Command: $2"
  eval $2
  sleep $1
done
root@aix # #以下比方說要執行監控ls -l /home/user | grep .profile,每秒更新一次.
root@aix #
root@aix # ./watch.sh 1 "ls -l /home/user | egrep '.profile'"

 

 

參考資料如下:

Linux watch command on AIX?

Monitoring logs and command output


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


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/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 目錄。


12/21/2010

ESX 4 update 2 and ESX 4.1 or Later reset Service Console IP

 

 

回復 ESX 4 update 2 或 ESX 4.1 及之後版本的 Service Console IP 資訊。

這邊討論的是一個比較方便的指令,通常 ESX 或安裝完都會設定好 IP,

接著大家就會用 vSphere Client 來連線設定了。

但有些情況會需要將 Service Console 的 IP 重新設定,比方說…

  1. Virtual Distribution switch 設定錯誤。
  2. 誤刪 Service Console。
  3. 一開始就設定錯 IP。

回復的方法兩種(或許該說修改回正確值的方法),

  1. 復雜版,透過兩個指令來做,
    • esxcfg-vswitch
    • esxcfg-vswif
  2. 方便版,透過一個交談式指令完成。(親愛的朋友,這個方便的指令是從 ESX 4.0 Update 2 後才有的,若您是舊版本的話,請認命一點用方法1吧。)
    • console-setup

這邊當然是推薦使用 方法2 “console-setup” 指令,

不止是因為簡單,有使 Virtual Distribution switch 設定錯,

要用方法1改回來也是滿花時間的,同樣效果當然是選快的方法嚕。

 

對了,若是 ESXi 的話…就不必麻煩,直接去 Console 前 Reset 即可。
(當然所以設定都會一起 Reset,請小心評估。)

 

Reference data:

Configuring networking from the ESX service console command line

 

Configuring or restoring networking from the ESX service console using console-setup



12/10/2010

安裝 RHEL / CentOS 中文字型,以顯示中文。

 

若一開始是使用英文方式安裝,且又沒安裝中文語系,

之後在切換為 zh_TW.UTF-8 時,都會出現方塊字,

這個時候需要透過安裝字型來解決方塊字的問題。

 

作法是,在 RHEL / CentOS 光碟中的 \Server 資料夾內找到兩個 rpm 檔。

fonts-chinese-3.02-12.el5.noarch.rpm

fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm

在 X-Windows 下直接點擊該檔執行即可。

若是使用指令的話則是如下:

### 假設剛說的兩個 rpm 檔都放在 /tmp 下。

/ # cd /tmp

/tmp # rpm –ivh fonts-chinese-3.02-12.el5.noarch.rpm

/tmp # rpm –ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm

結束,現在登出系統在重新登入即可。(重開機也行)



11/23/2010

Windows Vista 之後版本的 Session 0

 

Windows Vista 及其之後的版本,

使用者都不會取得 Session 0,這是基於安全性的理由,

會設計為 Session 0 專為 System processes 與 Services 專用。

 

因此..只有 Windows Vista 之前的版本連遠端桌面的時候,

要做些特別應用的時候,需要在 CMD 輸入類似下面指令,來取得 Console Session。

mstsc /v:192.168.1.1 /admin

 

至於 Windows Vista 及 Windows Server 2008 和之後的版本,

基本上有沒有用 /admin 參數是一樣的...

除非你的 Windows Server 2008 或之後的版本,是有啟動 "終端機服務" 的,

才會需要用這個參數 (/admin),

用意是管理用 Session …不會計 Client Access License (有錯請指正)。

 

參考資料:

Impact of Session 0 Isolation on Services and Drivers in Windows




10/01/2010

重新製作AIX /dev/null

 

AIX 上 /dev/null 是個重要的傢伙!

不小心刪掉的話,會有麻煩,

因此我們需要重新做一個 null。

指令如下:

[root@host ~]# /bin/mknod /dev/null c 2 2


9/24/2010

Configuration Reverse SSH tunnel

 

錯誤處理的好朋友,聽同事說了這個神奇的技術後...

(真是江湖一點訣!,感謝同事的分享,說了很多關鍵字!!)

在網路查找一下後,看到兩個不錯的 Blog,

哈…其實也沒看幾個啦,古人說: 山不在高,有仙則靈啊!

所以有可以用的看就行了…

參考連結如下:

  1. 反向建立 SSH Tunnel、免 VPN 連回公司
  2. Reverse SSH Tunnel實際運用,搭配auotssh永不斷線,putty建立反向tunnel

 

簡單總結我需要的部份 (上述的兩個連結有很多應用)。

  1. 首先需要一台 SSH 伺服器,假設叫 relay.xxooxp.lab
    (提供 reverse SSH tunnel 功能)
  2. 在公司的 SSH 伺服器主機上 (假設叫 corp.xxooxp.com),
    開啟 Terminal 介面,輸入下列指令:
    [corp ~]# ssh –NfR 3456:corp.xxooxp.com:22 relay.xxooxp.lab
  3. 第2步的指令打完後,接著到relay.xxooxp.lab 輸入:
    [relay ~]# ssh –p 3456 localhost
  4. 非常好,我們開始進行reverse SSH tunnel了,真是即簡單又危險 :-),
    對不對啊..!

.

.

 

9/09/2010

IBM FastBack v5.5 及 v6.1 新增硬碟需知

 

一定需要配合FastBack的公用程式DiskOpen.exe來讓硬碟可以做讀寫的動作。

9/07/2010

沒有 uplink 的 vSwitch (Virtual Standard Switch, VSS) 不能 vMotion

 

在要做 vMotion 前的檢查就不能過關,

解決方法要參考VMware 官方的 KB 1003832 (Troubleshooting migration compatibility error: Currently connected network interface uses network, which is a virtual intranet)

在 vCenter 的 vpxd.cfg 設定檔中
Windows 2008 路徑為 "C:\ProgramData\VMware\VMware VirtualCenter\"

ESX 上的 Windows 2008 R2 或 Window 7 滑鼠很慢...

 

當滑鼠很慢的時候,你就會覺的伺服器效能很差!! (至少我是...)

解決方法:

  1. 更新 ESX 至 ESX 4.0 Update 1。
  2. ESX 4.0 Update 的 VMware Tools 中有新的顯示驅動程式在 "C:\Program Files\Common Files\VMware\Drivers\wddm_video" 資料夾中。
  3. 開啟 Windows 2008 R2 或 Window 7 的裝置管理員,在顯示卡按右鍵,選擇更新驅動程式,路徑指向 "C:\Program Files\Common Files\VMware\Drivers\wddm_video"

 

參考資訊:

VMware KB 1011709

2008 R2 VMs have a jumpy mouse: SOLVED

9/06/2010

vSphere Hypervisor (ESXi 4.1) 使用 SSH client 關機步驟。

 

正常情況下,我們應該是要使用 vSphere Client 來執行 shutdown 的動作。

或是走到 vSphere Hypervisor 的伺服器前,透過 Console 來做 shutdown。

但有時候,我們會需要使用 SSH client 來登入 vSphere client 執行 shutdown,
下面就來說明一下步驟吧:

  1. 使用 SSH client 登入 vSphere Hypervisor。
  2. 先確認 vSphere Hypervisor 上的 VM 都關機了。
  3. 若 vSphere Hypervisor 有加入叢集的話,
    要記得先讓 vSphere Hypervisor 進入 maintenance mode。(用 vim-cmd)
  4. 執行 /sbin/shutdown.sh
  5. 等步驟4的執行結束。
  6. 執行 /sbin/poweroff
  7. 靜待1-2分鐘,系統就會關機了。