Skip to content
栾鹏 edited this page Jul 26, 2023 · 2 revisions

在线安装(所有节点)

ubuntu

apt update
apt install nfs-kernel-server
apt install nfs-common

centos

yum install nfs-utils

centos安装rpm包(所有节点)

wget https://docker-76009.sz.gfp.tencent-cloud.com/github/cube-studio/deploy/nfs/nfsrpm.tar.gz
tar -zxvf nfsrpm.tar.gz
cd nfs
rpm -ivh *.rpm --force --nodeps

nfs server配置

# 修改配置文件,增加下面这一行数据,指定的ip地址为客户端的地址
# /data/nfs/ 代表nfs server本地存储目录
echo "/data/nfs/ *(rw,no_root_squash,async)" >> /etc/exports

# 加载配置文件
exportfs -arv
systemctl enable rpcbind.service 
systemctl enable nfs-server.service
systemctl start rpcbind.service
systemctl start nfs-server.service

#验证
[root@nfs ~]# showmount -e localhost
Export list for localhost:
/data/nfs                     *

nfs client配置

#查看nfs server 信息

[root@node02 ~]# showmount -e 172.16.101.13
Export list for 172.16.101.13:
/data/nfs      *

# 系统层面添加挂载添加一行,重启自动添加
echo "172.16.101.13:/data/nfs  /data/nfs   nfs   defaults  0  0" >> /etc/fstab
mount -a 

# 或者使用命令行
mount -t nfs 172.16.101.13:/data/nfs /data/nfs

#验证
df -h /data/nfs

# 软链到cube studio的目录
mkdir -p /data/nfs/k8s
ln -s /data/nfs/k8s /data/

#输出 表示挂载成功
[root@node02 ~]# df -h /data/nfs
Filesystem                Size  Used Avail Use% Mounted on
172.16.101.13:/data/nfs  3.5T  626M  3.5T   1% /data/k8s

开源体验地址:

http://39.96.177.55:8888/

学习、部署、体验、咨询

Clone this wiki locally