山猪的博客-贪吃狗咖喱 山猪的博客-贪吃狗咖喱
首页
  • 操作系统
  • 数据库
  • 其他运维笔记
  • Python
  • Java
  • 其他开发笔记
  • 技术文档
  • GitHub技巧
  • Apache NiFi
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
  • 网站
  • 资源
  • Vue资源
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Shicong Zhou

ISTJ的IT男
首页
  • 操作系统
  • 数据库
  • 其他运维笔记
  • Python
  • Java
  • 其他开发笔记
  • 技术文档
  • GitHub技巧
  • Apache NiFi
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
  • 网站
  • 资源
  • Vue资源
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 操作系统

    • Linux firewalld
    • Ubuntu防火墙 ufw管理
    • CentOS7修改主机名的三种方法
    • Linux find命令
    • Ubuntu开机卡GRUB
    • Ubuntu NFS服务无法启动
    • Linux时间设置
  • 数据库

  • 运维
  • 操作系统
Zhou
2024-02-22

Ubuntu NFS服务无法启动

# Ubuntu NFS服务无法启动

尝试启动 nfs-kernel-server​ 服务时失败,具体报错信息显示 nfs-server.service​ 的任务被取消。

ubuntu@ubuntu-nfs:~$ sudo /etc/init.d/nfs-kernel-server start
[....] Starting nfs-kernel-server (via systemctl): nfs-kernel-server.serviceJob for nfs-server.service canceled.
 failed!
1
2
3

检查 <span style="font-weight: bold;" data-type="strong">nfs-kernel-server</span> 服务的状态

以获取更详细的错误信息。可以使用以下命令:

sudo systemctl status nfs-kernel-server
1

​image​

根据日志信息,nfs-server.service​ 启动失败的原因是 rpc.nfsd​ 进程无法成功写入内核,报错“Connection refused”(连接被拒绝),并且无法为 nfsd​ 设置任何套接字。这通常指示底层网络服务或依赖服务(如 rpcbind​ 或 portmap​)没有正确启动或配置,导致 nfsd​ 无法正常通信。

‍

检查并启动 rpcbind​ 服务:

nfs-server​ 依赖于 rpcbind​ 服务,确保 rpcbind​ 服务正在运行。可以使用以下命令来检查并启动 rpcbind​ 服务:

ubuntu@ubuntu-nfs:~$ sudo systemctl status rpcbind
● rpcbind.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)
ubuntu@ubuntu-nfs:~$ sudo systemctl start rpcbind
Failed to start rpcbind.service: Unit rpcbind.service is masked.
1
2
3
4
5
6

unmaskrpcbind​ 服务,并启动

ubuntu@ubuntu-nfs:~$ sudo systemctl unmask rpcbind
Removed /etc/systemd/system/rpcbind.service.
ubuntu@ubuntu-nfs:~$ sudo systemctl start rpcbind
ubuntu@ubuntu-nfs:~$ sudo systemctl status rpcbind
● rpcbind.service - RPC bind portmap service
   Loaded: loaded (/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2024-02-22 01:49:48 UTC; 2s ago
     Docs: man:rpcbind(8)
 Main PID: 27265 (rpcbind)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/rpcbind.service
           └─27265 /sbin/rpcbind -f -w
1
2
3
4
5
6
7
8
9
10
11
12

‍

再次尝试启动nfs-server​,成功启动。

‍

‍

重新导出NFS共享:在对NFS配置进行任何更改后,应重新导出共享。可以使用命令:

sudo exportfs -ra
1

‍

编辑 (opens new window)
#Area/Linux
上次更新: 2024/02/23, 06:03:27
Ubuntu开机卡GRUB
Linux时间设置

← Ubuntu开机卡GRUB Linux时间设置→

最近更新
01
Linux时间设置
02-23
02
Ubuntu开机卡GRUB
02-22
03
Apache NiFi2.0 安装
02-18
更多文章>
Theme by Vdoing | Copyright © 2023-2024 Shicong Zhou | 浙ICP备2023040288号-1 | 浙ICP备2023040288号 | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式