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

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'

#cat /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

解决方案

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.

原创文章,作者:保哥运维实战侠笔记,如若转载,请注明出处:https://www.shizhanxia.com/biji/374.html

发表评论

登录后才能评论