Friday, December 10, 2010

build kernel 遇到 PATH_MAX undeclared

今天在 Ubuntu 10.10 build 2.6.18.8 的 kernel 時遇到這個錯誤

爬文後發現很多人都有遇到這個問題

年紀大了還是寫下來以免忘記

修改 scripts/mod/sumversion.c

多 include limits.h 就 OK了


#include <linux/limits.h>

Windows 2008 R2 安裝 AD

在 Windows 2008 R2 安裝 AD 的簡易部簡易步驟

1. Set a static IP and set the same IP to DNS

2. start->run-> type dcpromo

3. Create a new Domain

4. Set FQDN ex: test.com

5. Set password for ADDR

Friday, November 26, 2010

/proc/sysrq-trigger的功能

sysrq-trigger功能很多, 之前最常用到是要作一些讓Linux kernel crash的測試時用sysrq-trigger就很方便了

當然要使用前記得先 enable 它, 平常是 disable 的
# echo 1 > /proc/sys/kernel/sysrq
使用方法如下

# 立即重新開機, 但不會 sync 和 umount
echo "b" > /proc/sysrq-trigger

# 立即關機
echo "o" > /proc/sysrq-trigger

# dump 記憶體分配的 information (可以使用 /var/log/message 查看)
echo "m" > /proc/sysrq-trigger

# Will dump the current registers and flags to your console. (應該是跟CPU相關的訊息)
echo "p" > /proc/sysrq-trigger

# Will dump a list of current tasks and their information to your console.
echo "t" > /proc/sysrq-trigger

# Will perform a kexec reboot in order to take a crashdump.
echo "c" > /proc/sysrq-trigger


其他功能可以查閱 Linux kernel 下 Documentation/sysrq.txt 文件

Saturday, November 20, 2010

Cluster Project FAQ

Cluster Project FAQ – Frequently Asked Questions

http://www.robertpeterson.org/faq.html

整理的很好, 有疑問的時候可以先去爬爬文, 以免走冤枉路

Wednesday, November 17, 2010

I/O fencing

就自己爬文和查資料所得的結果, 所謂 I/O fencing 的意義如下(不知是否有理解錯誤??)

什麼是 I/O fencing -

在cluster架構中, I/O fencing 是為了避免

假死或者動作異常的 cluster member 造成

shared media 資料損毀所採取的主動對策

為什麼需要它 -

Fencing 可以避免資料損毀, 降低 cluster 架構中的不確定性

以下以一個簡單的例子說明
*node 1 takes a lock
*node 1 hangs
*node 2 thinks node 1 is dead
*node 2 takes the same lock node 1 took
*node 2 writes data
*node 1 wakes up, still believing it has the lock
*node 1 overwrites data that node 2 just wrote out

加入 fencing 機制後
*node 1 takes a lock
*node 1 hangs
*node 2 thinks node 1 is dead
*node 2 fences node 1
*node 2 takes the same lock node 1 took
*node 2 writes data
*node 1 wakes up, still believing it has the lock
*node 1 tries to write data, but can't since it has lost its I/O paths to the disk
在第二個case中資料損毀的情況被避開了

目前在cluster software使用的技術

I/O Fencing Variants
*power fencing - 假如 power loss, 該 node 就無法做 I/O. 這可以藉由外部的 power switches 來完成
或者藉由整合的 power management 功能來完成, 例如 iLO, IPMI, DRAC, RSA, 等等

*fibre channel zoning - 一般來說是由 fibre channel switches 來切斷 host 到 shared SAN 的路徑

*SCSI-2 reservations (old) - 詳情見SPI-2

*SCSI-3 reservations (group) - 每個 node 須完成對 LUN或者LUNs 的註冊, 詳情見 SPI-3

*Network Disconnect (NAS only) - 當以(NFS, iSCSI, etc)來連接一個 NAS設備, 可以用一個 managed switch 將 node 的 network port 與網路隔離開

*ssh "reboot" - 此方法很不可靠

*virtual machine destruction - 等同於 power fencing

Wednesday, November 10, 2010

小技巧-檢查目錄是否有裝置mount在上面


if ! mountpoint -q /mnt/test; then
mount /mnt/test
fi

Cluster 名詞大集合

大部分資料從 Wikipedia 查到的, 只是作筆記整理
---------------------------------------------
Cluster 的種類 :
1.High-availability (HA) clusters
2.Load-balancing clusters
3.Compute clusters
---------------------------------------------
Two-node cluster - A two-node cluster is the minimal high-availability cluster that can be built.
---------------------------------------------
Classification by role symmetry
1.Active/Passive
One node owns the services, the other one remains inoperative.
Should the primary node fail, the secondary or backup node takes the resources and reactivates the services, while the ex-primary remains in turn inoperative.
This is a configuration where only one node is operative at any point of time.

2.Active/Active
There is no concept of a primary or backup node: both nodes provide some service, should one of these nodes fail, the other must also assume the failed node's services.
---------------------------------------------

Tuesday, October 26, 2010

PCIe study part (1)

PCIe
● topology : Point-to-Point
● frequency: 2.5 GHz
● width : 2 wires per lane/per direction (Up to 32 lanes)
● Max. throughput : 500~16000 MB/sec
● Split transaction : Yes
● Dev. type: Root complex, Switches, Bridges, Endpoints
● Layer : Physical layer, Data Link layer, Transaction layer

● PCIe employs packets to accomplish data transfer between devices--
Transaction Layer Packets (TLPs)

● There are 4 types of transactions--
Memory, I/O, Configuration, Messages

● What is transactionsseries ?
series of packet transmissions to complete information exchange between
requester and completer

● Posted = Requester transmits TLP request packet, completer
does not return completion packet --> Memory Write, Message

● Non-posted = Requester transmits TLP request packet,
completer returns completion packet to requester,
May include data in the request or completion TLP
--> Memory Read, Memory Read Lock, I/O Read, I/O Write, Config Read, Config Write

High Availability systems under Linux

文章閱讀筆記


#
What is HA?
High Availability is what it says it is.
Something that is Highly Available.

#
The service runs on a machine, and redirecting the service and requests to another healthy machine is the art of High Availability.

#
How will this work
if master node fails, then the slave node may take over its ip address and start serving the requests.This method is called IP takeover.

#
How do clusters talk
They will talk to each other over a serial cable and over a cross link Ethernet cable (for redundancy, serial cable or Ethernet cable may fail) and check each others heartbeat.
The program to monitor the heartbeats of the cluster nodes is called... guess...heartbeat.
heartbeat is available at http://www.linux-ha.org/download/
The program for ip address take over is called fake and is integrated in heartbeat.

#
What about data integrity issues
When service httpd moves from node1 to node2 it does not see the same data. I loose all the files that I was creating with my httpd CGI's.

Two Answers:
1. You should never write to file from your CGI's. (use a network database instead.. MySQL is pretty good)
2. You can attach the two nodes to a central external SCSI storage, and make sure that only one is talking to it at one time, and also make sure that you change the SCSI id of the host card on machine a to 6 and leave on machine b 7 or vice -versa.

You can run GFS (Global File System, see below in resources) over FC which allows you to have transparent access to the storage from all machines as if they were local storage.

#
What about active/active cluster

You can easily build an Active/Active server if you have a good storage system that allows concurrent access.
Examples are Fibrechannel and GFS.

If you are content with Network filesystems such as NFS, you may use that, but I would not suggest that.

Anyway, you can map serviceA to clustnode1 and serviceB to clustnode2 example of my haresource file

clustnode2 172.23.2.13 mysql
clustnode1 172.23.2.14 ldap
clustnode2 172.23.2.15 cyrus

I use GFS for storage so I don't have a problem with concurrent access to data and can run as many services as is manageable by these machines.
Here clustnode2 is the master for mysql and cyrus which clustnode1 is the master for ldap.
If clustnode2 goes down then clustnode1 takes over all the ip addresses and the services.

Wednesday, October 20, 2010

Advantages of Ethernet Tunneling through PCI Express

There are many advantages to tunneling Ethernet packets through PCIe, including:

1. PCIe has higher bandwidth than Ethernet (64 Gbps today vs. 10 Gbps);
2. PCIe has lower latency compared to any other protocol;
3. PCIe has the lowest per port pricing (1/10) compared to any higher-level protocol;
4. Ethernet tunneling saves power and cost; and
5. Ethernet tunneling uses the same software stack protecting software investment.

These advantages are compelling.

以上文字擷取自以下網址
http://www.wwpi.com/index.php?option=com_content&view=article&id=6540:ethernet-tunneling-through-pci-express-inter-processor-communication-low-latency-storage-io&catid=99:cover-story&Itemid=2701018

Saturday, March 06, 2010

spew - measures I/O performance and/or generates I/O load

無意間找到一個軟體
http://spew.berlios.de/
看起來應該是可以用來測試 I/O performance
有空再來試試看, 先把網址記起來免得忘記了