{"id":153011,"date":"2019-08-19T08:35:17","date_gmt":"2019-08-19T00:35:17","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=153011"},"modified":"2019-08-08T16:10:23","modified_gmt":"2019-08-08T08:10:23","slug":"centos7-nfs","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos7-nfs.html","title":{"rendered":"centos7\u914d\u7f6enfs\u5171\u4eab\u5b58\u50a8\u670d\u52a1"},"content":{"rendered":"
nfs \u662f\u4e00\u79cd\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf\uff0c\u9700\u8981\u4f9d\u8d56rpc\u8fdb\u884c\u8fc7\u7a0b\u8c03\u5ea6<\/strong><\/span><\/div>\n

\u6ce8\u610fnfs\u53ea\u9a8c\u8bc1id\uff0c\u9a8c\u8bc1\u7528\u6237\u540d\uff0c\u5e76\u4e14\u53ea\u80fd\u5728\u7c7bunix os\u4e0a\u8fdb\u884c\u6587\u4ef6\u5171\u4eab\u670d\u52a1\uff0c\u7531\u4e8e\u5b83\u7684\u8106\u5f31\u7684\u9a8c\u8bc1\u673a\u5236\uff0c\u6240\u4ee5\u4e0d\u9002\u5b9c\u5728internet\u4e0a\u5de5\u4f5c\uff0c\u5728\u5185\u7f51\u4f7f\u7528\u662f\u975e\u5e38\u53ef\u884c\u7684\u3002<\/p>\n

nfs\u670d\u52a1\u7aef\u9700\u8981\u786e\u5b9a\u8fd9\u4e24\u4e2a\u5305\u6b63\u786e\u5b89\u88c5 nfs-utils rpcbind<\/strong><\/span><\/div>\n

\u82e5\u662fubuntu\u670d\u52a1\u5668\uff0c\u5219\u662fnfs-common\uff0cnfs-kernel-server\u4e24\u4e2a\u5305\uff0crpcbind\u662f\u9ed8\u8ba4\u5b89\u88c5\u7684\u3002<\/p>\n

\r\nyum -y install nfs-utils rpcbind\r\n<\/pre>\n
\u7f16\u8f91\u5171\u4eab\u76ee\u5f55\u914d\u7f6e\u6587\u4ef6 \/etc\/exports<\/strong><\/span><\/div>\n
\r\n\/var\/www\/html  192.168.10.0\/24(rw,async,no_root_squash)  192.168.20.0\/24\uff08ro\uff09\r\n\r\n#\u591a\u4e2a\u7f51\u6bb5\u6216\u4e3b\u673a\u4e4b\u95f4\u7528\u7a7a\u683c\u5206\u5f00\r\n\/var\/www          192.168.10.0\/24(ro,sync,root_squash)\r\n<\/pre>\n

\u53c2\u6570\uff1aro\u8868\u793a\u53ea\u8bfb\uff0crw\u8868\u793a\u53ef\u8bfb\u5199\uff0csync\u540c\u6b65\u5199*\u5373\u540c\u65f6\u5199\u5165\u5185\u5b58\u548c\u786c\u76d8\uff0casync\u5f02\u6b65*\u6682\u5b58\u4e8e\u5185\u5b58\uff0cno_root_squash\u8868\u793a\u5982\u679c\u5ba2\u6237\u7aef\u8fde\u63a5\u8fc7\u6765\u7684\u7528\u6237\u662froot\uff0c\u5219\u5bf9\u670d\u52a1\u7aef\u7684\u76ee\u5f55\u540c\u6837\u662froot\u6743\u9650****\u8bf7\u4e0d\u8981\u5f00\u542f\uff0c\u597d\u5371\u9669\u7684\uff0croot_squash\u8868\u793a\u5ba2\u6237\u7aef\u662froot\u5219\u5c06\u5176\u8f6c\u4e3a\u533f\u540d\u7528\u6237\u7684\u6743\u9650***\u5efa\u8bae\u5f00\u542f\u3002<\/p>\n

\u542f\u52a8nfs\u670d\u52a1\uff0c\u5e76\u8bbe\u4e3a\u5f00\u673a\u81ea\u542f\u52a8<\/strong><\/span><\/div>\n
\r\nservice rpcbind start\t\t#\u6216\u5219 systemctl start rpcbind\r\nservice nfs start\t\t#\u6216\u5219 systemctl start nfs\r\n######ubuntu\u670d\u52a1\u5668\u5219\u662f service startnfs-kernel-server start\r\nchkconfig rpcbind on\t\t#\u6216\u5219 systemctl enable rpcbind\r\nchkconfig nfs on\t\t#\u6216\u5219 systemctl enable nfs\r\n<\/pre>\n
\u914d\u7f6e\u9632\u706b\u5899\uff0c\u653e\u884c\u54cd\u5e94\u7aef\u53e3\u6216\u670d\u52a1<\/strong><\/span><\/div>\n
\r\nfirewall-cmd --permanent --add-service=nfs\r\nfirewall-cmd --permanent --add-service=rpc-bind\r\nfirewall-cmd --permanent --add-service=mountd\r\nfirewall-cmd --reload\r\nfirewall-cmd --list-all\t\t#\u67e5\u770bfirewalld\u65b9\u5411\u7684\u8d44\u6e90\r\n<\/pre>\n
\u5ba2\u6237\u7aef\u6302\u8f7d<\/strong><\/span><\/div>\n
\r\nshowmount -e nfs_server_ip: \u67e5\u770bnfs\u670d\u52a1\u7aef\u7684\u53ef\u7528\u6302\u8f7d\u70b9\r\n<\/pre>\n
\u5ba2\u6237\u7aef\u6302\u8f7d\u64cd\u4f5c<\/strong><\/span><\/div>\n
\r\nmount -t nfs nfs_server:\/var\/www\/html  \/bendikongmulu\r\n\u6216\u8005\r\nmount -t nfs nfs_server:\/var\/www\/html  \/bendikongmulu -o proto=tcp\r\n<\/pre>\n

\u65e0\u62a5\u9519\u4fbf\u6210\u529f\uff0c\u5f53\u7136\u5ba2\u6237\u7aef\u53ef\u4ee5\u4f7f\u7528 df -h \u6765\u67e5\u770b\u662f\u5426\u6302\u8f7d\u8fc7\u6765\u4e86\uff1b\u8fd9\u91cc\u5ba2\u6237\u7aef\u5207\u6362\u5230\u672c\u5730\u6302\u8f7d\u70b9\u4fbf\u53ef\u4ee5\u770b\u89c1\u670d\u52a1\u7aef\u7684\u6587\u4ef6\u4e86\uff08\u6ce8\u610f\u82e5\uff0c\u670d\u52a1\u7aef\u5171\u4eab\u7684\u76ee\u5f55\u4e3a\u7a7a\uff0c\u5ba2\u6237\u7aef\u662f\u65e0\u6cd5\u67e5\u770b\u7684\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6ce8\u610fnfs\u53ea\u9a8c\u8bc1id\uff0c\u9a8c\u8bc1\u7528\u6237\u540d\uff0c\u5e76\u4e14\u53ea\u80fd\u5728\u7c7bunix os\u4e0a\u8fdb\u884c\u6587\u4ef6\u5171\u4eab\u670d\u52a1\uff0c\u7531\u4e8e\u5b83\u7684\u8106\u5f31\u7684\u9a8c\u8bc1\u673a\u5236\uff0c\u6240\u4ee5\u4e0d […]<\/p>\n","protected":false},"author":668,"featured_media":135735,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-153011","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/153011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=153011"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/153011\/revisions"}],"predecessor-version":[{"id":153196,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/153011\/revisions\/153196"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/135735"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=153011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=153011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=153011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}