電腦教室bonding+drbl+fscache

最近要在電腦教室使用mint18mate桌面安裝DRBL無碟環境,

一開始參考DRBL官方網站的安裝 http://drbl.nchc.org.tw/one4all/desktop/,修改/etc/network/interfaces,並且安裝環境,

drbl建議架構

(圖片來自鳥哥的私房菜)

安裝drbl過程中,我移除了幾個套件apt-get purge mintupdate mintupload mintinstall gparted mate-screensaver-common virtualbox-* network-manager* gnome-keyring cinnamon-session

但是,這間電腦教室的switch雖然是giga網速的,但數量卻是24port x 2台。

第一次,用鎖定學生電腦MAC address的方式,一台switch使用2個網域,但是效能太差;

第二次,一樣鎖定MAC,改用主機一張網卡負責20台電腦,主機其中2張網卡負擔太重,剩下2張網卡閒置,也不理想。

之後,在鳥哥的私房菜看到『透過 Linux bonding 技術合併多張網卡的頻寬』http://linux.vbird.org/linux_enterprise/0110network.php#server_bonding

1.設定bonding 參考 http://maxubuntu.blogspot.tw/2012/10/6-nic-bonding-debain-gnulinux.html

 

apt-get install ifenslave

修改/etc/network/interfaces,伺服器有5張網卡,每2張各用一組bonding mode6,剩下那張對外(PS:這台主機使用auto會出問題,所以改成allow-hotplug )

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback

allow-hotplug enp1s0f0
iface enp1s0f0 inet manual
bond-master bond0
bond-primary enp1s0f0

allow-hotplug enp1s0f1
iface enp1s0f1 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.100.254
netmask 255.255.255.0
bond-mode 6
bond-miimon 100
bond-slaves enp1s0f0 enp1s0f1

allow-hotplug enp1s0f2
iface enp1s0f2 inet manual
bond-master bond1
bond-primary enp1s0f2

allow-hotplug enp1s0f3
iface enp1s0f3 inet manual
bond-master bond1

auto bond1
iface bond1 inet static
address 192.168.101.254
netmask 255.255.255.0
bond-mode 6
bond-miimon 100
bond-slaves enp1s0f2 enp1s0f3

allow-hotplug eno1
iface eno1 inet dhcp

然後,重新啟動網路,應該就能完成bonding

2.加強NFS效能

a.參考http://eric0703.pentaxfans.net/2558,修改/etc/default/nfs-kernel-server,將RPCNFSDCOUNT 設大,我的伺服器最高好像只能設到RPCNFSDCOUNT=82

b.修改 /etc/sysctl.conf,加入以下這幾行

net.core.wmem_max=16777216
net.core.rmem_max=16777216
net.ipv4.tcp_rmem= 10240 873800 16777216
net.ipv4.tcp_wmem= 10240 873800 16777216
vm.dirty_background_ratio = 2
vm.dirty_ratio = 2
vm.dirty_writeback_centisecs = 100
vm.dirty_expire_centisecs = 1000

 

c.參考https://blog.breunig.xyz/2013/10/13/setting-up-nfs-cache-on-debian.html,安裝fscache

 

apt-get install cachefilesd

 

修改/etc/default/cachefilesd,改RUN=yes,啟動fscache。

 

d.修改drbl設定,讓學生機掛載NFS時,加入fsc參數

修改/etc/drbl/drbl.conf ,尋找並修改成

 

# Extra options for NFS client in /etc/fstab
nfs_client_extra_opt=”fsc

 

 

3.重新安裝DRBL。

 

分類: server。這篇內容的永久連結