yum -y install nfs-utils rpcbind
vi /etc/NetworkManager/system-connections/enp6s0.nmconnection #内容改为:
[connection]
id=enp6s0
uuid=67c8225e-d935-3c18-b57c-510f9e2f4883
type=ethernet
autoconnect-priority=-999
interface-name=enp6s0
[ethernet]
[ipv4]
address1=10.1.1.3/24
gateway=192.168.1.1
dns=119.29.29.29,114.114.114.114
may-fail=false
method=manual
[ipv6]
addr-gen-mode=eui64
method=auto
[proxy]
ifconfig enp6s0 mtu 9000
systemctl restart NetworkManager
nmcli connection reload enp6s0
vi /etc/hosts
10.1.1.1 cluster.local cluster
10.1.1.254 compute-0-0.local compute-0-0
10.1.1.253 compute-0-1.local compute-0-1
# Imported from /etc/hosts.local
10.1.1.2 nas-0-1.local nas-0-1
10.1.1.3 backup04.local backup04
vi /etc/hostname
fdisk -l
parted /dev/sda #交互式界面
(parted) print
(parted) rm 1
(parted) rm 2
(parted) mklabel gpt
(parted) mkpart primary 0% 100%
(parted) q
mkfs.ext4 /dev/sda1 #格式化
mkdir /export/data1
mount /dev/sda1 /export/data1 #磁盘挂载到目录
df -h #查看
vi /etc/exports #目录共享出去
/export/data1 10.1.1.0/255.255.255.0(rw,no_root_squash,async)
blkid /dev/sda1
/dev/sda1: UUID="60588444-b0a0-4956-a40a-8251965e7887" TYPE="ext4" PARTLABEL="primary" PARTUUID="00d1d4d9-c9af-4fc9-8b26-81e69fcccfdc"
echo UUID=60588444-b0a0-4956-a40a-8251965e7887 /export/data1 ext4 defaults 0 0 >> /etc/fstab
exportfs -arv
systemctl enable rpcbind.service
systemctl enable nfs-server.service
systemctl start rpcbind.service
systemctl start nfs.service
systemctl start nfs-server.service #rock9
rpcinfo -p
showmount -e 10.1.1.3
systemctl stop rpcbind.service
systemctl start rpcbind.service
systemctl start nfs-server.service #rock9
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --permanent --add-service=mountd
firewall-cmd --permanent --add-port=2049/tcp
firewall-cmd --permanent --add-port=2049/udp
firewall-cmd --reload
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!