xx-xx-patch:~ # vi /etc/sysconfig/nfs #打开这个文件,找到MOUNTD_PORT并设置端口值
# Only set this if you want to start mountd on a fixed
# port instead of the port assigned by rpc. Only for use
# to export nfs-filesystems through firewalls.
#
MOUNTD_PORT="2050"
2.nlockmgr(注意, 这一步需要reboot才能生效)
1
2
3
4
5
xx-xx-patch:~ # ls /etc/modprobe.d/lockd #查看这个文件是否存在,不存在就创建。
/etc/modprobe.d/lockd
bj-ct-patch:~ # cat /etc/modprobe.d/lockd # 文件内容主需要更改成自己想要设置的端口即可。
#This file is created for the static port for locked, should work on SUSE 11.0
options lockd nlm_udpport=2052 nlm_tcpport=2052
3. status,虽然failed, 还是把方法share一下,万一有成功的呢...
1
2
3
4
5
6
7
8
9
10
xx-xx-patch:~ # vi /etc/init.d/nfsserver
#找到该文件/etc/init.d/nfsserver并打开。
#在文件里找到如下内容的行,加上-p2051,2051 请更改成自己想要的端口号。
# rpc.statd
#Add -p2051 for the static port as BTP firewall rule on 24th,Nov 2016
echo -n " statd"
startproc /usr/sbin/rpc.statd --no-notify -p2051 || {
rc_status -v
rc_exit
}