电脑安装Linux系统后配置网口及NFS 服务手动挂载文件

电脑安装Linux系统后配置网口及NFS 服务手动挂载文件
1. nas 服务端配置 安装nfs工具
yum -y install nfs-utils rpcbind
2.万兆网口设置
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]
mtu设置9000:
ifconfig enp6s0 mtu 9000
重启
systemctl restart NetworkManager
nmcli connection reload enp6s0
ifconfig查看
attachments-2023-09-rnhGXkgQ65013129a7b35.png 3./etc/hosts 追加内容
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
10.1.1.252 compute-0-2.local compute-0-2
10.1.1.251 compute-0-3.local compute-0-3
10.1.1.248 compute-0-5.local compute-0-5
10.1.1.249 compute-0-7.local compute-0-7
10.1.1.246 nas-0-3.local nas-0-3
10.1.1.247 nas-0-5.local nas-0-5
10.1.1.244 backup01.local backup01
192.168.1.99 cluster.rocks.org
192.168.10.2 class
192.168.10.3 class-b01
192.168.10.4 class-a01
192.168.10.5 study01
192.168.10.6 class-b02
192.168.10.7 class-a02
192.168.1.12 backup02
192.168.1.254 backup03
# 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

4.分区
fdisk -l
attachments-2023-09-qlfpr3fL6501319b72da2.png
使用parted删除sda1和sda2俩分区,重新分区
parted /dev/sda   #交互式界面
(parted) print

attachments-2023-09-OfuuzWfJ650131c294761.png
(parted) rm 1
(parted) rm 2
(parted) mklabel gpt
(parted) mkpart primary 0% 100%
(parted) q
fdisk -l #查看

attachments-2023-09-O7OqkxI4650131e363b55.png磁盘格式化,挂载

mkfs.ext4 /dev/sda1    #格式化
mkdir /export/data1
mount /dev/sda1 /export/data1 #磁盘挂载到目录
df -h #查看

attachments-2023-09-x1Tedt77650131f8bf059.png
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
设置rpcbind、nfs开机启动:
systemctl enable rpcbind.service
systemctl enable nfs-server.service
启动命令
systemctl start rpcbind.service
nfs无需启动
systemctl start nfs.service
systemctl start nfs-server.service #rock9
检查NFS服务器是否启动
rpcinfo -p
查看【服务机server】可挂载目录
showmount -e 10.1.1.3

attachments-2023-09-gsrcqGhh65013219caf1a.png
如果报错:clnt_create: RPC: Program not registered   
解决方式一:
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


  • 发表于 2023-09-13 13:03
  • 阅读 ( 1108 )
  • 分类:软件工具

0 条评论

请先 登录 后评论
安生水
安生水

343 篇文章

作家榜 »

  1. omicsgene 697 文章
  2. 安生水 343 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. xun 78 文章
  6. 红橙子 78 文章
  7. rzx 74 文章
  8. CORNERSTONE 72 文章