RHEL7.2 Server作NFS服務,
1,yum -y install nfs-utils rpcbind
2,mkdir -p /u01/dbbackupset/10.2.21.337_tradb
3,cat /etc/exports
/u01/dbbackupset/10.1.21.437_tradb 10.1.21.437(rw,sync,no_root_squash)
參數值 內容說明
rw ro 該目錄分享的權限是可擦寫 (read-write) 或只讀 (read-only),但最終能不能讀寫,仍是與文件系統的 rwx 及身份有關。sql
sync async sync 表明數據會同步寫入到內存與硬盤中,async 則表明數據會先暫存於內存當中,而非直接寫入硬盤!服務器
no_root_squash root_squash 客戶端使用 NFS 文件系統的帳號若爲 root 時,系統該如何判斷這個帳號的身份?預設的狀況下,客戶端 root 的身份會由 root_squash 的設定壓縮成 nfsnobody, 如此對服務器的系統會較有保障。但若是你想要開放客戶端使用 root 身份來操做服務器的文件系統,那麼這裏就得要開 no_root_squash 才行!oracle
all_squash 不論登入 NFS 的使用者身份爲什麼, 他的身份都會被壓縮成爲匿名用戶,一般也就是 nobody(nfsnobody) 啦!async
anonuid anongid anon 意指 anonymous (匿名者) 前面關於 *_squash 提到的匿名用戶的 UID 設定值,一般爲 nobody(nfsnobody),可是你能夠自行設定這個 UID 的值!固然,這個 UID 必須要存在於你的 /etc/passwd 當中! anonuid 指的是 UID 而 anongid 則是羣組的 GID 囉。ide
4,exportfs -r
5,systemctl start nfs-server
systemctl start rpcbindui
客戶端設置
1,yum -y install nfs-utils
2,mkdir -p /home/oracle/nfs
3,mount -t nfs 10.1.21.388:/u01/dbbackupset/10.1.21.437_tradb /home/oracle/nfs
4,df -h
5,showmount -e 10.1.21.388日誌
可是最近幾天發現備份有異常,備份集未能正常產生,備份是好幾天前的。。。。
查看messages日誌
[root@reco yum.repos.d]# cat /var/log/messages |grep -i nfs
Dec 23 12:30:10 reco nfsdcltrack[158892]: sqlite_insert_client: insert statement prepare failed: table clients has 2 columns but 3 values were supplied
Dec 24 12:30:11 reco nfsdcltrack[98236]: sqlite_insert_client: insert statement prepare failed: table clients has 2 columns but 3 values were supplied
Dec 25 12:30:11 reco nfsdcltrack[37515]: sqlite_insert_client: insert statement prepare failed: table clients has 2 columns but 3 values were supplied
Dec 26 12:20:10 reco nfsdcltrack[172228]: sqlite_insert_client: insert statement prepare failed: table clients has 2 columns but 3 values were supplied
Dec 26 12:30:12 reco nfsdcltrack[173152]: sqlite_insert_client: insert statement prepare failed: table clients has 2 columns but 3 values were supplied
Dec 26 21:03:02 reco nfsdcltrack[25152]: sqlite_insert_client: insert statement prepare failed: table clients has 2 columns but 3 values were supplied
Dec 26 21:05:53 reco nfsdcltrack[25341]: sqlite_insert_client: insert statement prepare failed: table clients has 2 columns but 3 values were suppliedcode
而後在客戶端發現目錄已經掉了,覺得手工mount一次就好,次日現象重現
通過一系列的排查發現應該是nfs的bug所致,RHEL7.2中關於nfs 1.3.0-0.21.el7
https://bugzilla.redhat.com/show_bug.cgi?id=1285097server
[root@reco dbbackupset]# uname -a
Linux reco 3.8.13-98.7.1.el7uek.x86_64 #2 SMP Wed Nov 25 13:51:41 PST 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@reco dbbackupset]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
[root@reco dbbackupset]# rpm -qa|grep nfs
libnfsidmap-0.25-12.el7.x86_64
nfs-utils-1.3.0-0.21.el7.x86_64sqlite
遂對當前NFS服務器進行升級操做
[root@reco yum.repos.d]# yum install nfs-utils
[root@reco yum.repos.d]# rpm -qa | grep nfs
nfs-utils-1.3.0-0.61.el7.x86_64
libnfsidmap-0.25-12.el7.x86_64
目標端的服務升級,客戶端想重啓一下rpc服務,咱們先看一下rpc服務的狀態。
[root@acdb1 ~]# systemctl status rpcbind
● rpcbind.service - RPC bind service
Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; indirect; vendor preset: enabled)
Active: inactive (dead)
竟然已經掛掉了
[root@acdb1 ~]# systemctl start rpcbind
You have new mail in /var/spool/mail/root
[root@acdb1 ~]# systemctl status rpcbind
● rpcbind.service - RPC bind service
Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; indirect; vendor preset: enabled)
Active: active (running
) since Thu 2018-12-27 10:55:26 CST; 3s ago
Process: 160478 ExecStart=/sbin/rpcbind -w ${RPCBIND_ARGS} (code=exited, status=0/SUCCESS)
Main PID: 160479 (rpcbind)
CGroup: /system.slice/rpcbind.service
└─160479 /sbin/rpcbind -w
Dec 27 10:55:26 acdb1 systemd[1]: Starting RPC bind service...
Dec 27 10:55:26 acdb1 systemd[1]: Started RPC bind service.
[root@acdb1 ~]# showmount -e 10.1.11.188
Export list for 10.1.21.388:
/u01/dbbackupset/10.1.21.369_acdb 10.1.21.369
貌似問題得以解決,NFS仍是不少鍋,但願明天備份正常進行。