Ganglia的gmetad, 每次收集到資料之後, 就會把資料寫入RRD資料庫檔案, 給web介面去讀來畫圖.
但是當node的數量增加之後, 這種經常性大量檔案的小筆寫入, 就是磁碟最不拿手的事情...
所以會產生I/O瓶頸.
Wednesday, October 30, 2013
Thursday, September 12, 2013
GlusterFS的平行讀寫測試!
測試對象的GlusterFS, 是由兩台server各接2部26TB的RAID組成, 總容量102T
RAID是SAS介面, 做成ext4.
server對外走的是10GbE, 合計頻寬20Gb/s = 2.5GB/s, 然後所有的client都使用GbE連接.
(所以應該要20台才會塞滿)
所有主機都用CentOS 6.4.
RAID是SAS介面, 做成ext4.
server對外走的是10GbE, 合計頻寬20Gb/s = 2.5GB/s, 然後所有的client都使用GbE連接.
(所以應該要20台才會塞滿)
所有主機都用CentOS 6.4.
Bits and pieces about Bonnie++
Bonnie++ is a tool to test file systems under Linux.
It create / read / delete files, so the performance is of file system but not the disk (block device).
Performance test on SSD and NFS
Note:
First testing target of the two is a 2.5TB RAID (/ssd, with 12 2.5" SSD, XFS)
Another is a 400GB PCIe SSD (/ssd2, ext4).
Both of them connect to a server. It has only GbE network, so NFS performance on them will be limited by network.
All clients uses GbE.
All server and clients uses CentOS 6.4.
First testing target of the two is a 2.5TB RAID (/ssd, with 12 2.5" SSD, XFS)
Another is a 400GB PCIe SSD (/ssd2, ext4).
Both of them connect to a server. It has only GbE network, so NFS performance on them will be limited by network.
All clients uses GbE.
All server and clients uses CentOS 6.4.
SSD / NFS的效能測試
先說明一下:
兩個測試目標, 一個是2.5TB的RAID (/ssd, 裡面裝12顆2.5" SSD, XFS)
另一個是400GB的PCIe SSD (/ssd2, ext4).
這兩個連接在一座server上, 但是只用GbE, 所以過網路的話效能會被壓住.
所有的client都是用GbE.
所有的主機都使用CentOS 6.4.
兩個測試目標, 一個是2.5TB的RAID (/ssd, 裡面裝12顆2.5" SSD, XFS)
另一個是400GB的PCIe SSD (/ssd2, ext4).
這兩個連接在一座server上, 但是只用GbE, 所以過網路的話效能會被壓住.
所有的client都是用GbE.
所有的主機都使用CentOS 6.4.
Thursday, August 01, 2013
yum也會segmentation fault?
這種錯誤訊息最討厭了= =+
這次的苦主是因為自己裝了source compiled zlib, 看起來跟yum是有相容性問題.
如果需要新版zlib的app是source compiled,
那建議的方法是新版的zlib只裝static lib, 然後叫需要的app去static link這個zlib
系統上的shared lib就不會受到影響.
詭異= =
這次的苦主是因為自己裝了source compiled zlib, 看起來跟yum是有相容性問題.
如果需要新版zlib的app是source compiled,
那建議的方法是新版的zlib只裝static lib, 然後叫需要的app去static link這個zlib
系統上的shared lib就不會受到影響.
詭異= =
Friday, July 26, 2013
GlusterFS升級
最近GlusterFS終於發布3.4.0正式版了~~~
(之前在beta)
如果從3.3.x升級的話很簡單, 因為設定檔是相容的
所以只要:
1. 暫停所有glusterFS的存取
(client umount, volume stop, service glusterd stop)
2. 升級套件
(抓新的glusterfs-epel.repo, yum update glusterfs*)
3. 重新啟動服務
(service glusterd start, volume start, client mount)
(之前在beta)
如果從3.3.x升級的話很簡單, 因為設定檔是相容的
所以只要:
1. 暫停所有glusterFS的存取
(client umount, volume stop, service glusterd stop)
2. 升級套件
(抓新的glusterfs-epel.repo, yum update glusterfs*)
3. 重新啟動服務
(service glusterd start, volume start, client mount)
Wednesday, July 10, 2013
yum相關實用技巧
yum是Redhat/CentOS/Fedora系用的, rpm的一個前端介面.
他可以管理repository (套件庫), 並且做更新及搜尋等動作.
yum會與網路上的套件庫同步, 做出一個套件清單
以下稍微介紹一下工作中常見的用法.
Thursday, June 27, 2013
Wednesday, May 29, 2013
新版Ganglia + Jobmonarch安裝步驟
Ganglia其實早就有新版, 但是因為搭配的Jobmonarch (監測Torque的plug-in) 一直沒有更新, 只能搭配到Ganglia 3.0.7, 所以我也都一直裝這個版本.
(有趣的是, 3.0.7現在還是Ganglia下載率最高的版本)
不過Jobmonarch目前已經更新 (2013/4/12), 所以可以搭配新版的Ganglia使用.
下面是簡單的安裝步驟, 測試環境是一個CentOS 6.4 VM, 另外本文件假設你已經裝好Torque.
0.
取得檔案
新的Jobmonarch可搭配的Ganglia最低版本是3.4.0與GangliaWeb 3.5.0.
目前(2013/5/28)最新的版本是3.6.0:
GangliaWeb最新的是3.5.10:
Jobmonarch最新的版本是1.1.1, 在這裡有:
另外Jobmonarch需要透過pbs_python連結Torque, 目前最新版是4.3.5:
最後, Ganglia需要用rrdtool與libconfuse, 兩個都可以從EPEL套件庫懶人安裝XD
以上的檔案我都下載到/opt/src目錄下.
1.
安裝EPEL
rpm –ivh epel-release-6-8.noarch.rpm
2.
安裝Ganglia client
先安裝必要的OS套件:
yum install gcc apr-devel libconfuse-devel
memcached-devel expat-devel pcre-devel zlib-devel python-devel make
然後解開檔案, 標準的source安裝程序:
tar xvzf ganglia-3.6.0.tar.gz
cd ganglia-3.6.0
./configure --sysconfdir=/etc --prefix=/usr
make
make install
cp gmond/gmond.init
/etc/init.d/gmond
chkconfig --add gmond
gmond –t > /etc/gmond.conf
這裡gmond.conf的格式大致與舊版一樣, 所以改法也一樣. 最後啟動service:
service gmond start
3.
安裝Ganglia server
先安裝必要的OS套件 (跟上面一樣, 但需要先安裝rrdtool 1.4.7+)
yum install gcc apr-devel
libconfuse-devel memcached-devel expat-devel pcre-devel zlib-devel make python-devel
然後解開檔案, 標準的source安裝程序:
tar xvzf ganglia-3.6.0.tar.gz
cd ganglia-3.6.0
./configure --sysconfdir=/etc --prefix=/usr --with-gmetad
make
make install
cp gmetad/gmetad.init /etc/init.d/gmetad
chkconfig --add gmetad
新版會自動把gmetad.conf複製到/etc, 所以不用自己copy.
單一cluster的話, gmetad.conf預設的內容就可以用了.
一樣建立rrdtool的資料庫位置:
mkdir –p /var/lib/ganglia/rrds
chown –R nobody
/var/lib/ganglia/rrds
最後啟動service:
service gmetad start
4.
安裝Ganglia Web
新版的Web不再跟Ganglia包在一起, 而是另外一個檔案.
先安裝必要的OS套件:
yum install httpd php php-gd rsync
然後解開檔案:
tar xvzf ganglia-web-3.5.8.tar.gz
cd ganglia-web-3.5.8
make install
chkconfig httpd on
service httpd start
到這裡Ganglia就裝完了, 可以開瀏覽器指過去看看是否正常.
(如果出現error, 可能是SELINUX沒有關掉)
5.
安裝pbs_python
先安裝必要的OS套件:
yum install python-devel
然後解開檔案:
tar xvjf ganglia_jobmonarch-1.1.tar.bz2
cd ganglia_jobmonarch-1.1
./configure --prefix=/usr
--with-pbsdir=/usr/local/lib
make
make install
6.
安裝Jobmonarch
這次的版本一樣包含JobArchive (job資料庫查詢), 不過預設值是不安裝的, 我們也就照預設值做.
解開檔案:
tar xvjf ganglia_jobmonarch-1.1.tar.bz2
cd ganglia_jobmonarch-1.1
cp jobmond/jobmond.conf /etc
cp jobmond/jobmond.py /usr/sbin
cp pkg/rpm/init.d/jobmond /etc/init.d
cp pkg/rpm/sysconfig/jobmond /etc/sysconfig
chkconfig --add jobmond
編輯/etc/jobmond.conf, 20行:
BATCH_SERVER : localhost
改成:
BATCH_SERVER : (Torque
server的完整hostname, 包含domain)
再來是55行:
GMETRIC_TARGET :
239.2.11.71:8649
改成:
GMETRIC_TARGET : (Torque
server的內網IP):8649
編輯/etc/init.d/jobmond, 18行:
DAEMON=/usr/sbin/jobmond
改成:
DAEMON=/usr/sbin/jobmond.py
再來是40行:
killproc $DAEMON
改成:
killproc –pidfile $PIDFILE
編輯/usr/sbin/jobmond.py, 564行:
GMOND_CONF = '/etc/ganglia/gmond.conf'
改成:
GMOND_CONF = '/etc/gmond.conf'
結束編輯, 然後:
cp web/* /var/www/html/ganglia -a
chown -R apache:apache
/var/www/html/ganglia/addons/job_monarch/dwoo
編輯/var/www/html/ganglia/conf_default.php, 把29行:
$conf['template_name'] =
"default";
改成:
$conf['template_name'] = "job_monarch";
結束編輯, 然後:
cd
/var/www/html/ganglia/addons/job_monarch
mv ../../conf.php.in ./conf.php
編輯conf.php, 把24行:
$GANGLIA_PATH = "__GANGLIA_ROOT__";
改成:
$GANGLIA_PATH =
"/var/www/html/ganglia";
這樣就結束了, 正常的話JobMonArch應該可以從Torque讀取到資料, 並顯示在Ganglia裡面.
Install Jobmonarch 1.1 with Ganglia 3.6.0
Well I stayed with Ganglia 3.0.7 for a long time, for the Jobmonarch plugin can't work with Ganglia above that version.
It has changed, however, for the plugin updated to version 1.0 (at 2013/4/12) and supports Ganglia above 3.4.0.
The following procedure is done on a CentOS 6.4 VM with Torque 3.6.0 already installed.
It has changed, however, for the plugin updated to version 1.0 (at 2013/4/12) and supports Ganglia above 3.4.0.
The following procedure is done on a CentOS 6.4 VM with Torque 3.6.0 already installed.
Tuesday, February 05, 2013
在Linux中調整IBM IMM/uEFI的設定
IMM (integrated management module)是IBM的BMC系統,
相當於HP的iLO或是Dell的iDRAC。
它們提供另一組網路,可以做一些在OS裡面無法做的管理功能,
或是在OS down的時候進行管理。
不過如果機器在遠端,要到現場做設定就比較難了
而且IBM跟HP的機器大多沒有操作面板,
要改BMC設定的話要重開機到BIOS裡面去改...
Dell可以在面板操作,不過也只能設定IP。
IBM提供一個工具軟體,叫ASU,可以在作業系統中更改IMM或uEFI的設定值。
相當於HP的iLO或是Dell的iDRAC。
它們提供另一組網路,可以做一些在OS裡面無法做的管理功能,
或是在OS down的時候進行管理。
不過如果機器在遠端,要到現場做設定就比較難了
而且IBM跟HP的機器大多沒有操作面板,
要改BMC設定的話要重開機到BIOS裡面去改...
Dell可以在面板操作,不過也只能設定IP。
IBM提供一個工具軟體,叫ASU,可以在作業系統中更改IMM或uEFI的設定值。
Monday, February 04, 2013
USB又抓不到了
USB毛病實在很多啊!
上次遇到這種問題是重灌... 不過這次有找到解法.
Windows 7 Prof x64 SP1, 偵測不到的是Fiio E17這台DAC/耳擴一體機.
想說把控制台的USB控制器給砍了, 應該會重新建立USB reg tree.
結果咧, 控制器跟Root hub有回來, 但Generic USB hub抓不到了...
最後在MS網站找到方法...
先到控制台刪掉兩個找不到driver的未知裝置,
然後到命令列打:
wusa /uninstall /kb:2529073
重開機之後, 應該就可以抓到Generic USB hub了
最後Windows update更新一下, 會自動把hotfix再裝回來.
至少不用再重灌了...
Friday, February 01, 2013
NFS不能掛? 原來...
上次講到GluserFS也可以用NFS client掛。
但是用自編的kernel 3.4.27卻不行... 會說Protocol not supported.
查了一下發現,GlusterFS的server只支援NFS v3
但是3.4.27的kernel... 預設是把v3 client的支援關掉的。(翻桌)
要手動勾選v3再來編...
幹嘛拿掉啊真是orz
但是用自編的kernel 3.4.27卻不行... 會說Protocol not supported.
查了一下發現,GlusterFS的server只支援NFS v3
但是3.4.27的kernel... 預設是把v3 client的支援關掉的。(翻桌)
要手動勾選v3再來編...
幹嘛拿掉啊真是orz
Wednesday, January 30, 2013
Writing with FUSE / NFS client in GlusterFS, distributed mode
Out of curiosity ;)
We know that GlusterFS server provides FUSE and NFS interface.
What's the difference?
A test is made with VM environment.
All VMs using CentOS 6.3, factory kernel 2.6.32, GlusterFS 3.3.1.
server: gluster volume "test"
c6:/brick1
c61:/brick2
client: c6c
iftop was installed from EPEL repository to see how the data flows.
Gluster分散模式下, 兩種mount方式的差異(1)
出於好奇...
前面提過GlusterFS可以用FUSE client,也可以用NFS client。
但是用起來會有什麼差別?
我做了一個測試,環境是在VM建的
都是CentOS 6.3, factory kernel 2.6.32, GlusterFS 3.3.1
server: gluster volume "test"
c6:/brick1
c61:/brick2
client: c6c
三台用同一個subnet連接,然後從EPEL安裝iftop看網路流量,看看資料是怎樣傳送的。
先用NFS client, 把資料寫進/data
可以看到c6c的資料全部都傳到c6,也就是NFS server;c6c沒有直接傳資料到c61。
資料去到c6之後,c6再把一部分的資料傳到c61。
如果改用FUSE client:
c6c傳送時就直接把資料分散到c6跟c61兩台主機。
所以這樣可以知道,採用FUSE會比較節省網路頻寬,因為用NFS的話,要去c61的資料等於是多被傳送了一次。
這裡也可以衍生一個結論,如果client多的話,應該要避免NFS全部掛同一台Gluster server,以免頻寬塞住。
讀取的情形還沒有試,有空再來做,不過我想應該差不多吧...
前面提過GlusterFS可以用FUSE client,也可以用NFS client。
但是用起來會有什麼差別?
我做了一個測試,環境是在VM建的
都是CentOS 6.3, factory kernel 2.6.32, GlusterFS 3.3.1
server: gluster volume "test"
c6:/brick1
c61:/brick2
client: c6c
三台用同一個subnet連接,然後從EPEL安裝iftop看網路流量,看看資料是怎樣傳送的。
先用NFS client, 把資料寫進/data
可以看到c6c的資料全部都傳到c6,也就是NFS server;c6c沒有直接傳資料到c61。
資料去到c6之後,c6再把一部分的資料傳到c61。
如果改用FUSE client:
c6c傳送時就直接把資料分散到c6跟c61兩台主機。
所以這樣可以知道,採用FUSE會比較節省網路頻寬,因為用NFS的話,要去c61的資料等於是多被傳送了一次。
這裡也可以衍生一個結論,如果client多的話,應該要避免NFS全部掛同一台Gluster server,以免頻寬塞住。
讀取的情形還沒有試,有空再來做,不過我想應該差不多吧...
Note on Using Drobo with GlusterFS
(Thought I really doubt that anyone on this planet is unfortunate enough to uses the same configuration with me lol)
OK. Here we know that:
1. Drobo can use only ext3, maximum 8TB volume, under Linux.
2. Using 2 Volumes on CentOS 6.3 must use USB connection with kernel-ml 3.7.x from ELREPO repository.
Doing the single machine GlstuerFS on ths box goes smoothly, except one thing:
Attempting to ls the mounted GlusterFS volume will hang up.
How do one uses the volume if one can't see its content?
The bug is caused by: (reference)
The ext4 HASH function, in fs/ext4/dir.c changed with kernel 3.3.x.
This change also made on ext3 with kernel 3.7.x, so the kernel-ml from ELREPO is affected by this.
Since the GlusterFS relies on HASH to process the metadata...
So the problem I had is to find a kernel new enough to correctly detect multiple USB volumes on drobo, while old enough to have working ext3 HASH with GlusterFS.
It turned out that the kernel.org 3.4.27 version is OK.
I just compile this kernel on my own, since there's no ready RPM found.
How to compiling kernel.org kernels on CentOS can be found here.
OK. Here we know that:
1. Drobo can use only ext3, maximum 8TB volume, under Linux.
2. Using 2 Volumes on CentOS 6.3 must use USB connection with kernel-ml 3.7.x from ELREPO repository.
Doing the single machine GlstuerFS on ths box goes smoothly, except one thing:
Attempting to ls the mounted GlusterFS volume will hang up.
How do one uses the volume if one can't see its content?
The bug is caused by: (reference)
The ext4 HASH function, in fs/ext4/dir.c changed with kernel 3.3.x.
This change also made on ext3 with kernel 3.7.x, so the kernel-ml from ELREPO is affected by this.
Since the GlusterFS relies on HASH to process the metadata...
So the problem I had is to find a kernel new enough to correctly detect multiple USB volumes on drobo, while old enough to have working ext3 HASH with GlusterFS.
It turned out that the kernel.org 3.4.27 version is OK.
I just compile this kernel on my own, since there's no ready RPM found.
How to compiling kernel.org kernels on CentOS can be found here.
Using GlusterFS client / server on the same machine
Unlike Lustre (stated in its readme), GlusterFS can run server and cilent on the same machine.
It's even simpler because there's only one machine to setup.
I'm using HP z620 with CentOS 6.3, hostname "hydro1", with 2 Drobo S (4 volumes total).
The software install is simple as:
Download the glusterfs repo file into /etc/yum.repos.d
yum install glusterfs glusterfs-server glusterfs-fuse
Start the glusterd service:
service glusterd start
chkconfig glusterd on (to make it auto-start during boot)
In my case the bricks are mounted at /bricks/1~4, ext3 format.
Issue the command to create and start the GlusterFS volume "drobo":
gluster volume create drobo hydro1:/bricks/1 hydro1:/bricks/2 hydro1:/bricks/3 hydro1:/bricks/4
gluster volume start drobo
Note that although we're using the local machine for bricks, the command do not accept "localhost" as brick prefix.
The rest's simple:
mount hydro1:drobo /data -t glusterfs
You can also use NFS client to mount, but be sure to install and start NFS-related services (rpcbind, nfslock, etc.) before the glusterd starts.
It's even simpler because there's only one machine to setup.
I'm using HP z620 with CentOS 6.3, hostname "hydro1", with 2 Drobo S (4 volumes total).
The software install is simple as:
Download the glusterfs repo file into /etc/yum.repos.d
yum install glusterfs glusterfs-server glusterfs-fuse
Start the glusterd service:
service glusterd start
chkconfig glusterd on (to make it auto-start during boot)
In my case the bricks are mounted at /bricks/1~4, ext3 format.
Issue the command to create and start the GlusterFS volume "drobo":
gluster volume create drobo hydro1:/bricks/1 hydro1:/bricks/2 hydro1:/bricks/3 hydro1:/bricks/4
gluster volume start drobo
Note that although we're using the local machine for bricks, the command do not accept "localhost" as brick prefix.
The rest's simple:
mount hydro1:drobo /data -t glusterfs
You can also use NFS client to mount, but be sure to install and start NFS-related services (rpcbind, nfslock, etc.) before the glusterd starts.
GlusterFS遇上Drobo的問題
怎麼問題這麼多orz
OK,回顧一下。
Drobo在Linux底下只能用ext3,volume最大8TB。
要用USB連接,而且在CentOS 6下要換成ELREPO的kernel-ml (3.7.x)才能抓到完整容量。
然後GlusterFS"理論上"不挑kernel版本 (後面就知道慘了),可以把空間合併起來。
那遇到的問題是什麼,在上一篇GlusterFS單機惡搞版寫得好像很美好的情形下....
如果你真的去做會發現,掛起來的GluserFS (/data) 可以正常寫入,不管是用cp或是rsync都沒有問題。
但是要去ls看內容的時候... 會當住。orz
這樣要怎麼用啊!
問題出在這裡:(引用來源)
簡單說,kernel 3.3.x版改了ext4中dir.c的HASH函數,因為GlusterFS依靠HASH來處理metadata,所以會掛掉。
到kernel 3.7.x版,ext3也做了類似的修改,所以這下連ext3 + GlusterFS也會有問題了...
這就是下ls會當掉的原因。
好,因為這些限制,所以我們必須要找一個kernel版本可以:
1. 抓到USB上面Drobo的兩個volume,容量必須正確。
2. ext3還沒有改HASH函數。
經過追查,發現kernel 3.4.x可以符合這個條件。所以最後是自己編了一個kernel.org來的3.4.27才解決問題.... 是誰說不挑kernel的啊(翻桌)
CentOS底下編kernel.org核心的方法,可以參考這裡。
OK,回顧一下。
Drobo在Linux底下只能用ext3,volume最大8TB。
要用USB連接,而且在CentOS 6下要換成ELREPO的kernel-ml (3.7.x)才能抓到完整容量。
然後GlusterFS
那遇到的問題是什麼,在上一篇GlusterFS單機惡搞版寫得好像很美好的情形下....
如果你真的去做會發現,掛起來的GluserFS (/data) 可以正常寫入,不管是用cp或是rsync都沒有問題。
但是要去ls看內容的時候... 會當住。orz
這樣要怎麼用啊!
問題出在這裡:(引用來源)
簡單說,kernel 3.3.x版改了ext4中dir.c的HASH函數,因為GlusterFS依靠HASH來處理metadata,所以會掛掉。
到kernel 3.7.x版,ext3也做了類似的修改,所以這下連ext3 + GlusterFS也會有問題了...
這就是下ls會當掉的原因。
好,因為這些限制,所以我們必須要找一個kernel版本可以:
1. 抓到USB上面Drobo的兩個volume,容量必須正確。
2. ext3還沒有改HASH函數。
經過追查,發現kernel 3.4.x可以符合這個條件。所以最後是自己編了一個kernel.org來的3.4.27才解決問題.... 是誰說不挑kernel的啊(翻桌)
CentOS底下編kernel.org核心的方法,可以參考這裡。
Subscribe to:
Posts (Atom)

