LoginSignup
3
3

More than 5 years have passed since last update.

OpenVz上のCentOS7でNFSサーバを動かせた

Last updated at Posted at 2014-10-23

unfsdがCentOS7用のがない、srpmからビルドも成功しないということで絶望していたが、NFS server inside container - OpenVZ Linux Containers Wikiの手順で出来た。

ホスト側の作業

コンテナを一度停止しないと有効になりません。

ホスト側にて実行
vzctl set $CONTAINERID --feature nfsd:on --save

もしくは直接記述

/etc/pve/openvz/374.conf
+ FEATURES="nfsd:on"

コンテナ側の作業

yum install nfs-utils
/etc/exports
/var/log/  192.168.100.0/24(ro,no_subtree_check)
反映と確認
exportfs -rav

他のサーバからNFSマウントできることを確認

mount -t nfs コンテナのIP:/var/log /mnt/

nfsオプションを有効にしていると稼働中のバックアップできないっぽい

INFO: suspend vm
INFO: Setting up checkpoint...
INFO:   suspend...
INFO: Can not suspend container: Invalid argument
INFO: Error: unsupported fs type nfsd
INFO: Checkpointing failed
ERROR: Backup of VM 318 failed - command 'vzctl --skiplock chkpnt 318 --suspend' failed: exit code 16
INFO: Backup job finished with errors
TASK ERROR: job errors
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3