半套DRBL設定優化

以前的文章 [轉貼]NFS優化 、電腦教室bonding+drbl+fscache半套DRBL:nis+nfs

因為新的電腦教室學生機使用 SSD 硬碟,原本 DRBL 系統開機速度比較起來就慢了非常多,所以就想:Linux系統就給學生機的SSD開啟,只要 /home 掛載到 DRBL 主機上,帳號管理使用 NIS ,這樣開機及程式開啟速度應該會快很多吧!

DRBL 主機設定好,學生機也只要完成一台,就能使用學生機內建的還原卡派送給整間教室,應該不會太麻煩。

DRBL 主機使用我自製的 LMDE3_LTH_181005 ,因為感覺 Debian 當伺服器比較穩,除了內建的網路卡外,加裝了一張4ports的網卡,但我使用 BONDING 結構來玩,而且原本電腦教室就有 DHCP 分配,所以全部網路5ports都來拿當 NIS + NFS 了。

學生機我使用我自製的 xubuntu1804LTH_181005 ,需要設定 /home 到 NFS 主機,以及 NIS client 端,因為硬碟是SSD,還要加上專門針對 SSD 的設定。

DRBL 主機設定:

1.BONDING 參考https://wiki.debian.org/Bonding

apt install ifenslave

在 /etc/modules 加入 bonding

修改 /etc/network/interfaces

# 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
auto bond0
iface bond0 inet static
address 172.16.36.52
netmask 255.255.252.0
gateway 172.16.39.254
bond-mode 6
bond-slaves enp3s0f0 enp3s0f1 enp4s0f0 enp4s0f1
bond-miimon 100
bond-downdelay 400
bond-updelay 800
auto eno1
iface eno1 inet manual
bond-master bond0
auto enp3s0f0
iface enp3s0f0 inet manual
bond-master bond0
auto enp3s0f1
iface enp3s0f1 inet manual
bond-master bond0
auto enp4s0f0
iface enp4s0f0 inet manual
bond-master bond0
auto enp4s0f1
iface enp4s0f1 inet manual
bond-master bond0

記得關閉 network-manager 服務,指令systemctl disable NetworkManager 或 systemctl disable network-manager
參考https://wiki.debian.org/systemd

 


 

2.安裝DRBL ,參考http://drbl.nchc.org.tw/one4all/desktop/

 


 

3.設定DRBL(會開啟NIS+NFS服務)

我的drblpush.conf 

#Setup for general
[general]
domain=drbld.rsps.kh.edu.tw
nisdomain=drbld
localswapfile=yes
client_init=graphic
login_gdm_opt=login
timed_login_time=
maxswapsize=0 (學生機是SSD硬碟,不打算開swap)
ocs_img_repo_dir=/clonezilla
total_client_no=50
create_account=
account_passwd_length=8
hostname=drbld-
purge_client=no
client_autologin_passwd=
client_root_passwd=
client_pxelinux_passwd=
set_client_system_select=yes
use_graphic_pxelinux_menu=yes
set_DBN_client_audio_plugdev=yes
open_thin_client_option=no
client_system_boot_timeout=70
language=zh_TW.UTF-8
set_client_public_ip_opt=no (電腦教室本來就由防火牆分配虛擬IP)
config_file=drblpush.conf
collect_mac=
run_drbl_ocs_live_prep=yes
drbl_ocs_live_server=
clonezilla_mode=full_clonezilla_mode
live_client_branch=alternative
live_client_cpu_mode=i386
drbl_mode=drbl_ssi_mode
drbl_server_as_NAT_server=no (我的 DRBL 主機不用對外,學生直接連到防火牆)
add_start_drbl_services_after_cfg=yes
continue_with_one_port=y
#Setup for bond0
[bond0]
interface=bond0
range=1-51 (要確定防火牆分配的網段)
gateway=172.16.39.254

3.調整NIS,讓學生機帳號有聲音

因為半套 DRBL 的 NIS 預設無法讓學生登入時,擁有 audio 群組權限,所以我參考 https://help.ubuntu.com/community/SettingUpNISHowTo

修改 /var/yp/Makefile ,將 MINGID=1000 改成 MINGID=19 ,然後執行 make -C /var/yp

 


 

4.優化NFS,使反應速度加快

原始設定的NFS反應速度很差,參考 https://eric0703.pentaxfans.net/2558

修改 /etc/sysctl.conf 加入以下這幾行 (影響的資料夾在 /proc/sys/vm/)

 

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 = 1
vm.dirty_ratio = 2
vm.dirty_writeback_centisecs = 100
vm.dirty_expire_centisecs = 1000

 

啟動 DRBL 服務之後,就完成主機方面的設定。

 


 

學生機設定:

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