Job nfs-server.service/start failed with result ‘dependency’

丁钟展
2023-12-01

NFS 服务器服务无法从以下错误启动

# systemctl status nfs-server.service
nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Sep 16 12:41:22 host01 systemd[1]: Dependency failed for NFS server and services.
Sep 16 12:41:22 host01 systemd[1]: Job nfs-server.service/start failed with result 'dependency'.
Sep 16 12:42:00 host01 systemd[1]: Dependency failed for NFS server and services.
Sep 16 12:42:00 host01 systemd[1]: Job nfs-server.service/start failed with result 'dependency'.
Sep 16 12:44:23 host01 systemd[1]: Dependency failed for NFS server and services.
Sep 16 12:44:23 host01 systemd[1]: Job nfs-server.service/start failed with result 'dependency'.
Sep 16 12:48:12 host01 systemd[1]: Dependency failed for NFS server and services.
>Sep 16 12:48:12 host01 systemd[1]: Job nfs-server.service/start failed with result 'dependency'.

查看系统日志文件/var/log/message显示以下错误:

/var/log/messages:Sep 30 05:41:25 host01 systemd: Starting Preprocess NFS configuration...
/var/log/messages:Sep 30 05:41:25 host01 systemd: Mounting NFSD configuration filesystem...
/var/log/messages:Sep 30 05:41:25 host01 systemd: Started Preprocess NFS configuration.
/var/log/messages:Sep 30 05:41:25 host01 systemd: Starting NFSv4 ID-name mapping service...
/var/log/messages:Sep 30 05:41:25 host01 systemd: Starting NFS status monitor for NFSv2/3 locking....
/var/log/messages:Sep 30 05:41:25 host01 systemd: Started NFSv4 ID-name mapping service.
/var/log/messages:Sep 30 05:41:25 host01 systemd: Started NFS status monitor for NFSv2/3 locking..
/var/log/messages:Sep 30 05:41:25 host01 kernel: Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
/var/log/messages:Sep 30 05:41:25 host01 kernel: [<ffffffffc0623192>] ? ftrace_define_fields_nfsd_stateid_class+0xc6/0xc6 [nfsd]
/var/log/messages:Sep 30 05:41:25 host01 kernel: [<ffffffffc0623192>] ? ftrace_define_fields_nfsd_stateid_class+0xc6/0xc6 [nfsd]
/var/log/messages:Sep 30 05:41:25 host01 kernel: [<ffffffffc05d8b22>] nfsd_reply_cache_init+0xa2/0x100 [nfsd]
/var/log/messages:Sep 30 05:41:25 host01 kernel: [<ffffffffc06231f0>] init_nfsd+0x5e/0xe6e [nfsd]
/var/log/messages:Sep 30 05:41:25 host01 kernel: nfsd: failed to allocate reply cache
/var/log/messages:Sep 30 05:41:25 host01 mount: mount: unknown filesystem type 'nfsd'
/var/log/messages:Sep 30 05:41:25 host01 systemd: proc-fs-nfsd.mount mount process exited, code=exited status=32
/var/log/messages:Sep 30 05:41:25 host01 systemd: Failed to mount NFSD configuration filesystem.
/var/log/messages:Sep 30 05:41:25 host01 systemd: Dependency failed for NFS server and services.
/var/log/messages:Sep 30 05:41:25 host01 systemd: Dependency failed for NFS Mount Daemon.
/var/log/messages:Sep 30 05:41:25 host01 systemd: Job nfs-mountd.service/start failed with result 'dependency'.
/var/log/messages:Sep 30 05:41:25 host01 systemd: Job nfs-server.service/start failed with result 'dependency'.
/var/log/messages:Sep 30 05:41:25 host01 systemd: Unit proc-fs-nfsd.mount entered failed state.

诊断

Module nfsd is not loaded to the running kernel.
# lsmod |grep -i nfsd |wc -l
0

解决方案

安装新内核后,系统未重新启动。但是,重新启动系统后问题仍然存在。

1,检查正在运行的内核的所有模块。

# depmod -a

2,确保当前内核已经添加模块nfsd

# modprobe nfsd

3,验证nfsd模块

# modinfo nfsd
# lsmod |grep nfsd

4,启动 nfs.server服务并检查状态。

# systemctl start nfs-server.service
# systemctl status nfs-server.service

原因

Module nfsd is not added to the running kernel.
 类似资料:

相关阅读

相关文章

相关问答