Centos 7에 ZFS (0.6.5)를 설치했으며 zpool도 만들었습니다. 재부팅시 데이터 세트가 사라진다는 사실과는 별개로 작동합니다.
다양한 온라인 리소스와 블로그를 사용 하여이 문제를 디버깅하려고했지만 원하는 결과를 얻지 못했습니다.
재부팅 후, 나는이 실행할 때 zfs list
명령을 내가 얻을 “사용 가능한 데이터 셋” 하고 zpool list
있습니다 “아니오 풀 가능”
온라인으로 많은 연구를 수행 한 후, 나는 그것을 수동으로 사용하여 캐시 파일을 가져 와서 작업을 만들 수 는 zpool 가져 오기 -c과 CacheFile을 하지만, 여전히 재부팅 후에 나중에 가져 오기 위해 재부팅 전에 zpool set cachefile = / etc / zfs / zpool.cache 풀을 실행 해야했습니다.
이것은 무엇입니까systemctl status zfs-import-cache
처럼 보인다
zfs-import-cache.service - Import ZFS pools by cache file
Loaded: loaded (/usr/lib/systemd/system/zfs-import-cache.service; static)
Active: inactive (dead)
cat /etc/sysconfig/zfs
# ZoL userland configuration.
# Run `zfs mount -a` during system start?
ZFS_MOUNT='yes'
# Run `zfs unmount -a` during system stop?
ZFS_UNMOUNT='yes'
# Run `zfs share -a` during system start?
# nb: The shareiscsi, sharenfs, and sharesmb dataset properties.
ZFS_SHARE='yes'
# Run `zfs unshare -a` during system stop?
ZFS_UNSHARE='yes'
# Specify specific path(s) to look for device nodes and/or links for the
# pool import(s). See zpool(8) for more information about this variable.
# It supersedes the old USE_DISK_BY_ID which indicated that it would only
# try '/dev/disk/by-id'.
# The old variable will still work in the code, but is deprecated.
#ZPOOL_IMPORT_PATH="/dev/disk/by-vdev:/dev/disk/by-id"
# Should the datasets be mounted verbosely?
# A mount counter will be used when mounting if set to 'yes'.
VERBOSE_MOUNT='no'
# Should we allow overlay mounts?
# This is standard in Linux, but not ZFS which comes from Solaris where this
# is not allowed).
DO_OVERLAY_MOUNTS='no'
# Any additional option to the 'zfs mount' command line?
# Include '-o' for each option wanted.
MOUNT_EXTRA_OPTIONS=""
# Build kernel modules with the --enable-debug switch?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_ENABLE_DEBUG='no'
# Build kernel modules with the --enable-debug-dmu-tx switch?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no'
# Keep debugging symbols in kernel modules?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_DISABLE_STRIP='no'
# Wait for this many seconds in the initrd pre_mountroot?
# This delays startup and should be '0' on most systems.
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_INITRD_PRE_MOUNTROOT_SLEEP='0'
# Wait for this many seconds in the initrd mountroot?
# This delays startup and should be '0' on most systems. This might help on
# systems which have their ZFS root on a USB disk that takes just a little
# longer to be available
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_INITRD_POST_MODPROBE_SLEEP='0'
# List of additional datasets to mount after the root dataset is mounted?
#
# The init script will use the mountpoint specified in the 'mountpoint'
# property value in the dataset to determine where it should be mounted.
#
# This is a space separated list, and will be mounted in the order specified,
# so if one filesystem depends on a previous mountpoint, make sure to put
# them in the right order.
#
# It is not necessary to add filesystems below the root fs here. It is
# taken care of by the initrd script automatically. These are only for
# additional filesystems needed. Such as /opt, /usr/local which is not
# located under the root fs.
# Example: If root FS is 'rpool/ROOT/rootfs', this would make sense.
#ZFS_INITRD_ADDITIONAL_DATASETS="rpool/ROOT/usr rpool/ROOT/var"
# List of pools that should NOT be imported at boot?
# This is a space separated list.
#ZFS_POOL_EXCEPTIONS="test2"
# Optional arguments for the ZFS Event Daemon (ZED).
# See zed(8) for more information on available options.
#ZED_ARGS="-M"
이것이 알려진 문제인지 확실하지 않습니다. 그렇다면, 이에 대한 해결 방법이 있습니까? 재부팅 후 캐시 파일의 오버 헤드없이 데이터 세트를 유지하는 쉬운 방법 일 것입니다.
답변
zfs 서비스 (대상)가 활성화되어 있는지 확인하십시오. 이것이 부팅 / 종료시 풀 가져 오기 / 내보내기를 처리하는 것입니다.
zfs.target loaded active active ZFS startup target
당신은 이것으로 고투 할 필요가 없습니다. 기회가 있다면 마지막 몇 가지 릴리스에서 스타트 업 서비스가 개선되었다는 것을 알고 있으므로 zfs 배포에서 업데이트를 실행하십시오.
[root@zfs2 ~]# rpm -qi zfs
Name : zfs
Version : 0.6.5.2
Release : 1.el7.centos
답변
자, 풀이 있습니다. 문제는 zfs.cache에 문제가 있음을 의미하며, 영구적이지 않으므로 재부팅 할 때 구성이 느슨해집니다. 내가 제안하는 것은 실행하는 것입니다.
zpool import zfsPool
zpool list
사용 가능한지 확인하십시오. 서버를 재부팅하고 다시 돌아 왔는지 확인한 후 동일한 단계를 수행하지 않으면 다음을 실행하십시오.
zpool scrub
수영장 등으로 모든 것이 잘되도록하십시오.
Pls는 또한 다음의 내용을 게시합니다 :
/etc/default/zfs.conf
/etc/init/zpool-import.conf
또는이 문제에 대한 해결 방법을 찾고 있다면 다음과 같이 설정할 수 있습니다.
값을 1에서 0으로 변경하십시오.
/etc/init/zpool-import.conf
/etc/rc.local에 다음을 추가하십시오.
zfs mount -a
그 트릭을 할 것입니다.
답변
또한 재부팅 후 zfs가 사라지는 문제가있었습니다. CentOS 7.3 및 ZFS 0.6.5.9를 실행하면 다시 가져 오면 다음에 다시 부팅 할 때까지만 가져옵니다 (zpool import zfspool).
재부팅을 통해 지속되도록하기 위해 나를 위해 일한 명령은 다음과 같습니다.
systemctl preset zfs-import-cache zfs-import-scan zfs-mount zfs-share zfs-zed zfs.target
( https://github.com/zfsonlinux/zfs/wiki/RHEL-%26-CentOS 에서 발견
)