{"id":22032,"date":"2025-04-19T05:22:04","date_gmt":"2025-04-18T21:22:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/22032.html"},"modified":"2025-04-19T05:22:04","modified_gmt":"2025-04-18T21:22:04","slug":"%e5%9c%a8-centos-%e4%b8%8a%e5%ae%89%e8%a3%85-nfs-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/22032.html","title":{"rendered":"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\n<ul>\n<li>1. \u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668<\/li>\n<li>\n<ul>\n<li>1.1 \u5b89\u88c5 NFS \u670d\u52a1\u5668\u8f6f\u4ef6\u5305<\/li>\n<li>1.2 \u914d\u7f6e NFS \u5171\u4eab\u76ee\u5f55<\/li>\n<li>1.3 \u914d\u7f6e NFS \u5bfc\u51fa\u6587\u4ef6<\/li>\n<li>1.4 \u542f\u52a8\u5e76\u542f\u7528 NFS \u670d\u52a1<\/li>\n<li>1.5 \u5bfc\u51fa\u5171\u4eab\u76ee\u5f55<\/li>\n<li>1.6 \u914d\u7f6e\u9632\u706b\u5899<\/li>\n<li>1.7 \u68c0\u67e5 NFS \u72b6\u6001<\/li>\n<\/ul>\n<\/li>\n<li>2. \u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u5ba2\u6237\u7aef<\/li>\n<li>\n<ul>\n<li>2.1 \u5b89\u88c5 NFS \u5ba2\u6237\u7aef\u8f6f\u4ef6\u5305<\/li>\n<li>2.2 \u6302\u8f7d NFS \u5171\u4eab<\/li>\n<li>2.3 \u914d\u7f6e\u81ea\u52a8\u6302\u8f7d<\/li>\n<li>2.4 \u7ed9\u6240\u6709\u7528\u6237\u8bfb\u5199\u6743\u9650<\/li>\n<li>2.5 \u68c0\u67e5 NFS \u5171\u4eab<\/li>\n<\/ul>\n<\/li>\n<li>3. \u5728 Kubernetes \u4e2d\u4f7f\u7528 NFS \u5b58\u50a8<\/li>\n<li>\n<ul>\n<li>3.1 \u521b\u5efa Persistent Volume (PV)<\/li>\n<li>3.2 \u521b\u5efa Persistent Volume Claim (PVC)<\/li>\n<li>3.3 \u521b\u5efa Pod \u4f7f\u7528 NFS \u5b58\u50a8<\/li>\n<li>3.4 \u5e94\u7528\u914d\u7f6e\u6587\u4ef6<\/li>\n<li>3.5 \u9a8c\u8bc1<\/li>\n<li>4. \u603b\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5728 CentOS \u4e0a\u5b89\u88c5\u548c\u914d\u7f6e NFS \u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u76f8\u5bf9\u7b80\u5355\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4&#xff0c;\u5305\u62ec\u8bbe\u7f6e NFS \u670d\u52a1\u5668\u3001\u914d\u7f6e\u9632\u706b\u5899\u3001\u5b89\u88c5\u5ba2\u6237\u7aef&#xff0c;\u4ee5\u53ca\u5728 Kubernetes \u4e2d\u4f7f\u7528 NFS\u3002<\/p>\n<h3>1. \u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668<\/h3>\n<h4>1.1 \u5b89\u88c5 NFS \u670d\u52a1\u5668\u8f6f\u4ef6\u5305<\/h4>\n<p>\u9996\u5148&#xff0c;\u9700\u8981\u5b89\u88c5 NFS \u670d\u52a1\u5668\u8f6f\u4ef6\u5305&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> nfs-utils<\/p>\n<h4>1.2 \u914d\u7f6e NFS \u5171\u4eab\u76ee\u5f55<\/h4>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55&#xff0c;\u7528\u4e8e\u5171\u4eab\u6570\u636e&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/mnt\/nfs<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">groupadd<\/span> nogroup<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">chown<\/span> <span class=\"token parameter variable\">-R<\/span> nobody:nogroup \/mnt\/nfs<\/p>\n<p>nobody \u548c nogroup \u662f NFS \u7684\u9ed8\u8ba4\u7528\u6237\u548c\u7ec4\u3002<\/p>\n<h4>1.3 \u914d\u7f6e NFS \u5bfc\u51fa\u6587\u4ef6<\/h4>\n<p>\u7136\u540e&#xff0c;\u914d\u7f6e\u54ea\u4e9b\u76ee\u5f55\u53ef\u4ee5\u901a\u8fc7 NFS \u5171\u4eab\u3002\u7f16\u8f91 \/etc\/exports \u6587\u4ef6&#xff0c;\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p>\/mnt\/nfs *<span class=\"token punctuation\">(<\/span>rw,sync,no_subtree_check<span class=\"token punctuation\">)<\/span><\/p>\n<ul>\n<li>rw: \u5141\u8bb8\u5ba2\u6237\u7aef\u8bfb\u5199\u8bbf\u95ee\u3002<\/li>\n<li>sync: \u786e\u4fdd\u540c\u6b65\u5199\u5165\u3002<\/li>\n<li>no_subtree_check: \u7981\u6b62\u5bf9\u5b50\u76ee\u5f55\u7684\u68c0\u67e5\u3002<\/li>\n<\/ul>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa\u6587\u4ef6\u3002<\/p>\n<h4>1.4 \u542f\u52a8\u5e76\u542f\u7528 NFS \u670d\u52a1<\/h4>\n<p>\u542f\u52a8 NFS \u670d\u52a1\u5e76\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl start nfs-server<br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> nfs-server<\/p>\n<h4>1.5 \u5bfc\u51fa\u5171\u4eab\u76ee\u5f55<\/h4>\n<p>\u4f7f\u5171\u4eab\u76ee\u5f55\u7acb\u5373\u751f\u6548&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> exportfs <span class=\"token parameter variable\">-a<\/span><\/p>\n<h4>1.6 \u914d\u7f6e\u9632\u706b\u5899<\/h4>\n<p>\u5982\u679c\u9632\u706b\u5899\u542f\u7528\u4e86&#xff0c;\u60a8\u9700\u8981\u5141\u8bb8 NFS \u76f8\u5173\u7684\u7aef\u53e3&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;permanent<\/span> &#8211;add-service<span class=\"token operator\">&#061;<\/span>nfs<br \/>\n<span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;permanent<\/span> &#8211;add-service<span class=\"token operator\">&#061;<\/span>mountd<br \/>\n<span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;permanent<\/span> &#8211;add-service<span class=\"token operator\">&#061;<\/span>rpc-bind<br \/>\n<span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;reload<\/span><\/p>\n<h4>1.7 \u68c0\u67e5 NFS \u72b6\u6001<\/h4>\n<p>\u786e\u4fdd NFS \u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl status nfs-server<\/p>\n<p>\u6b64\u65f6&#xff0c;NFS \u670d\u52a1\u5668\u5df2\u7ecf\u914d\u7f6e\u5e76\u8fd0\u884c\u5728 CentOS \u4e0a&#xff0c;\u60a8\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u4e0a\u6302\u8f7d\u8be5\u5171\u4eab\u76ee\u5f55\u3002<\/p>\n<h3>2. \u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u5ba2\u6237\u7aef<\/h3>\n<h4>2.1 \u5b89\u88c5 NFS \u5ba2\u6237\u7aef\u8f6f\u4ef6\u5305<\/h4>\n<p>\u5728\u5ba2\u6237\u7aef\u673a\u5668\u4e0a&#xff0c;\u60a8\u9700\u8981\u5b89\u88c5 NFS \u5ba2\u6237\u7aef\u5de5\u5177&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> nfs-utils<\/p>\n<h4>2.2 \u6302\u8f7d NFS \u5171\u4eab<\/h4>\n<p>\u5728\u5ba2\u6237\u7aef\u673a\u5668\u4e0a&#xff0c;\u6302\u8f7d NFS \u5171\u4eab\u76ee\u5f55\u3002\u4f8b\u5982&#xff0c;\u5047\u8bbe NFS \u670d\u52a1\u5668\u7684 IP \u5730\u5740\u662f 192.168.1.100&#xff0c;\u5171\u4eab\u76ee\u5f55\u662f \/mnt\/nfs&#xff0c;\u60a8\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token number\">192.168<\/span>.56.115:\/mnt\/nfs \/mnt\/nfs-client<\/p>\n<h4>2.3 \u914d\u7f6e\u81ea\u52a8\u6302\u8f7d<\/h4>\n<p>\u5982\u679c\u9700\u8981\u5728\u5ba2\u6237\u7aef\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u6302\u8f7d NFS \u5171\u4eab&#xff0c;\u53ef\u4ee5\u5c06\u6302\u8f7d\u4fe1\u606f\u6dfb\u52a0\u5230 \/etc\/fstab \u6587\u4ef6\u4e2d&#xff1a;<\/p>\n<p><span class=\"token number\">192.168<\/span>.56.115:\/mnt\/nfs \/mnt\/nfs-client nfs defaults <span class=\"token number\">0<\/span> <span class=\"token number\">0<\/span><\/p>\n<h4>2.4 \u7ed9\u6240\u6709\u7528\u6237\u8bfb\u5199\u6743\u9650<\/h4>\n<p>sudo chmod 777 \/mnt\/nfs  # \u7ed9\u6240\u6709\u7528\u6237\u8bfb\u5199\u6743\u9650&#xff08;\u53ef\u6839\u636e\u9700\u6c42\u8bbe\u7f6e\u66f4\u4e25\u683c\u7684\u6743\u9650&#xff09;<\/p>\n<h4>2.5 \u68c0\u67e5 NFS \u5171\u4eab<\/h4>\n<p>showmount -e  192.168.56.115<\/p>\n<h3>3. \u5728 Kubernetes \u4e2d\u4f7f\u7528 NFS \u5b58\u50a8<\/h3>\n<p>\u8981\u5728 Kubernetes \u96c6\u7fa4\u4e2d\u4f7f\u7528 NFS \u5b58\u50a8&#xff0c;\u60a8\u9700\u8981\u521b\u5efa\u4e00\u4e2a PersistentVolume \u548c PersistentVolumeClaim&#xff0c;\u8ba9 Kubernetes Pod \u6302\u8f7d NFS \u5171\u4eab\u3002<\/p>\n<h4>3.1 \u521b\u5efa Persistent Volume (PV)<\/h4>\n<p>\u5728 Kubernetes \u4e2d\u521b\u5efa\u4e00\u4e2a PV&#xff0c;\u4ee5\u4fbf Kubernetes \u53ef\u4ee5\u8bbf\u95ee\u8be5\u5171\u4eab\u76ee\u5f55\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a nfs-pv.yaml \u7684\u6587\u4ef6&#xff0c;\u5e76\u5b9a\u4e49\u5982\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p><span class=\"token key atrule\">apiVersion<\/span><span class=\"token punctuation\">:<\/span> v1<br \/>\n<span class=\"token key atrule\">kind<\/span><span class=\"token punctuation\">:<\/span> PersistentVolume<br \/>\n<span class=\"token key atrule\">metadata<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> nfs<span class=\"token punctuation\">&#8211;<\/span>pv<br \/>\n<span class=\"token key atrule\">spec<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">capacity<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">storage<\/span><span class=\"token punctuation\">:<\/span> 5Gi<br \/>\n  <span class=\"token key atrule\">volumeMode<\/span><span class=\"token punctuation\">:<\/span> Filesystem<br \/>\n  <span class=\"token key atrule\">accessModes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> ReadWriteMany  <span class=\"token comment\"># \u591a\u4e2a Pod \u53ef\u4ee5\u540c\u65f6\u8bfb\u5199<\/span><br \/>\n  <span class=\"token key atrule\">persistentVolumeReclaimPolicy<\/span><span class=\"token punctuation\">:<\/span> Retain  <span class=\"token comment\"># \u5220\u9664 PVC \u65f6\u4e0d\u4f1a\u5220\u9664 PV<\/span><br \/>\n  <span class=\"token key atrule\">nfs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">path<\/span><span class=\"token punctuation\">:<\/span> \/mnt\/nfs  <span class=\"token comment\"># NFS \u670d\u52a1\u5668\u4e0a\u7684\u8def\u5f84<\/span><br \/>\n    <span class=\"token key atrule\">server<\/span><span class=\"token punctuation\">:<\/span> 192.168.56.115  <span class=\"token comment\"># NFS \u670d\u52a1\u5668\u7684 IP \u5730\u5740<\/span><br \/>\n  <span class=\"token key atrule\">mountOptions<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> nolock  <span class=\"token comment\"># \u907f\u514d\u9501\u5b9a\u95ee\u9898<\/span><\/p>\n<h4>3.2 \u521b\u5efa Persistent Volume Claim (PVC)<\/h4>\n<p>\u7136\u540e&#xff0c;\u60a8\u9700\u8981\u521b\u5efa\u4e00\u4e2a PVC \u6765\u8bf7\u6c42 NFS \u5b58\u50a8\u8d44\u6e90\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a nfs-pvc.yaml \u7684\u6587\u4ef6&#xff0c;\u5e76\u5b9a\u4e49\u5982\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p><span class=\"token key atrule\">apiVersion<\/span><span class=\"token punctuation\">:<\/span> v1<br \/>\n<span class=\"token key atrule\">kind<\/span><span class=\"token punctuation\">:<\/span> PersistentVolumeClaim<br \/>\n<span class=\"token key atrule\">metadata<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> nfs<span class=\"token punctuation\">&#8211;<\/span>pvc<br \/>\n<span class=\"token key atrule\">spec<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">accessModes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> ReadWriteMany<br \/>\n  <span class=\"token key atrule\">resources<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">requests<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">storage<\/span><span class=\"token punctuation\">:<\/span> 5Gi<\/p>\n<h4>3.3 \u521b\u5efa Pod \u4f7f\u7528 NFS \u5b58\u50a8<\/h4>\n<p>\u73b0\u5728&#xff0c;\u60a8\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a Pod \u5e76\u5c06 NFS \u5b58\u50a8\u6302\u8f7d\u5230\u5bb9\u5668\u4e2d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a Pod \u7684\u793a\u4f8b nfs-pod.yaml&#xff1a;<\/p>\n<p><span class=\"token key atrule\">apiVersion<\/span><span class=\"token punctuation\">:<\/span> v1<br \/>\n<span class=\"token key atrule\">kind<\/span><span class=\"token punctuation\">:<\/span> Pod<br \/>\n<span class=\"token key atrule\">metadata<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> nfs<span class=\"token punctuation\">&#8211;<\/span>pod<br \/>\n<span class=\"token key atrule\">spec<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">containers<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> app<span class=\"token punctuation\">&#8211;<\/span>container<br \/>\n      <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> nginx  <span class=\"token comment\"># \u60a8\u53ef\u4ee5\u9009\u62e9\u5176\u4ed6\u955c\u50cf<\/span><br \/>\n      <span class=\"token key atrule\">volumeMounts<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">mountPath<\/span><span class=\"token punctuation\">:<\/span> \/mnt\/data  <span class=\"token comment\"># \u5c06 PVC \u6302\u8f7d\u5230\u5bb9\u5668\u4e2d\u7684\u8def\u5f84<\/span><br \/>\n          <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> nfs<span class=\"token punctuation\">&#8211;<\/span>storage<\/p>\n<p>  <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> nfs<span class=\"token punctuation\">&#8211;<\/span>storage<br \/>\n      <span class=\"token key atrule\">persistentVolumeClaim<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">claimName<\/span><span class=\"token punctuation\">:<\/span> nfs<span class=\"token punctuation\">&#8211;<\/span>pvc  <span class=\"token comment\"># \u5f15\u7528\u524d\u9762\u521b\u5efa\u7684 PVC<\/span><\/p>\n<h4>3.4 \u5e94\u7528\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>\u4f7f\u7528 kubectl \u5e94\u7528\u8fd9\u4e9b\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>kubectl apply <span class=\"token parameter variable\">-f<\/span> nfs-pv.yaml<br \/>\nkubectl apply <span class=\"token parameter variable\">-f<\/span> nfs-pvc.yaml<br \/>\nkubectl apply <span class=\"token parameter variable\">-f<\/span> nfs-pod.yaml<\/p>\n<h4>3.5 \u9a8c\u8bc1<\/h4>\n<p>\u68c0\u67e5 PV \u548c PVC \u7684\u72b6\u6001&#xff0c;\u786e\u4fdd\u5b83\u4eec\u5df2\u6b63\u786e\u7ed1\u5b9a&#xff1a;<\/p>\n<p>kubectl get <span class=\"token function\">pv<\/span><br \/>\nkubectl get pvc<br \/>\nkubectl get pods<\/p>\n<h4>4. \u603b\u7ed3<\/h4>\n<li>\u5728 CentOS \u4e0a\u5b89\u88c5\u5e76\u914d\u7f6e NFS \u670d\u52a1\u5668&#xff0c;\u8bbe\u7f6e\u5171\u4eab\u76ee\u5f55\u5e76\u542f\u52a8 NFS \u670d\u52a1\u3002<\/li>\n<li>\u5728\u5ba2\u6237\u7aef\u673a\u5668\u4e0a\u5b89\u88c5 NFS \u5ba2\u6237\u7aef&#xff0c;\u6302\u8f7d\u5171\u4eab\u76ee\u5f55\u3002<\/li>\n<li>\u5728 Kubernetes \u4e2d&#xff0c;\u521b\u5efa Persistent Volume (PV)\u3001Persistent Volume Claim (PVC)&#xff0c;\u5e76\u5728 Pod \u4e2d\u6302\u8f7d NFS \u5b58\u50a8\u3002<\/li>\n<p>\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86 CentOS \u5b89\u88c5\u548c\u914d\u7f6e NFS \u670d\u52a1\u7684\u6b65\u9aa4&#xff0c;\u4ee5\u53ca\u5728 Kubernetes \u4e2d\u4f7f\u7528\u8be5 NFS \u5b58\u50a8\u7684\u8fc7\u7a0b\u3002\u5982\u679c\u6709\u4efb\u4f55\u95ee\u9898&#xff0c;\u6b22\u8fce\u7ee7\u7eed\u63d0\u95ee&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf21\u6b21\u3002\u5728 CentOS \u4e0a\u5b89\u88c5\u5e76\u914d\u7f6e NFS \u670d\u52a1\u5668\uff0c\u8bbe\u7f6e\u5171\u4eab\u76ee\u5f55\u5e76\u542f\u52a8 NFS \u670d\u52a1\u3002\u5728\u5ba2\u6237\u7aef\u673a\u5668\u4e0a\u5b89\u88c5 NFS \u5ba2\u6237\u7aef\uff0c\u6302\u8f7d\u5171\u4eab\u76ee\u5f55\u3002\u5728 Kubernetes \u4e2d\uff0c\u521b\u5efa Persistent Volume (PV)\u3001Persistent Volume Claim (PVC)\uff0c\u5e76\u5728 Pod \u4e2d\u6302\u8f7d NFS \u5b58\u50a8\u3002\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86 CentOS \u5b89\u88c5\u548c\u914d\u7f6e NFS \u670d\u52a1\u7684\u6b65\u9aa4\uff0c\u4ee5\u53ca\u5728 Kubernetes \u4e2d\u4f7f\u7528\u8be5 NFS \u5b58\u50a8\u7684\u8fc7\u7a0b\u3002\u5982\u679c\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u6b22\u8fce\u7ee7\u7eed\u63d0\u95ee\uff01_centos\u5b89\u88c5nfs<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[59,58,43],"topic":[],"class_list":["post-22032","post","type-post","status-publish","format-standard","hentry","category-server","tag-centos","tag-linux","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/22032.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf21\u6b21\u3002\u5728 CentOS \u4e0a\u5b89\u88c5\u5e76\u914d\u7f6e NFS \u670d\u52a1\u5668\uff0c\u8bbe\u7f6e\u5171\u4eab\u76ee\u5f55\u5e76\u542f\u52a8 NFS \u670d\u52a1\u3002\u5728\u5ba2\u6237\u7aef\u673a\u5668\u4e0a\u5b89\u88c5 NFS \u5ba2\u6237\u7aef\uff0c\u6302\u8f7d\u5171\u4eab\u76ee\u5f55\u3002\u5728 Kubernetes \u4e2d\uff0c\u521b\u5efa Persistent Volume (PV)\u3001Persistent Volume Claim (PVC)\uff0c\u5e76\u5728 Pod \u4e2d\u6302\u8f7d NFS \u5b58\u50a8\u3002\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86 CentOS \u5b89\u88c5\u548c\u914d\u7f6e NFS \u670d\u52a1\u7684\u6b65\u9aa4\uff0c\u4ee5\u53ca\u5728 Kubernetes \u4e2d\u4f7f\u7528\u8be5 NFS \u5b58\u50a8\u7684\u8fc7\u7a0b\u3002\u5982\u679c\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u6b22\u8fce\u7ee7\u7eed\u63d0\u95ee\uff01_centos\u5b89\u88c5nfs\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/22032.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T21:22:04+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/22032.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/22032.html\",\"name\":\"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T21:22:04+00:00\",\"dateModified\":\"2025-04-18T21:22:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/22032.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/22032.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/22032.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/22032.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf21\u6b21\u3002\u5728 CentOS \u4e0a\u5b89\u88c5\u5e76\u914d\u7f6e NFS \u670d\u52a1\u5668\uff0c\u8bbe\u7f6e\u5171\u4eab\u76ee\u5f55\u5e76\u542f\u52a8 NFS \u670d\u52a1\u3002\u5728\u5ba2\u6237\u7aef\u673a\u5668\u4e0a\u5b89\u88c5 NFS \u5ba2\u6237\u7aef\uff0c\u6302\u8f7d\u5171\u4eab\u76ee\u5f55\u3002\u5728 Kubernetes \u4e2d\uff0c\u521b\u5efa Persistent Volume (PV)\u3001Persistent Volume Claim (PVC)\uff0c\u5e76\u5728 Pod \u4e2d\u6302\u8f7d NFS \u5b58\u50a8\u3002\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86 CentOS \u5b89\u88c5\u548c\u914d\u7f6e NFS \u670d\u52a1\u7684\u6b65\u9aa4\uff0c\u4ee5\u53ca\u5728 Kubernetes \u4e2d\u4f7f\u7528\u8be5 NFS \u5b58\u50a8\u7684\u8fc7\u7a0b\u3002\u5982\u679c\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u6b22\u8fce\u7ee7\u7eed\u63d0\u95ee\uff01_centos\u5b89\u88c5nfs","og_url":"https:\/\/www.wsisp.com\/helps\/22032.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T21:22:04+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/22032.html","url":"https:\/\/www.wsisp.com\/helps\/22032.html","name":"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T21:22:04+00:00","dateModified":"2025-04-18T21:22:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/22032.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/22032.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/22032.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728 CentOS \u4e0a\u5b89\u88c5 NFS \u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/22032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=22032"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/22032\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=22032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=22032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=22032"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=22032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}