- yum -y install nfs-utils rpcbind
- groupadd -g 27 MySQL
- seradd -u 27 -g MySQL MySQL
- mkdir /home/sharednfs
- VIM /etc/exports
- /home/sharednfs *(rw,all_squash,anonuid=27,anongid=27)
- systemctl restart nfs
- systemctl enable rpcbind.service
- systemctl enable nfs-server.service
- /etc/init.d/mysqld stop
- cp -rp /var/lib/MySQL/ /var/lib/mysqlnfs
修改 my.cnf 的路劲
- reboot
- apt-get install nfs-common
- yum install nfs-utils -y
- /etc/init.d/rpcbind start
- mkdir /var/lib/mysqlnfs
- mount -t nfs 192.168.31.207:/var/lib/MySQL /var/lib/mysqlnfs
- showmount -e 127.0.0.1
- vi /etc/fstab
添加: 192.168.56.101:/opt/test /opt/test nfs defaults 0 0
来源: http://www.bubuko.com/infodetail-3123093.html