แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - golfreeze

Pages: 1 ... 142 143 [144] 145 146
2146
all application on unix knowledges by golfreeze / Re: install ipvs loadbalance in debian
« on: มกราคม 23, 2011, 12:45:28 am »
ถ้าทำแล้ว มี error สั่งให้ start service ไม่ได้ ตอน ดู
สั่ง /etc/init.d/heartbeat stop
/etc/init.d/heartbeat start
Ldirectord is stopped for /etc/ha.d/ldirectord.cf
แล้วจะเกิดเป็น heartbeat failure [rc=xxx] failed

ให้เข้าไป check ที่ไฟล์ config เพราะอาจจะ กำหนด ตัว ชื่อ ethX ผิดในไฟล์
Ldirectord.cf , ha.cf
แล้วสั่ง start อีกรอบ ดู จะได้ครับ

2147
all application on unix knowledges by golfreeze / Re: install ipvs loadbalance in debian
« on: มกราคม 23, 2011, 12:45:10 am »
อีกคำสั่งที่เอาไว้ check ip addr ของ virtual ip คือ
#ip addr sh

ก็จะมีดังนี้ ครับ

2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:11:25:f1:ef:7d brd ff:ff:ff:ff:ff:ff
inet 10.0.1.149/23 brd 10.0.1.255 scope global eth0
inet 10.0.1.152/23 brd 10.0.1.255 scope global secondary eth0
inet6 2001:d90:10:101:211:25ff:fef1:ef7d/64 scope global dynamic
valid_lft 2591980sec preferred_lft 604780sec
inet6 fe80::211:25ff:fef1:ef7d/64 scope link
valid_lft forever preferred_lft forever
3: eth2: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:80:48:13:56:1c brd ff:ff:ff:ff:ff:ff
inet 172.16.0.2/29 brd 172.16.0.7 scope global eth2
inet6 fe80::280:48ff:fe13:561c/64 scope link
valid_lft forever preferred_lft forever

2148
all application on unix knowledges by golfreeze / Re: install ipvs loadbalance in debian
« on: มกราคม 23, 2011, 12:44:57 am »
สำหรับ ipvsadm version 1.2.1 ถ้าท่านไหนใช้ ให้ load balance ตัว
pop3 กับ imap protocol ล่ะก็ต้องลง patch module เพิ่มด้วยน่ะครับ

ของผมใช้งานเป็น debian 4.0 R1 ก็ search packet โดย

#apt-cache search ldirectord
ถ้ามี ก็สั่ง install โดย
#apt-get install ldirectord2
ซึ่งจะทำการ โหลด module ของ libmail-pop3client-perl
ซึ่งจะทำให้สามารถ load balance application ที่เป็น pop กับ imap ได้ครับ

เสร็จก็ทำการ restart service ipvs 1 รอบโดย

#/etc/init.d/heartbeat restart

แล้วลอง ipvsadm -l ดูครับ load ก็จะทำการ balance ไปที่ pop client

golfreeze[at]packetlove.com

2149
#ipvs + Heartbeat + Debian4.0 R1 (NAT Mode) ต้องทำ static nat ที่ loadbalance ด้วย

LB1 = install Debian 4.0 R1
LB2 = install Debian 4.0 R1

##Add this in /etc/apt/sources.list
deb http://www.ultramonkey.org/download/3/sargemain
deb-src http://www.ultramonkey.org/download/3sarge main
deb http://ftp.coe.psu.ac.th/debianstablemain
deb-src http://ftp.coe.psu.ac.th/debianstable main

#apt-get update
#apt-get install ultramonkey

ปกติถ้า ทำ HA จะมี config หลักๆ 3 ตัวคือ
#/etc/ha.d/ha.cf , haresources , authkeys
ส่วนของ ipvs จะให้อ่านจากไฟล์ config /etc/ha.cf/ldirectord.cf

#Diagram ก็ประมาณนี้ครับ




####LB1

#vi /etc/ha.d/ldirectord.conf
# Global Directives
checktimeout=10
checkinterval=2
#fallback=127.0.0.1:80
autoreload=no
logfile=\"/var/log/ldirectord.log\" #เก็บไฟล์log ของ ldirector
logfile=\"local0\"
quiescent=yes

# Virtual Server for HTTP
virtual=10.0.1.152:80
real=192.168.0.4:80 masq 2
real=192.168.0.5:80 masq 1
service=http
request=\"test.html\"
receive=\"Test Page\"
scheduler=wrr
#persistent=600
protocol=tcp
checktype=negotiate


#vi haresources

lb1 ldirectord::ldirectord.cf
lb1 LVSSyncDaemonSwap::master
lb1 IPaddr2::10.x.x.152/23/eth0
lb1 IPaddr2::192.z.x.254/24/eth1
-----------------------------------------------------

---------------------------------------
lb1:/etc/ha.d# more authkeys
auth3
#1 crc
3 sha1 ultramonkey


lb1:/etc/ha.d# more ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
bcast eth1 # Linux
mcast eth1 225.0.0.1 694 1 0
auto_failback on
node lb1
node lb2
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster


--------------------------------------------------


####LB2
#vi /etc/ha.d/ldirectord.conf
# Global Directives
checktimeout=10
checkinterval=2
#fallback=127.0.0.1:80
autoreload=no
logfile=\"/var/log/ldirectord.log\"
logfile=\"local0\"
quiescent=yes

# Virtual Server for HTTP
virtual=10.0.1.152:80
real=192.168.0.4:80 masq 2
real=192.168.0.5:80 masq 1
service=http
request=\"test.html\"
receive=\"Test Page\"
scheduler=rr
#persistent=600
protocol=tcp
checktype=negotiate


haresource จะเอาไว้สร้างตัว vip ให้เราน่ะครับ ก็ไม่มีไรมาก 2 ตัวต้องเหมือนกันน่ะครับทั้ง ตัว
master(lb1) กับ slave(lb2)
เพราะว่า
#vi haresources

lb1 ldirectord::ldirectord.cf
lb1 LVSSyncDaemonSwap::master
lb1 IPaddr2::10.x.x.152/23/eth0
lb1 IPaddr2::192.z.x.254/24/eth1

-----------------------------------------------------

Lb2:/etc/ha.d# more authkeys
auth3
#1 crc
3 sha1 ultramonkey


Lb2:/etc/ha.d# more ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
bcast eth1 # Linux
mcast eth1 225.0.0.1 694 1 0
auto_failback on
node lb1
node lb2
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster





##Set static nat in loadbalance1 and loadbalance2

#vi /etc/rc.local
iptables -t nat -F
iptables -t nat -A POSTROUTING -j SNAT -o eth1 -s 192.168.0.4 --to 10.x.x.x
iptables -t nat -A POSTROUTING -j SNAT -o eth1 -s 192.168.0.5 --to 10.x.x.x

สั่งให้ อ่าน rc.local ก็
#/etc/rc.local

#เสร็จแล้ว ก็มาทำ ตัวroute สำหรับผมมาติดปัญหาตรงจุดนี้ครับ ซึ่งลองใช้ tcpdump ช่วยก็เห็นว่า packet
มันไม่ส่งจากเครื่อง Rip(192.168.0.4) กับ จุด 5 ไปยังเครื่อง loadbalance
ตรงจุดนี้สำคัญมากน่ะครับคือต้องเรียนรู้เรื่อง network routing table ให้พอเข้าใจก่อน
#netstat -nr
lb1:/home/golf# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
10.0.0.0 0.0.0.0 255.255.254.0 U 0 0 0 eth1
0.0.0.0 10.x.x.x 0.0.0.0 UG 0 0 0 eth1
0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth2

***#route add -net 0.0.0.0/0 gw 10.0.0.254 dev eth1
***#route add -net 0.0.0.0/0 gw 192.168.0.254 dev eth2
***#route add -net 192.168.0.0 netmask 255.255.255.0 dev eth2


แล้วก็มา set ให้ เครื่อง loadbalance forward packet มาให้เครื่อง Rip น่ะครับ
#sysctl -a | grep forward
#vi /etc/sysctl.conf
Add
net.ipv4.ip_forward = 1
แล้วสั่งให้ show ค่าออกมาดูน่ะครับ
#sysctl -p

ส่วนเครื่อง web1 / web2
ก็ลงเป็น
#web1 os linux(debian4)
#ip 192.168.0.4
เครื่องฝั่ง internal ก็ไม่มีไรมากครับ ลง app ที่เราจะต้องใช้ แล้วก็จูน ให้เสร็จ ก็เปิดรับ service
ให้ใช้งานได้ก็จบครับ

#set ip
#vi /etc/network/interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254


#web2 os Freebsd(6.2)
#ip 192.168.0.5

#vi /etc/rc.conf
ifconfig_dc0=\"inet 192.168.0.5 netmask 255.255.255.0\"

ให้มัน restart network 1 ดอก
#/etc/rc.d/netif restart

คราวนี้ลองใช้ telnet เข้า vip ที่เรา set ไว้ดูน่ะครับ
ดังนี้
#telnet x.x.x.x 80
ลอง GET ดูน่ะครับ ถ้าได้ค่าว่า Test Page ก็แสดงว่า work แระ


คำสั่งที่จะใช้งานตรวจสอบว่า มี packet เข้ามาในเครื่องผ่าน nat เปล่าก็
#watch -n 1 "iptables -L -n -t nat -xv"

คำสั่งนี้เอาไว้ track ปัญหาน่ะครับ แล้วให้เขียน output ไปไว้ที่ xx.txt แล้วก็ค่อยไปไล่ๆ ดู
#tcpdump -n -i any port 80 > xx.txt

ดูว่า load balance ทำงานแบบ real time ก็
#watch -n 1 "ipvsadm -L -n --stats"
ได้ครับ

----------------------------------------------------------------------------------------------------


---
ในงานที่ต้องรับ connection ที่เยอะๆ นั้นการทำ load balance ก็สามารถช่วยแก้ปัญหาได้ครับ
ทำให้ประสิทธิภาพของงานทำได้ดีมากขึ้น แต่บางครั้งในส่วนของ software ก็อาจจะยังมีบางจุดที่ยังไม่ค่อย
stable พอหรือตาม config ที่อาจจะมีบางจุดที่นักพัฒนายัง implement อยู่
ซึ่งถ้ามองแล้วจะทำงานได้ไม่เท่ากับพวก hardware จริงๆ ซึ่งตัว hareware loadbalance
ค่อยข้างจะมีมาตรฐานพอสมควร ซึ่งพวกองค์กรที่ต้องการ performance แล้วก็แนะนำเป็น hareware (F5)
ดีกว่าครับ แพงดีแต่ก็คุ้มครับ

Lab By
http://www.packetlove.com
golfreeze@packetlove.com
ขอบคุณพี่อัท http://www.siambox.com ที่แนะนำเรื่อง route ครับ และคำแนะนำ อิอิ

2151
วันนี้ ลอง tool อีกตัวหนึ่งครับ คือ macchanger

ใน debian ก็ลงเป็น
#apt-get install macchanger

เสร็จแล้ว ก็ เริ่ม ใส่โดย
#macchanger --m xxxxxxx ชื่อinterface

แค่นี้ก็จัดการ ปลอม mac address ของ wifi ได้แล้วครับ อิอิ

2152
วิธีการ set interface ให้รับ ip แบบ dhcp ใน debian ครับ

#dhclient ชื่อinterface

หรือถ้ายังไม่ทราบว่า interface ไหนใช้ได้บ้างก็ใช้คำสั่ง

#mii-tools

ครับ

2153
อิอิ วันก่อนไปแข่งงาน AirRaid Hacking Challenge BKK 2008 มาครับ
มี trick ที่ใช้คือ

Packet ที่ใช้เป็น aircrack-ng
ลง packet พื้นฐานสำหรับ ตัว aircrack-ng ก่อนโดย
#apt-get build-dep aircrack-ng

ต่อจากนั้นก็หา source file ตัวใหม่ของ aircrack-ng มาลงครับ
#tar zxf aircrack-ng-1-beta.tar.gz
#cd aircrack-ng
#make
#make install

เมื่อลง driver ของ interface DLink แล้วก็
เสร็จแล้วก็ ใช้วิธี search หา SSID ได้คือ
#airodump rausb0
------------------------------------------------------

ต่อมาเป็นวิธีการ set WIfi แบบ command line ครับ

ปลอม mac address โดยเปลี่ยนจากตัวเดิมเป็น 00:00:00:00:00:00 โดย
#ifconfig rausb0 hw ether 00:00:00:00:00:00 -arp

ค่า mac นี้เมื่อ restart เครื่องก็จะกลับเป็นค่าเดิมครับ

#ifconfig rausb0 10.x.x.x netmask 255.x.x.x up
#iwconfig rausb0 essid "XXX"
#iwconfig rausb0 key "xxdddffff"

แค่นี้ก็ปิง เครื่อง อื่นๆ ใน nw นั้นได้แล้วครับ

#route add default gw 10.x.x.y

อ่านเพิ่มเติมที่ http://golfreeze.packetlove.com/guyblog/?p=25

golfreeze[at]packetlove.com

2154
###sed ในกรณีเขียน ให้เปลี่ยน ตัวแปรไปด้วย

#!/bin/sh

change="xxxx"

less xxx.txt | sed 's/xxxx/'$change'/g' > xxx_new.txt

================

ต้องใส่ เครื่องหมาย ' ' ในตัวแปรด้วยน่ะครับ เป็น '$change' แบบนี้ครับผม

2155
##Count string + uniq word
less pop3d-ssl_list_grep_k | awk -F '@' '{print $2}' | sort | uniq -c | sort -n

##Check and find content of email
find ./ -type f -exec /bin/grep "487C2369.5070808@arc.net.my";; {} /dev/null \;

2156
#free | cut -d " " -f
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,28

#grep -L -r 'Subject: Shi' .

#find /home/gigi -name '*.c' -print | xargs grep 'hello' /dev/null

#sudo find / -type f -name *.jpg -exec cp {} . \;

find . -type f -size +10000 -exec ls -al {} \;
find . -atime +1 -type f -exec mv {} TMP \; # mv files older then 1 day to dir TMP
find . -name "-F" -exec rm {} \; # a script error created a file called -F
find . -exec grep -i "vds admin" {} \;
find . \! -name "*.Z" -exec compress -f {} \;
find . -type f \! -name "*.Z" \! -name ".comment" -print | tee -a
/tmp/list
find . -name *.ini
find . -exec chmod 775 {} \;
find . -user xuser1 -exec chown -R user2 {} \;
find . -name ebtcom*
find . -name mkbook
find . -exec grep PW0 {} \;
find . -exec grep -i "pw0" {} \;
find . -atime +6
find . -atime +6 -exec ll | more
find . -atime +6 -exec ll | more \;
find . -atime +6 -exec ll \;
find . -atime +6 -exec ls \;
find . -atime +30 -exec ls \;
find . -atime +30 -exec ls \; | wc -l
find . -name auth*
find . -exec grep -i plotme10 {};
find . -exec grep -i plotme10 {} \;
find . -ls -exec grep 'PLOT_FORMAT 22' {} \;
find . -print -exec grep 'PLOT_FORMAT 22' {} \;
find . -print -exec grep 'PLOT_FORMAT' {} \;
find . -print -exec grep 'PLOT_FORMAT' {} \;
find ./machbook -exec chown 184 {} \;
find . \! -name '*.Z' -exec compress {} \;
find . \! -name "*.Z" -exec compress -f {} \;
find /raid/03c/ecn -xdev -type f -print
find /raid/03c/ecn -xdev -path -type f -print
find / -name .ssh* -print | tee -a ssh-stuff
find . -name "*font*"
find . -name hpmcad*
find . -name *fnt*
find . -name hp_mcad* -print
find . -grep Pld {} \;
find . -exec grep Pld {} \;
find . -exec grep Pld {} \;
find . -exec grep PENWIDTH {} \; | more
find . -name config.pro
find . -name config.pro
find /raid -type d ".local_sd_customize" -print
find /raid -type d -name ".local_sd_customize" -print
find /raid -type d -name ".local_sd_customize" -ok cp
/raid/04d/MCAD-apps/I_Custom/SD_custom/site_sd_customize/user_filer_project_dirs {} \;
find /raid -type d -name ".local_sd_customize" -exec cp
/raid/04d/MCAD-apps/I_Custom/SD_custom/site_sd_customize/user_filer_project_dirs {} \;
find . -name xeroxrelease
find . -exec grep xeroxrelease {} \;
find . -name xeroxrelease
find . -name xeroxrelease* -print 2>/dev/null
find . -name "*release*" 2>/dev/null
find / -name "*xerox*" 2>/dev/null
find . -exec grep -i xeroxrelease {} \;
find . -print -exec grep -i xeroxrelease {} \;
find . -print -exec grep -i xeroxrelease {} \; > xeroxrel.lis
find . -exec grep -i xeroxrel {} \;
find . -print -exec grep -i xeroxrel {} \;
find . -print -exec grep -i xeroxrel {} \; | more
find /raid/03c/inwork -xdev -type f -print >> /raid/04d/user_scripts/prt_list.tmp
find . -exec grep '31.53' {} \;
find . -ls -exec grep "31/.53" {} \; > this.lis
find . -print -exec grep "31/.53" {} \; > this.lis
find . -print -exec grep 31.53 {} \; > this.lis
find . -exec grep -i pen {} /;
find . -exec grep -i pen {} \;
find . -print -exec grep -i pen {} \; | more
find . -exec grep -i pen {} \;
find . -atime +6 -exec ll | more \;
find . -atime +6 -exec ll \;
find . -atime +6 -exec ls \;
find . -atime +30 -exec ls \;
find . -atime +30 -exec ls \; | wc -l
find . \! -name '*.Z' -exec compress -f {} \;
find . -name 'cache*' -depth -exec rm {} \;
find . -name 'cache*' -depth -print | tee -a /tmp/cachefiles
find . -name 'cache[0-9][0-9]*' -depth -print | tee -a /tmp/cachefiles
find . -name 'hp_catfile' 'hp_catlock' -depth -print | tee -a /tmp/hp.cats
find . -name 'hp_catfile' -name 'hp_catlock' -depth -print | tee -a /tmp/hp.cats
find . -name 'hp_cat*' -depth -print | tee -a /tmp/hp.cats
find . -name 'hp_cat[fl]*' -depth -print | tee -a /tmp/hp.cats
find /raid -name 'hp_cat[fl]*' -depth -print
find . \! -name '*.Z' -exec compress -f {} \;
find . -name '*' -exec compress -f {} \;
find . -xdev -name "wshp1*" -print
find . -xdev -name "wagoneer*" -print
find . -name "xcmd" -depth -print
find /usr/contrib/src -name "xcmd" -depth -print
find /raid -type d -name ".local_sd_customize" -exec ls {} \;
find /raid -type d -name ".local_sd_customize" \
-exec cp /raid/04d/MCAD-apps/I_Custom/SD_custom/site_sd_customize/user_filer_project_dirs {}
\;

2157
#!/bin/sh

PATH=/usr/sbin:/sbin:/usr/bin:/bin
export PATH

HOME="/home/migrate"

cd {HOME}
if [ -s ${HOME}/email_list ]
then
while read path_old
do
test=`echo $path_old | cut -d \/ -f 2,3,4`
echo "Already copy $path_old /home/$test"
#cp $path_old /home/$test
done < ${HOME}/email_list
cat /dev/null > ${HOME}/email_list
else
exit
fi

2158
##Check and find content of email
find ./ -type f -exec grep "487C2369.5070808@arc.net.my"; {} /dev/null \;

##Find text

ใช้ regular exp ช่วย
โดยจุดประสงค์เพื่อต้องการหา คำว่า ขึ้นต้องด้วยอะไรตาม และเชื่อมด้วย @ แล้วลงท้ายด้วยอะไรตาม ครับ

search = ^(.*).@.(.*)$

# copy file ยกเว้น 1 ไฟล์ครับ
find . -type f -prune ! -name <file to be not copied> -exec cp {} /path/to/newdir \;

#หา mail ที่ลงท้ายด้วย linchee และอยู่ใน path new
find ./ -type f | grep linchee | grep new | more

2159
You can use -mtime option. It returns list of file if the file was last accessed N*24 hours ago. For
example to find file in last 2 months (60 days) you need to use -mtime +60 option.

* -mtime +60 means you are looking for a file modified 60 days ago.
* -mtime -60 means less than 60 days.
* -mtime 60 If you skip + or - it means exactly 60 days.

So to find text files that were last modified 60 days ago, use
$ find /home/you -iname "*.txt" -mtime -60 -print

Display content of file on screen that were last modified 60 days ago, use
$ find /home/you -iname "*.txt" -mtime -60 -exec cat {} \;

Count total number of files using wc command
$ find /home/you -iname "*.txt" -mtime -60 | wc -l

You can also use access time to find out pdf files. Following command will print the list of all pdf
file that were accessed in last 60 days:
$ find /home/you -iname "*.pdf" -atime -60 -type -f

List all mp3s that were accessed exactly 10 days ago:
$ find /home/you -iname "*.mp3" -atime 10 -type -f

There is also an option called -daystart. It measure times from the beginning of today rather than
from 24 hours ago. So, to list the all mp3s in your home directory that were accessed yesterday,
type the command
$ find /home/you -iname "*.mp3" -daystart -type f -mtime 1

2160
ส่วนประกอบของ RAID

RAID Controller

ตัวควบคุมระบบ RAID นั้นใช้ได้ทั้งซอฟต์แวร์และฮาร์ดแวร์ หรือใช้รวมกันก็ได้ ซอฟต์แวร์เช่น Windows NT
4.0 สนับสนุน RAID ระดับ 0 ,1 (Striping , Mirroring) และฮาร์ดแวร์จากผู้ผลิตรายต่างๆ
ซึ่งมีอยู่มากหลากหลาย เช่น Asustek , Adaptec , DCT ,MTI
ซึ่งฮาร์ดแวร์เหล่านั้นมีราคาอยู่ในระหว่างสองหมื่นถึงเป็นล้านบาท

กรณีใช้ซอฟต์แวร์เป็น RAID Controller จะมีข้อจำกัดคือ ระดับที่สนับสนุน คือ 0, 1 (Striping ,
Mirroring) นั้นยังไม่ครอบคลุมระดับ Data Protection ในเรื่องของพาริตี้ ซึ่งมีใน RAID ระดับ 3,5
และใช้กำลังจากโปรเซสเซอร์ ทำให้โปรเซสเซอร์มีเวลาจะไปประมวลผลงานอื่นๆ น้อยลง การใช้ซอฟต์แวร์ควบคุม
มีข้อดีคือ ราคาถูกกว่า ไม่ต้องการอุปกรณ์เพิ่มเติมมากนัก

ส่วนฮาร์ดแวร์ โดยมากจะได้รับการออกแบบที่ดี แต่ฮาร์ดแวร์ก็มีข้อแตกต่างระหว่างยี่ห้อต่างๆ คือ
ประสิทธิภาพในการทำงานแตกต่างกันออกไป การติดตั้งยากกว่าซอฟต์แวร์ควบคุม
และราคาการลงทุนค่อนข้างสูงกว่า
เพราะต้องการอุปกรณ์เพิ่มเติม ไม่ว่าจะเป็นฮาร์ดดิสก์ เคสสำหรับฮาร์ดดิสก์ โดยเฉพาะระบบ "Hot
Swap" แต่ผลของการลงทุนก็คุ้มค่า (เกี่ยวกับ Hardware RAID Controller ดูข้อมูลเพิ่มเติมได้จาก
รู้จักกับ Raid Controller)



ฮาร์ดดิสก์ที่นำมาต่อเป็น Array (Physical Drive)

คือฮาร์ดดิสก์ที่นำมาต่อเข้าเพื่อใช้กับระบบที่จะใช้ RAID จำนวนของฮาร์ดดิสก์นั้น
ขึ้นอยู่กับระดับของ RAID ที่เลือกใช้งาน



ไดรฟ์อะไหล่ (Spare Drive)

เป็นฮาร์ดดิสก์ที่นำมาติดตั้งไว้เป็น "อะไหล่" เผื่อว่าฮาร์ดดิสก์ตัวอื่นๆ ที่ใช้ในระบบ
RAID เกิดชำรุดเสียหาย โดยปกติเมื่อไดรฟ์ตัวใดตัวหนึ่งในระบบเกิดเสียหาย ไดรฟ์ที่เป็น
"อะไหล่" จะถูกสลับเข้าไปใช้งานแทนที่โดยอัตโนมัติทันที



ไดรฟ์ชำรุด (Failed Drive)

ฮาร์ดดิสก์ที่ชำรุดเสียหาย เช่นมี Bad Sector หรือตัวระบบกลไกการทำงานเสียหาย
หรือไม่ตอบสนองต่อการทำงานของ Host SCSI ไดรฟ์พวกนี้ถือเป็น "ไดรฟ์ชำรุด"
จะต้องเอาออกและเปลี่ยนไดรฟ์ดีเข้าไปใหม่



ไดรฟ์ตรรกะ (Logical Drive)

เหมือนกับระบบดอสธรรมดา คือ ไม่ใช่ไดรฟ์จริง เป็นเพียงไดรฟ์สมมุติ แต่ใน RAID ไดรฟ์ตรรกะนั้น
เกิดจากการรวมเอาไดรฟ์อื่นๆ มารวมกัน ให้เกิดความจุสูงขึ้น

Logical Volume
ไม่อยากแปลเป็นไทย เอาเป็นแบบเดิม คงความหมายดีกว่า เมื่อต้องการ "ก้อน"
ของฮาร์ดดิสก์ที่มีความจุมากขึ้น ทำได้โดยการนำเอา "Logical Drive" มารวมเข้าด้วยกันเป็น
Logical Volume นั้นเอง



การจัดการ RAID

เมื่อกล่าวถึงการจัดการ RAID ก็เสมือนว่าเรากำลังคุยกันเกี่ยวกับเทคโนโลยี
"การจัดเก็บข้อมูล" หรือ Storage Technology ซึ่งมีสองส่วนด้วยกันคือ การเลือกระดับของ
RAID ที่เหมาะสมกับการใช้งาน และการจัดการกับไดรฟ์ที่เสียหาย



การเลือกระดับ RAID ที่เหมาะสม

RAID แต่ละระดับมีความเหมาะสมเกี่ยวกับการใช้งาน และความต้องการฮาร์ดแวร์ ซอฟต์แวร์
ฮาร์ดดิสก์แตกต่างกัน ดูอ้างอิงได้จากระดับของ RAID ซึ่งกล่าวไว้คร่าวๆ เกี่ยวกับระดับของ RAID
และการใช้งาน



การจัดการไดรฟ์เสีย

การจัดการกับไดรฟ์เสีย ไม่ได้หมายถึงว่า ฮาร์ดดิสก์เสียแล้ว ถึงค่อยคิดว่า จะจัดการอย่างไร แต่หมายถึง
จะทำอย่างไรกับ "ระบบเผื่อเสีย" หาฮาร์ดดิสก์มา Standby หรือเปิดไว้รอ
เหมือนเตรียมยางรถยนต์อะไหล่ติดไว้ที่ท้ายรถ? อะไหล่หรือ Spare นี่เป็นของ "เผื่อเสีย"
แน่นอน คิดอยากมีระบบ "เผื่อเสีย" ก็ต้องลงทุนบ้าง สำหรับ RAID ก็เช่นเดียวกัน
ต้องลงทุนซื้อไดรฟ์มาไว้ เรียกว่าเป็น Spare Drive ซึ่งมีทั้ง Global Spare Drive และ Local Spare
Drive เป็นสองกลุ่ม ความแตกต่างคือ Local Spare Drive จะเป็นอะไหล่สำหรับ Local Drive เพียงตัวเดียว
(แยกให้ออกนะครับ Local Drive ตัวเดียวหมายถึง 1 "ก้อน" หรือ 1 Volume ซึ่งจะรวมได้หลายๆ
Physical Drive เพราะ Local Drive ในระบบเครือข่าย แตกต่างจาก Local Drive ของพวกเครื่องพีซี) แต่
Global Spare Drive นั้นเป็นอะไหล่สำรองสำหรับ Local Drive 2 ก้อนขึ้นไป



การระบุว่าไดรฟ์ไหนเสีย และการวิเคราะห์อาการเสีย เป็นเทคนิคการออกแบบ RAID Controller
ที่ผู้ผลิตรายต่างๆ ต่างก็แข่งขันกันพัฒนา เพราะโดยคุณสมบัติการออกแบบฮาร์ดดิสก์แบบ SCSI แล้ว
เป็นไปได้ยากที่ RAID Controller จะตรวจสอบว่าไดรฟ์ไหนเสีย
แต่ระบบการตรวจสอบที่เกิดจากการพัฒนาร่วมกันของผู้ผลิต RAID และผู้ผลิตฮาร์ดดิสก์
ที่มีชื่อเทคโนโลยีว่า SAF-TE ก็ทำให้การวิเคราะห์
และวินิจฉัยอาการเสียของฮาร์ดดิสก์เป็นไปได้ง่ายขึ้น



การจัดการกับไดรฟ์เสีย ยังมีระบบสนับสนุนหรืออำนวยความสะดวก ซึ่งทำงานสอดคล้องกับระบบ RAID Controller
อีกส่วนหนึ่งคือ Hot Plug Drive, Hot Swap Drive Bay
ซึ่งหมายถึงการเปลี่ยนฮาร์ดดิสก์โดยอไม่ต้องปิดสวิตช์คอมพิวเตอร์ก่อน
และเมื่อเปลี่ยนแล้วนอกจากสามารถใช้งานได้ทันทีแล้ว หากใช้ระบบ RAID ก็สามารถ "Rebuild"
คือ สร้างระบบ RAID ในฮาร์ดดิสก์ก้อนใหม่ได้ทันที









การเพิ่มขนาดของ Logical Volume

ขนาดของ Logical Drive นั้น ขึ้นกับความจุและจำนวนของฮาร์ดดิสก์ที่นำมาเพิ่มในระบบ RAID โดยปกติระบบ
RAID จะระบุไว้ว่า กรณีใช้ฮาร์ดแวร์ในการควบคุม
ฮาร์ดดิสก์ทั้งหมดที่นำมาเพิ่มในระบบจะต้องมีความจุเท่ากัน การเพิ่มขนาดของ Logical Drive
ทำได้โดยการเพิ่มฮาร์ดดิสก์ SCSI เข้าไปในระบบ



ถ้าเป็นระบบ RAID เก่าๆ การเพิ่มขนาดของ Logical Drive ทำได้โดยการสำรองข้อมูลทั้งหมด
หลังจากนั้นปิดระบบ (ปิดเฉพาะระบบที่ใช้ RAID) ติดตั้งฮาร์ดดิสก์เพิ่มเติมเข้าไปในระบบ และ Config RAID
หรือการสร้าง RAID ขึ้นใหม่ วิธีการนี้มีข้อด้อยคือ ใช้เวลาในการดำเนินใหม่
และต้องการผู้เชี่ยวชาญ เพราะในระบบเครือข่าย ถ้าหากต้องมีการ "ติดตั้งระบบใหม่"
นั้นหมายถึง การ Config ระบบใหม่ทั้งหมด



แต่ระบบคอมพิวเตอร์ที่ใช้ RAID ใหม่ๆ นั้น ใช้หลักการของ Dynamic System Expansion
การขยายขนาดของระบบโดยวิธีการง่ายกว่าเดิม โดยวิธีนี้ต้องใช้กับระบบ RAID ที่เป็น RAID Hardware
Controller เท่านั้น โดยเมื่อเพิ่มฮาร์ดดิสก์เข้าไปในระบบ (จะเป็น Hot Plug หรือ Non Hot-Plug) ก็ได้
หลังจากนั้นใช้ฟังก์ชันในการตรวจจับ (SCSI Harddisk SCAN)
เพื่อตรวจสอบว่ามีฮาร์ดดิสก์ใหม่ถูกติดตั้งเข้าไปในอะเรย์ หลังจากนั้นก็ใช้ฟังก์ชันในการเพิ่มขนาด
Logical Volume โดยการ Assign ฮาร์ดดิสก์ใหม่เข้ากับระบบอะเรย์ เพียงไม่กี่นาทีก็เพิ่มขนาดของ Logical
Volume ได้



การจัดการและตรวจสอบโดย RAID Controller

ฮาร์ดแวร์ RAID Controller ที่ผลิตโดยผู้ผลิตหลายๆ รายๆ มีกลวิธีในการตรวจสอบระบบ DISK Array
โดยเริ่มจากการตรวจสอบตัวคอนโทรลเลอร์เอง ไปจนถึงการตรวจสอบฮาร์ดดิสก์ที่เป็นสมาชิกอะเรย์
ได้แก่การตรวจสอบ disk / PSU / Power / Over-Temp แล้วแสดงค่าความผิดพลาด
พร้อมทั้งแจ้งเตือนกรณีที่ความผิดพลาดนั้น ถือเป็นความผิดพลาดระดับวิกฤติ

Pages: 1 ... 142 143 [144] 145 146