7月 17th, 2008 由 傻仔仔 發表 於 09:07 pm
在這個web 2.0的系統中遇到了第一個問題,如果想讓更多的web靜態內容服務器一起工作,為了節省存儲必然讓更多的web服務器使用相同的存儲。
比如圖片
圖片是靜態內容,有如下需求:
1, 需要集中存儲,也就是對服務的需求者,只有一個統一的接口。
2, 圖片需要的存儲比較大。
3, 要穩定,文件不能丟失。
根據上述要求我們可以採用如下模式:
Web Server可以使用眾多的網絡協議來使用File Server上的文件,可以是NFS或是CIFS,甚至可以是SAN(當然,這東東比較貴的說)。但是為了滿足上面提出的3個要求,我更傾向于用分布式文件來取代File Server。
MogileFS就是這樣一種系統。
MogileFS利用多個有自己的計算資源的靜態服務器來分區存儲並管理它們的一個分布式文件系統。
特點:
應用層,沒有特殊的內核組件要求
無單點失敗 MogileFS啟動的三個組件(存儲節點、跟蹤器、跟蹤用的數據庫),可運行在多個機器上,因此沒有單點失敗。(你也可以將跟蹤器和存儲節點運行在同一台機器上,這樣你就沒有必要用4台機器)推薦至少兩台機器自動的文件復制 文件是基于他們的”類”, 文 件可以自動的在多個存儲節點上復制,這是為了盡量少的復制,才使用”類”的。假如你的圖片站點有 三份JPEG圖片的拷貝,但實際只有1or2份拷貝,那麼Mogile可以重新建立遺失的拷貝。用這種辦法,MogileFS(不做RAID)可以節約 在磁盤,否則你將存儲同樣的拷貝多份,完全沒有必要” “比RAID好” 在一個非存儲區域網絡的RAID(non-SAN RAID)的建立中,磁盤是冗餘的,但主機不是,如果你整個機器壞了,那麼文件也將不能訪問。 MogileFS在不同的機器之間進行文件復制,因此文件始終是可用的 傳輸中立,無特殊協議 MogileFS客戶端可以通過NFS或HTTP來和MogileFS的存儲節點來通信,但首先需要告知跟蹤器一下。
簡單的命名空間 文件通過一個給定的key來確定,是一個全局的命名空間。你可以自己生成多個命名空間,只要你願意,但是這樣可能在同一MogileFS中,會造成衝突key。
不用共享任何東西 MogileFS不需要依靠昂貴的SAN來共享磁盤,每個機器只用維護好自己的磁盤。
不需要RAID 在MogileFS中的磁盤可以是做了RAID的也可以是沒有,如果是為了安全性著想的話RAID沒有必要買了,因為MogileFS已經提供了。
不會碰到文件系統本身的不可知情況 在MogileFS中的存儲節點的磁盤可以被格式化成多種格式(ext3,reiserFS等等)。MogilesFS會做自己內部目錄的哈希,所以它不會碰到文件系統本身的一些限制,比如一個目錄中的最大文件數。你可以放心的使用。
6月 24th, 2008 由 傻仔仔 發表 於 10:06 am
以filezilla 2.2 登入 vsftpd 的ftp server 會出現以下錯誤,能成功登入但不能取得目錄列表。
錯誤: 無法開啟傳輸通道。回應:連線嘗試失敗,因為連線對象有一段時間並未正確回應,或是連線建立失敗,因為連線的主機無法回應。
錯誤: 無法取得目錄列表!
無論在vsftpd 中做任何的設定,也解決不到。
但其實只要把filezilla 2.2 升級為3.0版本,問題就能解決。
DownLoad Link : http://filezilla-project.org/download.php
6月 2nd, 2008 由 傻仔仔 發表 於 01:06 am
先下載 安裝檔。
wget -c http://download3.vmware.com/software/vmserver/VMware-server-1.0.6-91891.tar.gz
另外安裝所要的library
sudo aptitude install build-essential linux-kernel-devel linux-headers-generic xinetd
開始安裝.
tar xf VMware-server-1.0.6-*.tar.gz
cd vmware-server-distrib
sudo ./vmware-install.pl
安裝後開啓會出現以下的錯誤
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4′ not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0′ not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4′ not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0′ not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4′ not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0′ not found (required by /usr/lib/libstdc++.so.6)
解決的方法如下
cd /usr/lib/vmware-server-console/lib/
sudo mv libpng12.so.0/libpng12.so.0 libpng12.so.0/libpng12.so.0.disabled
sudo ln -sf /usr/lib/libpng12.so.0 libpng12.so.0/libpng12.so.0
cd /usr/lib/vmware-server-console/lib/libgcc_s.so.1/
sudo mv libgcc_s.so.1 libgcc_s.so.1.disabled
sudo ln -sf /lib/libgcc_s.so.1 libgcc_s.so.1
5月 5th, 2008 由 傻仔仔 發表 於 07:05 pm
互聯網帶寬越來越寬,似乎讓網頁的加載速度得到了質的飛躍。其實不然,因為隨著帶寬的提高,網頁上的對象也越來越多,因此加快網頁打開速度還是一個 重要的課題。加快網頁的打開速度,有三個路徑,一是提高網絡帶寬,二是用戶在本機做優化,三是網站設計者對網頁做一定的優化。這篇文章站在一個網站設計者 的角度,分享一些優化網頁加載速度的小技巧。

一、優化圖片
幾乎沒有哪個網頁上是沒有圖片的。如果你經歷過56K貓的年代,你一定不會很喜歡有大量圖片的網站。因為加載那樣一個網頁會花費大量的時間。
即使在現在,網絡帶寬有了很多的提高,56K貓逐漸淡出,優化圖片以加快網頁速度還是很有必要的。
優化圖片包括減少圖片數、降低圖像質量、使用恰當的格式。
1、減少圖片數:去除不必要的圖片。
2、降低圖像質量:如果不是很必要,嘗試降低圖像的質量,尤其是jpg格式,降低5%的質量看起來變化不是很大,但文件大小的變化是比較大的。
3、使用恰當的格式:請參閱下一點。
因此,在上傳圖片之前,你需要對圖片進行編輯,如果你覺得photoshop太麻煩,可以試試一些在線圖片編輯工具。懶得編輯而又想圖片有特殊的效果?可以試試用過調用javascript來實現圖片特效。
二、圖像格式的選擇
一般在網頁上使用的圖片格式有三種,jpg、png、gif。三種格式的具體技術指標不是這篇文章探討的內容,我們只需要知道在什麼時候應該使用什麼格式,以減少網頁的加載時間。
1、JPG:一般用於展示風景、人物、藝術照的攝影作品。有時也用在電腦截屏上。
2、GIF:提供的顏色較少,可用在一些對顏色要求不高的地方,比如網站logo、按鈕、表情等等。當然,gif的一個重要的應用是動畫圖片。就像用Lunapic製作的倒映圖片。
3、PNG:PNG格式能提供透明背景,是一種專為網頁展示而發明的圖片格式。一般用於需要背景透明顯示或對圖像質量要求較高的網頁上。
三、優化CSS
CSS疊層樣式表讓網頁加載起來更高效,瀏覽體驗也得到提高。有了CSS,表格佈局的方式可以退休了。
但有時我們在寫CSS的時候會使用了一些比較囉嗦的語句,比如這句:
margin-top: 10px;
margin-right: 20px;
margin-bottom: 10px;
margin-left: 20px;
你可以將它簡化為:
margin: 10px 20px 10px 20px;
又或者這句:
<p class=”decorated”>A paragraph of decorated text</p>
<p class=”decorated”>Second paragraph</p>
<p class=”decorated”>Third paragraph</p>
<p class=”decorated”>Forth paragraph</p>
可以用div來包含:
<div class=”decorated”>
<p>A paragraph of decorated text</p>
<p>Second paragraph</p>
<p>Third paragraph</p>
<p>Forth paragraph</p>
</div>
簡化CSS能去除冗余的屬性,提高運行效率。如果你寫好CSS後懶得去做簡化,你可以使用一些在線的簡化CSS工具,比如CleanCSS。
四、網址後加斜槓
有些網址,比如”www.kenengba.com/220“,當服務器收到這樣一個地址請求的時候,它需要花費時間去確定這個地址的文件類型。如果220是一個目錄,不妨在網址後多加一個斜槓,讓其變成www.kenengba.com/220/,這樣服務器就能一目瞭然地知道要訪問該目錄下的index或default文件,從而節省了加載時間。
五、標明高度和寬度
這點很重要,但很多人由於懶惰或其它原因,總是將其忽視。當你在網頁上添加圖片或表格時,你應該指定它們的高度和寬度,也就是height和 width參數。如果瀏覽器沒有找到這兩個參數,它需要一邊下載圖片一邊計算大小,如果圖片很多,瀏覽器需要不斷地調整頁面。這不但影響速度,也影響瀏覽 體驗。
下面是一個比較友好的圖片代碼:
<img id=”moon” height=”200″ width=”450″ src=”http://www.kenengba.com/moon.png” alt=”moon image” />
當瀏覽器知道了高度和寬度參數後,即使圖片暫時無法顯示,頁面上也會騰出圖片的空位,然後繼續加載後面的內容。從而加載時間快了,瀏覽體驗也更好了。
六、減少http請求
當瀏覽者打開某個網頁,瀏覽器會發出很多對像請求(圖像、腳本等等),視乎網絡延時情況,每個對象加載都會有所延遲。如果網頁上對像很多,這可以需要花費大量的時間。
因此,要為http請求減負。如何減負?
1、去除一些不必要的對象。
2、將臨近的兩張圖片合成一張。
3、合併CSS
看看下面這段代碼,需要加載三個CSS:
<link rel=”stylesheet” type=”text/css” href=”/body.css” />
<link rel=”stylesheet” type=”text/css” href=”/side.css” />
<link rel=”stylesheet” type=”text/css” href=”/footer.css” />
我們可以將其合成一個:
<link rel=”stylesheet” type=”text/css” href=”/style.css” />
從而減少http請求。
七、其它小技巧(譯者添加)
1、去除不必要加載項。
2、如果在網頁上嵌入了其它網站的widget,如果有選擇餘地,一定要選擇速度快的。
3、盡量用圖片代替flash,這對SEO也有好處。
4、有些內容可以靜態化就將其靜態化,以減少服務器的負擔。
5、統計代碼放在頁尾。
本文編譯自Daily Blog Tips,內容有刪改。
原文地址:http://www.kenengba.com/post/435.html
4月 30th, 2008 由 傻仔仔 發表 於 10:04 am
This tutorial will explain how to remove domain controller from your network.Procedure to follow
On the last domain controller in the domain, click Start, and then click Run.
In Open, type dcpromo to open the Active Directory Installation Wizard, and then click Next.
On the Remove Active Directory page, select the This server is the last domain controller in the domain check box, and then continue to follow the wizard.
Caution
• Removing a domain will result in the permanent loss of any data contained in that domain. This includes all user, group, and computer accounts.
Useful Notes
• To perform this procedure, you must be a member of the Domain Admins group (in the forest root domain) or the Enterprise Admins group in Active Directory, or you must have been delegated the appropriate authority. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.
• To remove an Active Directory domain, you must first demote all other domain controllers associated with the domain. For information about demoting domain controllers.
• If the domain has child domains, it cannot be deleted.
• If this is the last domain in the forest, demoting this domain controller will also delete the forest.
• If the domain controller currently holds the domain naming master or schema master operations roles, transfer the role to domain controller in a different domain before removing the domain. For information about locating operations masters and transferring operations master roles.
• If the domain controller holds the last replica of one or more application directory partitions, you must first remove the last application directory partition replicas from the domain controller before you can delete the domain. You can use the Active Directory Installation Wizard to remove all application directory partition replicas from the domain controller or you can manually remove the partitions using the Ntdsutil command-line tool.