首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ubuntu18.04上尝试使用cachefilesd时忽略fsc选项

在ubuntu18.04上尝试使用cachefilesd时忽略fsc选项
EN

Server Fault用户
提问于 2019-04-30 04:34:07
回答 2查看 2.8K关注 0票数 1

我正在尝试在nfs共享的一个服务器上设置cachefilesd。这不管用。

服务正在运行,我的驱动器已被挂载,但似乎"fsc“选项完全被忽略了。

My fstab (为隐私和相关性而编辑的特定文件夹名称):

代码语言:javascript
复制
$ cat /etc/fstab
#                                                                                                                        
UUID=c456dea4-e0c6-42f5-a206-d0ed2e94bc6a        /                      ext4   rw,relatime,discard,data=ordered                                     0      1
UUID=693dee2e-78bb-4d4d-84e4-082328488cfe        /boot                  ext4   rw,relatime,discard,data=ordered                                     0      2
UUID=843c20a9-258a-4078-bb78-0549217623e4        none                   swap   defaults                                                             0      0
192.168.200.20:/mnt/tank/share1                  /mnt/share1            nfs4   nolock,noatime,context="system_u:object_r:httpd_sys_content_rw_t:s0" 0      0
192.168.200.20:/mnt/tank/share2                  /mnt/sub/share2        nfs4   fsc,nolock,noatime                                                   0      0
192.168.200.20:/mnt/tank/share3                  /mnt/sub/share3        nfs4   nolock,noatime                                                       0      0
192.168.200.20:/mnt/tank/share4                  /mnt/sub/share4        nfs4   fsc,nolock,noatime                                                   0      0The问题不管我做什么,甚至手动挂载股票(挂载-t -o fsc.)没有启用FSC选项:$ cat /proc/fs/nfsfs/volumes
NV SERVER   PORT DEV          FSID                              FSC
v4 c0a8c814  801 0:55         c7d8b1ef:bb64cbde                 no
v4 c0a8c814  801 0:54         d9a63e22:cc9a3fde                 no
v4 c0a8c814  801 0:57         5a567c31:75f052de                 no
v4 c0a8c814  801 0:59         1673eeb4:b0583de                  no
v4 c0a8c814  801 0:60         9acb69e2:fb267bde                 no
v4 c0a8c814  801 0:58         a367662d:5b53a6de                 no
v4 c0a8c814  801 0:61         69fdc16c:c38e18de                 no
v4 c0a8c814  801 0:63         706408fe:60f412de                 no
v4 c0a8c814  801 0:64         af123987:8f7131de                 no查看nfsstat,您可以看到fsc选项被完全忽略了:$ nfsstat -m
/mnt/sub/share4 from 192.168.200.20:/mnt/tank/share4
 Flags: rw,noatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.200.10,local_lock=none,addr=192.168.200.20

/mnt/sub/share3 from 192.168.200.20:/mnt/tank/share3
 Flags: rw,noatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.200.10,local_lock=none,addr=192.168.200.20

/mnt/share1 from 192.168.200.20:/mnt/tank/share1
 Flags: rw,noatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.200.10,local_lock=none,addr=192.168.200.20

/mnt/sub/share2 from 192.168.200.20:/mnt/tank/share2
 Flags: rw,noatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.200.10,local_lock=none,addr=192.168.200.20Troubleshooting信息服务正在运行:$ sudo systemctl status cachefilesd.service
● cachefilesd.service - LSB: CacheFiles daemon
   Loaded: loaded (/etc/init.d/cachefilesd; generated)
   Active: active (running) since Tue 2019-04-30 04:05:28 UTC; 5min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 21405 ExecStop=/etc/init.d/cachefilesd stop (code=exited, status=0/SUCCESS)
  Process: 22001 ExecStart=/etc/init.d/cachefilesd start (code=exited, status=0/SUCCESS)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/cachefilesd.service
           └─22022 /sbin/cachefilesd

Apr 30 04:05:28 orochi systemd[1]: Starting LSB: CacheFiles daemon...
Apr 30 04:05:28 orochi cachefilesd[22001]:  * Starting FilesCache daemon  cachefilesd
Apr 30 04:05:28 orochi cachefilesd[22020]: About to bind cache
Apr 30 04:05:28 orochi cachefilesd[22020]: Bound cache
Apr 30 04:05:28 orochi cachefilesd[22022]: Daemon Started
Apr 30 04:05:28 orochi cachefilesd[22001]:    ...done.
Apr 30 04:05:28 orochi systemd[1]: Started LSB: CacheFiles daemon.RUN=yes选项未注释:$ cat /etc/default/cachefilesd
# Defaults for cachefilesd initscript
# sourced by /etc/init.d/cachefilesd

# You must uncomment the run=yes line below for cachefilesd to start.
# Before doing so, please read /usr/share/doc/cachefilesd/howto.txt.gz as
# extended user attributes need to be enabled on the cache filesystem.
RUN=yes

# Additional options that are passed to the Daemon.
DAEMON_OPTS=""secctx system_u:system_r:cachefiles_kernel_t:s0选项是不可接受的(尝试过它有和没有):$ cat /etc/cachefilesd.conf
###############################################################################
#
# Copyright (C) 2006,2010 Red Hat, Inc. All Rights Reserved.
# Written by David Howells (dhowells@redhat.com)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version
# 2 of the License, or (at your option) any later version.
#
###############################################################################

dir /var/cache/fscache
tag mycache
brun 10%
bcull 7%
bstop 3%
frun 10%
fcull 7%
fstop 3%

# Assuming you're using SELinux with the default security policy included in
# this package
secctx system_u:system_r:cachefiles_kernel_t:s0在一个类似但最终无济于事的答案中,有人还包括了以下内容的输出:$ lsmod | grep cachefiles
cachefiles             45056  1
fscache                61440  3 cachefiles,nfsv4,nfs这是:$ grep CONFIG_NFS_FSCACHE /boot/config-4.15.0-20-generic
CONFIG_NFS_FSCACHE=y
EN

回答 2

Server Fault用户

发布于 2021-05-12 18:26:04

我遇到了同样的问题。不小心碰到了对我有用的东西。

它看起来有一些东西与默认的大小,阻止fsc选项生效。如果我提供的rsize值为524288 (而不是默认的1048576),fsc选项将生效。

代码语言:javascript
复制
sudo mount -t nfs4 hex:/mnt/hexhd /mnt/hexhd  -o fsc,rsize=524288
代码语言:javascript
复制
nfsstat -m
/mnt/hexhd from hex:/mnt/hexhd
 Flags: rw,relatime,vers=4.2,rsize=524288,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.50.216,fsc,local_lock=none,addr=192.168.50.185
代码语言:javascript
复制
uname -a
Linux tri 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
票数 1
EN

Server Fault用户

发布于 2019-07-07 19:17:46

我在AWS上的一个Ubuntu18.04实例也有同样的问题,并且成功地修复了它在/etc/fstab中安装NFS卷,而不是在引导后使用mount命令。这是我的工作/etc/fstab线:

代码语言:javascript
复制
fs-xxxxx.efs.eu-west-1.amazonaws.com:/       /var/www/site/blahblah        nfs4    nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,fsc,noresvport,_netdev 0 0 

我尝试过其他操作系统,如Amazon 2和Ubuntu16.04,fsc选项与挂载命令一样有效。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/965204

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档