[Linux] CentOS 6.x / 7.x change Hostname

{Centos 6.x}
step01. check current hostname
# hostname

step02.
# vi /etc/sysconfig/network
———modify———
HOSTNAME=改成你要的主機名稱
———modify———

step03.
# vi /etc/hosts
———modify———
* IP FQDN Hostname *
192.168.1.1  www1.dns.com.tw www1
———modify———

step04.
# service network restart 或 sync;sync;sync;shutdown -r now , init 6

Done.

{Centos 7.x}
step01. check current hostname
# hostname

step02. 永久的名稱
# hostnamectl –static set-hostname www1.dns.com.tw

若暫時等同用CentOS 6.x > hostname www1.dns.com.tw)
# hostnamectl –transient set-hostname www1.dns.com.tw

—-hostnamectl 三個模式—
-static        靜態
–transient 短暫
–pretty       機靈

step03.
systemctl restart network.service  或 sync;sync;sync;reboot , init 6
** Check **
# cat /proc/sys/kernal/hostname
# hostname
# hostname -f  (查詢 FQDN)
# hostname -i  (查詢主機對應IP)
# hostname -I  (查詢主機對應所有IP)

**Caution**
若只用指令hostname來變更CentOS 6.x僅是暫改,若重開機還是會回復原先主機名稱 !

[Linux] How to get Your Public IP Address

# curl ipinfo.io/ip

# curl ifconfig.co

# curl ifconfig.me

# curl icanhazip.com

# curl ipecho.net/plain;echo

# wget -qO- http://ipecho.net/plain | xargs echo

# wget -qO- http://ipecho.net/plain ; echo

# wget -qO – icanhazip.com

# hostname -I


 

Reference :
tecadmin.net – 5 Commands to Get Public IP using Linux Terminal

[Lenovo] LXCA How to upgrade v1.x to v2.x

要升級 v1.x 到 v2.x 需求

a.升級到v2.1需升到v2.0
b. v1.x先升級到 v1.4.1 update package (LXCA migrationtool)
c. v2.0 升到 v2.1 需要費時 40分鐘 ~ 一小時

升級流程:
v.1x > 1.4.1 > 2.0.0 > 2.1.0

事前準備工作:
a.下載 XClarity Administrator v1.4.1 (For migration only)

Upgrade procedure :

step01. login LXCA https://lxca-ip/ui/login.html

step02. confirm current " data, settings, and device managemet" list

step03. Administration > Update Management Server > Import > Select Files "
一次選四個 ( lnvgy_sw_lxca_41-1.4.1_anyos_noarch.tgz & lnvgy_sw_lxca_41-1.4.1_anyos_noarch.xml ) > Import

step04. choice import file > Perform Update > Restart

The update request has been submitted to the management server.
Please wait…this update could take several minutes…
Refresh the browser window to check if the management server has completed the update. // 更新過程網頁無畫面時可以按下 refresh重整畫面。

step04. Motoring > Jobs

step05. check job item “Import management-server update packages" state “complete"

step06. Administration > Shut down Management Server > Reboot // Apply upgrade v1.x to v1.4.1

step07.login LXCA ,
show you message
Lenovo XClarity Administrator version 1.4.1 is intended only for migrating data and settings to another Lenovo XClarity Administrator version 2.0.0 virtual appliance. Avoid performing any other operations."

step08.登入多了一項初始化未完成Item “Configure Service And Support Settings"

step09.
*Usage Data*
We’d like to ask a favor. In order to improve the product, and make your experience better, would you allow us to collect information on how you use this product? > 當然say No就不是頭殼壞去 , then Apply

*Call Home Configuration*
> Skip Step

*Lenovo Upload Facility*
> Skip Step

*Warranty*
>Apply

*Initial Setup*
> Return to Initial Setup

step10.
Item “Work with managed systems" // 準備轉移資料/設定/管理機器清單囉 ! 要想清楚唷…點下去就無法回頭 ><

step11.按下關鍵性一刻.進入LXCA管理介面右下角就會跳出一個訊息
“This version is for Migration use Only (1.x.x to 2.0.0).

To migrate data and settings to Lenovo XClarity Administrator version 2.0.0, go to Administration > Update Management Server > Export Data and Settings. Avoid performing any other operations."

step12. Administration > Update Management Server > Export Data and Settings.  // 照作咩 ; 建議重新登出再登入才會看到

step13.
Actions > Create data packageLXCA-export-data-and-settings.png

**若有需要連OS image 及 firmware需移轉就勾選;若不需要就輸入二次 Passphrase (最少九位數唷) > confirm

LXCA-export-data-and-settings2.png

step14. 完成後有二種方式轉移
method#1. Download data (offline) 匯出檔案 > 關掉舊LXCA or disconnect LXCA NICs > 佈署新LXCA > 登入新LXCA v2.0.0 > 初始化畫面即會看到"Restore from Backup"  > Upload package > Upload > 詢問該package Passphrase > Import

LXCA_import_success.jpg

LXCA_2.jpg

LXCA_3.jpg
匯入時間需視備份檔大小而定 (e.g. 18MB 也差不多需要 15分鐘)

<Caution> 不能偷懶用 LXCA v2.1.0來匯入 v1.4.1 export data 唷..v2.1.0僅接受匯 v2.0.0版本 export data !!

<PS: New LXCA 2.0.0> 改善了新安裝LXCA若無法取得DHCP若要設定IP都需編輯eth0_config包入.iso檔名讓LXCA掛載來設定;現在在開機時會出現150秒等待設定IP畫面。LXCA210-screen.png

method#2. Push data (online) 線上移轉到新一台LXCA

step15. 登入 LXCA v2.0.0 會發現多了可以備份功能 “Back Up and Restore Data" & “可自訂notification信件內容"
LXCA_4.jpg

LXCA_8.jpg

**信件主旨為下圖**
LXCA_9.jpg

step16. 繼續給它升級下去唄..走..下一個v2.1.0
download “Lenovo XClarity Administrator Virtual Appliance Update 2.1.0″ .tgz

step17. Administration > Update Management Server > Import > Select Files "
一次選四個 ( lnvgy_sw_lxca_41-1.4.1_anyos_noarch.tgz & lnvgy_sw_lxca_41-1.4.1_anyos_noarch.xml ) > Import

step18. choice import file > Perform Update > Restart

step19. Reboot , and login LXCA verify version is v2.1.0
check version method#1 > 點選 Administration > Update management server
check version method#2 > 點擊右上角帳號 > About

Done.


Reference :
1. Lenovo XClarity Administrator Upgrading Guide from v1.x to v2.x
2. Before installing Lenovo XClarity Administrator2.1 please read
3. Lenovo XClarity older versions of XClarity Administrator Repository Pack
4. Migrating to Lenovo XClarity Administrator v2.0.0
5. Lenovo XClarity All version download

[Lenovo] LXCA after deploy cannot get DHCP IP ,manual config IP

step01. 產生一個檔名叫"eth0_config"

step02. 內容編修如下
————————————
IPV4_ADDR=192.168.1.1
IPV4_NETMASK=255.255.255.0
IPV4_GATEWAY=192.168.1.100
IPV6_ADDR=1001:1002:1003:1004::2
IPV6_GATEWAY=1001:1002:1003:1004::1
————————————

step03. 將該文字檔作成一個ISO檔 ,e.g. boot-conf-ip.iso


Reference : Lenovo Xclarity Administrator – Step 6. Setup and configure the Lenovo XClarity Administrator virtual appliance > (Optional) Using a configuration file to set the IP settings

[Linux] RHEL / CentOS 6.x use Bonding(Teaming) NICs

step01. bonding module is not loaded by default
# modprobe –first-time bonding

step02. check
# lsmod | grep -i bond
# modinfo bonding

step03. Check the available interfaces on the server
# ip addrifconfig -a (e.g. I want to use eth0 & eth1)

step04. Shutdown interface
# ifdown eth0 && ifdown && eth1

step05. Configure a channel bonding interface
** eth0 **
vi /etc/sysconfig/network-scripts/ifcfg-eth0
——————————————————————
NAME=bond0-slave0
DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
NM_CONTROLLED=no
——————————————————————

** eth1 **
vi /etc/sysconfig/network-scripts/ifcfg-eth1
——————————————————————
NAME=bond0-slave1
DEVICE=eth1
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
NM_CONTROLLED=no
——————————————————————

** bond0 **
vi /etc/sysconfig/network-scripts/ifcfg-bond0
——————————————————————
NAME=bond0
DEVICE=bond0
BONDING_MASTER=yes
TYPE=Bond
IPADDR=xx.xx.xx.xx
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=active-backup miimon=100″
NM_CONTROLLED=no
——————————————————————

step06. create bond.conf
# vi /etc/modprobe.d/bond.conf
——————————————————————
alias bond0 bonding
——————————————————————

step07. Restart Network service
# service network restart

step08. up interface
# ifup eth0 && ifup eth1
# ifup bond0

step09.
# cat /proc/net/bonding/bond0

 

 

 

Reference :

  1. Red Hat Enterprise Linux 6 > Deployment Guide > 11.2.4. Channel Bonding Interfaces

[HDS] Compute Blade 500 ‘LPAR’ install RHEL6.7

*Pre-check*
1.what is ur CB500 blade mode ? e.g. CB 520H B3
2.what is ur wnat to install RHEL version ? e.g. RHEL 6.7 x86_64
3.use Physical or LPAR ?

*Pre-require*
CB500_520Hx3_Driver_Utility_for_RHEL6_v0670-01.iso // 後面 v0{xx}即代表該符合RHEL版本,若是符合RHEL 6.9會顯示 v0690-01.iso
CB500_hfc_drivers_cd_0429.iso ( need extract dd.iso )

*Notes*
1. CB 520X B1/B2 and CB 520H B3 can boot only on EFI.
2. CB 520H B3 @ CB500 chassis 需符合FW
> MM : 至少 A023
> LPAR Manager  至少 02-05

*Tips*
IP address of management module : 192.168.0.1 ; https://192.168.0.1
Factory default account / password : administrator / password
following LPAR configuration is recommended :
|-CPU : 2 or more
|-MEM: 2GB or Large
|-Disk: 40GB or Large capacity
|-NIC: 1 or more

*Installation RHEL 6.7*

step01.
extract CB500_hfc_drivers_cd_0429.iso (Fibre Channel driver) 裡頭 hfc_media\linux\x86_64\rhel6\cd_media放置各版本6.x hfc dd.iso ; 因我目標是RHEL6.7所以拷貝 2.6.32-573.el6裡頭dd.iso匯出
hfc-0429-dd.jpg

step02.
vKVM mount media ‘RHEL6.7 x86_64.iso’

step03.
一開始安裝畫面選擇第二項 “Install system with basic video driver" then press ‘Tab’ key

step04.
add ‘ dd blacklist=isci ‘ ,then press ‘b‘ boot in

step05.
The message, Do you have a driver disk? click  “Yes" ; 此時將原RHEL6.7 ISO unmount ,change 2.6.32-573.el6-dd.iso

step06.
choice media /sr0 , then click ‘OK’

step07.
The message “Do you wish to load any more driver disks ?" > clock “No" ;載入HBA driver後系統會自動umount dd.iso ,所以再手動掛入RHEL 6.7 ISO

step08.
HDD custom use LVM 或 traditional extended partition 都OK

step09.
自訂安裝項目什麼都可以裝,唯獨有二個千萬別裝 (PS: CB 520H B3環境)
~ System Management > System Management > Optional packages >
freeipmi-bmc-watchdog-x.x.x-x.xx.xx
~ Base System > Base > tboot-x.xxx.el6.x86_64.rpm

step10.
Finsih install , reboot

step11.
Boot menu , Press E key ; Delete “intel_iommu=on" and “amd_iommu=on" from the boot option,and press Enter.

step12.
enter OS , config boot menu
> vi /boot/efi/EFI/redhat/grub.conf
" intel_iommu=on" // delete
" amd_iommu=on" // delete
" nmi_watchdog=0 pci=noaer " add
" terminal –timeout=10 serial console " // add
" quiet rhgb " // delete from the kernel line
" nmi_watchdog=0 mce=0 pci=noaer no_timer_check console=ttyS1,115200 " // add the ending of the Kernel line
" vga=792 " // add ,LPAR Manager version 至少 01-60
" kernel /tboot.gz logging=vga,serial,memory " // comment out
Change the first “module" to “kernel" in the line starting with “module /initramfs"
Disable TCP checksum offload function
> ethtool -k eth{x} // 顯示目前網卡各功能狀態
> ethtool -K eth{x} rx off tx off

Do not use NetworkManager service
> service NetworkManager stop
> chkconfig NetworkManager off
> chkconfig | grep NetworkManager // 再次確認

Customizing /etc/sysctl.conf

== Validate the magic SysRq key to collect information when a problem
occurs. Edit or add the following line. ==
kernel.sysrq = 1

== Add a setting to induce kernel panic when NMI occurs, with which you can
quickly detect a failure in hardware and drivers ==
kernel.unknown_nmi_panic = 0
kernel.panic_on_unrecovered_nmi = 1
kernel.panic_on_io_nmi = 1

==  Add or edit the following line to set the console log level to 3. By changing
the level, you can avoid the console overload, which can result in
significant deterioration of applications or in Linux hang-up ==
kernel.printk = 3 4 1 7

Updating Drivers
# modinfo driver name

//etc/inittab /


 

Reference:

1. Red Hat Enterprise Linux Release Dates

2. Hitachi Compute Blade 500 Series OS Installation Guide for Red Hat Enterprise Linux

[Linux] RHEL6 install Hitachi multipath ‘HDLM’

step01. 準備好 HDLM Linux License *.plk ; 可以查看確認該檔文字內容有無 for Linux ,若沒有可不是隨便將for Windows 改為 for Linux就可以用唷!

step02. 更名License KEY改為或複製成hdlm_license
# mv “HDS VSP GXXX SNXXXXXX DXXX XXXXXXXXXXXX".plk /var/tmp/hdlm_license

step03.  放入 HDLM CD-ROM

step04. 掛載HDLM光碟
# mount -t iso9660 /dev/cdrom /media
Or
# mount /dev/cdrom /media

step05. check HDLM version
# /media/HDLM_Linux/installhdlm -v

step06. 安裝HDLM
# /media/HDLM_Linux/installhdlm
—————————————————–
KAPL09210-I installhdlm will now start.
KAPL09093-I HDLM 8.5.1-00 will be installed. Is this OK ? [y/n]: y
Preparing packages for installation…
KAPL09076-I The permanent license was installed.
HDLM-8.5.1.0.808-4
KAPL09043-I The installation of HDLM-8.5.1.0.808-4 completed successfully.
KAPL09211-I installhdlm completed successfully.
—————————————————–

step07. 檢查HDLM已安裝
# rpm -qa | grep -i hdlm

step08. 詳看HDLM資訊
# rpm -qi HDLM

step09. 若未重開機啟動
# /opt/DynamicLinkManager/bin/dlmstart
# /etc/init.d/DLMManager start

step10. 加入HDLM環境變數 > /opt/DynamicLinkManager/bin
[BourneAgain shell ]
# PATH=$PATH:/opt/DynamicLinkManager/bin ; export PATH

[C shell]
# set path= ( $path /opt/DynamicLinkManager/bin )

step11. 若未重啟系統請立即重啟一次
# shutdown -r now
Or
# init 6

step12. 查看dlnkmgr運作狀態及設定,版本,Load Balance模式,自動容錯切換狀態(aft),硬碟
# /opt/DynamicLinkManager/bin/dlnkmgr view -sys
我大多會注意三項資訊及狀態 > { Load Balance , Path Health Checking , Auto Failback )

HDLM-view-sys.png# /opt/DynamicLinkManager/bin/dlnkmgr view -lu
# /opt/DynamicLinkManager/bin/dlnkmgr view -path
# /opt/DynamicLinkManager/bin/dlnkmgr view -drv

Done.

–Maintenance–

**啟用Load Balance及變更模式為Round-Robin**
# /opt/DynamicLinkManager/bin/dlnkmgr set -lb on -lbtype rr
(模式如下)
rr       >for the Round Robin algorithm
exrr   >for the Extended Round Robin algorithm
lio      >for the Least I/Os algorithm
exlio  >for the Extended Least I/Os algorithm
lbk     >for the Least Blocks. algorithm
exlbk >for the Extended Least Blocks algorithm

**啟用及變更Path Health Checking及間隔時間**
# /opt/DynamicLinkManager/bin/dlnkmgr set -pchk on -intvl 10

**啟用Automatic Failback及間隔時間**
# /opt/DynamicLinkManager/bin/dlnkmgr set -afb on -intvl 10 (預設是關閉)

**查詢HDLM指令用法**
# /opt/DynamicLinkManager/bin/dlnkmgr help view


Reference :

1. Eddynurh’s Weblog – HDLM Installation

2. 馬克思 Linux學習筆記 – HDLM install on RHEL5.2

3. (原廠) Hitachi Command Suite – Dynamic Link Manager(for Linux®) User Guide

4. 杨红1989 – LINUX 安装HDS HDML报错