Linux 掛載nfs , cifs (smb) 讓 restic 備份, 遇到備份效率緩慢問題

我已經使用 restic 做離線備份半年了 , 效果還不錯, 但是遇到掛載nfs的資料, 效率就有點差了,
當然備份效率差的原因之一, 是我暴力備份docker or podman 裡面storage 資料, 那邊檔案超級多, 又是透過 nfs 方式備份, 就算restic 每次只做差異性, 還是很慢.

後來想想, 我的虛擬伺服器 proxmox ve 也有遇到掛載nfs效率問題, 解法就是使用soft link, 所以自己使用mount指令掛載nfs應該也是可以改用soft方式, 以下列出一些心得

  • cifs 掛載可用cache=loose
mount -t cifs -o username=xxx,password=xxx,domain=yyy,ro,cache=loose  ...
  • nfs 可用soft
mount -t nfs -o ro,soft ...
#查看
nfsstat -m

升級mail server不支援TLS 1.0 , 1.1的問題

postfix 出現以下錯誤

SSL routines:tls_early_post_process_client_hello:unsupported protocol

我不知道如何處理, 爬文說要改成向下相容… 我才不要勒

vi /etc/crypto-policies/back-ends/opensslcnf.config
#改成
#MinProtocol = TLSv1.2
MinProtocol = TLSv1
MaxProtocol = TLSv1.3

vi /etc/postfix
#確認沒有被限制
# Disable SSLv2, SSLv3, TLSv1, TLSv1.1
#smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
#smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
#smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
#smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1

Rocky Linux 安裝httpd 反向代理

真是被selinux搞死,但,咱們工程師, 就是要勇往直前

RL9 安裝httpd後, 若要啟用proxy , reverse 功能 , 目前我遇到要改兩點

  • 修改httpd設定, 把心跳這一行mark起來
    vi /etc/httpd/conf.modules.d/00-proxy.conf
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
  • selinux 啟用連線功能
sudo setsebool -P httpd_can_network_connect 1
#2023/6/20 否則會出現 Permission denied: AH00957 錯誤

自製郵件伺服器啟動腳本

我用自製的docker版郵件伺服器已經一陣子了, 每次要組合出腳本很麻煩, 我又不喜歡用yaml文件, 因此利用github的免費pages, 自己寫了一個簡易自動產生腳本的網頁, 還滿方便的, 頁面難看就請多包涵.

https://williamfromtw.github.io/docker-Postfix-AD/genLaunchCommand.html

Rocky Linux 9安裝let’s Encrypt

dnf install certbot
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload
# 申請mail.test.com 憑證
systemctl stop httpd
certbot certonly --standalone --preferred-challenges http -d  mail.test.com

# 若要renew 請加到crontab
certbot renew --post-hook "systemctl restart httpd"

Rocky Linux 9 安裝podman

 dnf install podman container-tools

讓系統自動啟用podman

systemctl enable podman
systemctl enable podman-restart

修改預設儲存路徑(預設是”/var/lib/containers/storage”)

mkdir -p /podman/storage
vi /etc/containers/storage.conf

讓selinux開放使用

semanage fcontext -a -e /var/lib/containers/storage /podman/storage
restorecon -R -v /podman/storage/

將新的podman storage綁定到原本的/var/lib/container

mount -o bind /podman/storage/ /var/lib/containers
#上面指令綁定,若確認成功,改成開機就綁定
vi /etc/fstab
/podman/storage/ /var/lib/containers bind bind 0 0

重開機,或下指令讓podman 跑起來

systemctl start podman

查看修改的路徑是否生效

podman info

Rocky Linux 9 minimal 安裝後,必須額外安裝的套件

有遇到就加在這裡

#找semanage成是在哪個套件
dnf provides semanage 
dnf install policycoreutils-python-utils
#epel
dnf install epel-release
# CRB
dnf config-manager --enable crb
# net tools include ifconfig
dnf install net-tools
# httpd mod_ssl
dnf install httpd mod_ssl
# git
dnf install git
# sshpass (remote command by ssh )
dnf install sshpass

RockyLinux 9 簡易安裝 mariadb

好久沒安裝mysql了, 我之前都是docker 無腦安裝, 並不需要了解太多, 但是因為我先前安裝的 piwigo docker版本升級不利, 想說手動安裝piwigo看看, 當然第一步就是安裝mariadb囉.

這次RL9預設的mariadb是10.5, 安裝相當簡單

dnf install mariadb-server

接下來就是改密碼,預設console直接可以使用root登入

mysql -p -uroot

跟之前不一樣,我還停留mysql舊時代改密碼方式 update user set password=password(‘you password’) where user=’root’
居然失敗了, 爬了文, 反正就是跟上主流,改用oracle類似的變更方式了

alter user root@localhost identified by 'your password';
flush privileges;

很多相關設定可參考原廠文件

微軟KB5018410更新後,outlook無法透過postfix server寄信

前幾天有同仁反映無法寄信, 錯誤訊息: none of the authentication methods supported by this client are supported by your server.

經過測試, 郵件伺服器使用我自製的 container docker-postfix-ad 2.4 , 這容器基本os為centos 7.9, postfix版本為 2.10.x , 會讓outlook出現沒有適合的加密通訊協定的錯誤.

爬完文發現postfix的master.cf(submission , smtpd) 可加上 -o tls_ssl_options=NO_TICKET 解決問題, 但偏偏postfix 2.11才有此功能, 更悲催的centos 6有2.11.x版本, centos 7只有2.10.x.

現主時,我只好將自製的郵件伺服器, os改成RockyLinux 8.6, postfix 為3.x版本,
好險3.x 與 2.x 差異性不多, 基本上舊main.cf檔案只要加上以下兩行,就能用了.

#backwards-compatible default setting
append_dot_mydomain = yes
compatibility_level = 2

ps. postfix 3.x的 master.cf也不用特別加上 -o tls_ssl_options=NO_TICKET

相關的更新Windows 11 KB5018418 / Windows Server 2019 KB5018419

2022/10/19

若無法寄信,請再安裝這兩天的 win10 KB5020435 , win11 KB5020387 ,就可以解決了

1 2 3 4 5 ... 14