{"id":3647,"date":"2018-07-29T18:00:45","date_gmt":"2018-07-29T10:00:45","guid":{"rendered":"http:\/\/switch.linesno.com\/?p=3647"},"modified":"2018-07-29T18:20:36","modified_gmt":"2018-07-29T10:20:36","slug":"centos7-%e5%8d%95%e6%9c%ba%e7%89%88%e5%ae%89%e8%a3%85fastdfs","status":"publish","type":"post","link":"http:\/\/switch.linesno.com\/?p=3647","title":{"rendered":"Centos7 \u5355\u673a\u7248\u5b89\u88c5fastdfs"},"content":{"rendered":"<h2>1\u3001\u5b89\u88c5gcc\uff08\u7f16\u8bd1\u65f6\u9700\u8981\uff09<\/h2>\n<p>FastDFS\u662fC\u8bed\u8a00\u5f00\u53d1\uff0c\u5b89\u88c5FastDFS\u9700\u8981\u5148\u5c06\u5b98\u7f51\u4e0b\u8f7d\u7684\u6e90\u7801\u8fdb\u884c\u7f16\u8bd1\uff0c\u7f16\u8bd1\u4f9d\u8d56gcc\u73af\u5883\uff0c\u5982\u679c\u6ca1\u6709gcc\u73af\u5883\uff0c\u9700\u8981\u5b89\u88c5gcc<\/p>\n<div class=\"cnblogs_code\">\n<pre>yum install -y gcc gcc-c++<\/pre>\n<h2>\u00a02\u3001 \u5b89\u88c5libfastcommon<\/h2>\n<p>libfastcommon\u662fFastDFS\u5b98\u65b9\u63d0\u4f9b\u7684\uff0clibfastcommon\u5305\u542b\u4e86FastDFS\u8fd0\u884c\u6240\u9700\u8981\u7684\u4e00\u4e9b\u57fa\u7840\u5e93\u3002<\/p>\n<p>\uff081\uff09\u4e0a\u4f20 libfastcommonV1.0.7.tar.gz\u5230Centos\u673a\u5668\u4e0a\uff1b<\/p>\n<p>\uff082\uff09\u5c06 libfastcommonV1.0.7.tar.gz\u89e3\u538b\u81f3\/usr\/local\/\u4e0b\uff1a<\/p>\n<div class=\"cnblogs_code\">\n<pre>tar -zxvf libfastcommonV1.0.7.tar.gz -C \/usr\/local\/<\/pre>\n<\/div>\n<p>\uff083\uff09\u5207\u6362\u76ee\u5f55\u5230\uff1a\/usr\/local\/libfastcommon-1.0.7\/ \u4e0b\uff0c\u63a5\u7740\u8fdb\u884c\u7f16\u8bd1\u548c\u5b89\u88c5\uff1b<\/p>\n<div class=\"cnblogs_code\">\n<pre>cd \/usr\/local\/libfastcommon-1.0.7\/\r\n.\/make.sh           #\u7f16\u8bd1\r\n.\/make.sh install   #\u5b89\u88c5<\/pre>\n<p><strong>3. \u914d\u7f6e<\/strong><\/p>\n<p>\u5982\u4e0b\u662f\u4f7f\u7528\u5355\u53f0\u673a\u5668\u540c\u65f6\u4f5c\u4e3aTracker Server\u548cStorage Server\u3002<\/p>\n<p>\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5b9a\u4f4d\u5230\/etc\/fdfs\/\u76ee\u5f55\uff0c\u53c2\u8003\u8fd9\u4e2a\u76ee\u5f55\u7684\u914d\u7f6e\u6587\u4ef6\u4f8b\u5b50\u521b\u5efastorage\u548ctracker\u7684\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>\u76f4\u63a5\u4f7f\u7528\u547d\u4ee4<\/p>\n<div class=\"cnblogs_code\">\n<pre>cp storage.conf.sample storage.conf\r\ncp tracker.conf.sample tracker.conf<\/pre>\n<\/div>\n<p>\u5b9a\u4e49<span lang=\"EN-US\">storage.conf \u6bd4\u5982\u4fee\u6539\u5b58\u50a8\u6570\u636e\u548c\u65e5\u5fd7\u7684\u8def\u5f84<\/span><\/p>\n<p><span lang=\"EN-US\">base_path=\/home\/yuqing\/fastdfs \u4fee\u6539\u4e3a\u4f60\u5b9a\u4e49\u7684\u76ee\u5f55\u6bd4\u5982\/home\/root\/fastdfs<\/span><\/p>\n<p>\u5b9a\u4e49<span lang=\"EN-US\">tracker.conf \u6bd4\u5982\u4fee\u6539\u5b58\u50a8\u6570\u636e\u548c\u65e5\u5fd7\u7684\u8def\u5f84<\/span><\/p>\n<p><span lang=\"EN-US\">base_path=\/home\/yuqing\/fastdfs \u4fee\u6539\u4e3a\u4f60\u5b9a\u4e49\u7684\u76ee\u5f55\/home\/root\/fastdfs<\/span><\/p>\n<p><span lang=\"EN-US\">tracker_server=192.168.209.121:22122 \u4fee\u6539\u4e3a\u4f60\u7684IP\u5730\u5740\u6bd4\u598210.198.1.128:22122<\/span><\/p>\n<p>\u5f00\u542f\u7aef\u53e322122,23000<\/p>\n<div class=\"cnblogs_code\">\n<pre>firewall-cmd --zone=public --add-port=22122\/tcp --permanent\r\nfirewall-cmd --zone=public --add-port=23000\/tcp \u2013permanent\r\nsystemctl stop firewalld.service \r\nsystemctl start firewalld.service<\/pre>\n<\/div>\n<p>\u542f\u52a8\u670d\u52a1<\/p>\n<div class=\"cnblogs_code\">\n<pre>\/usr\/bin\/fdfs_trackerd \/etc\/fdfs\/tracker.conf start\r\n\/usr\/bin\/fdfs_storaged \/etc\/fdfs\/storage.conf start<\/pre>\n<p>\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u68c0\u67e5fdfs\u662f\u5426\u542f\u52a8\u6210\u529f\u3002<\/p>\n<div class=\"cnblogs_code\">\n<pre>ps -ef | grep fdfs<\/pre>\n<\/div>\n<p><strong>4. \u6d4b\u8bd5<\/strong><\/p>\n<p>\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u68c0\u67e5\u662f\u5426Storage\u767b\u8bb0\u5230Tracker<\/p>\n<div class=\"cnblogs_code\">\n<pre>fdfs_monitor \/etc\/fdfs\/storage.conf<\/pre>\n<\/div>\n<p>\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u68c0\u67e5\u6587\u4ef6\u4e0a\u4f20<\/p>\n<div class=\"cnblogs_code\">\n<pre>\/usr\/bin\/fdfs_test \/etc\/fdfs\/client.conf upload \/usr\/include\/stdlib.h<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u5b89\u88c5gcc\uff08\u7f16\u8bd1\u65f6\u9700\u8981\uff09 FastDFS\u662fC\u8bed\u8a00\u5f00\u53d1\uff0c\u5b89\u88c5FastDFS\u9700\u8981\u5148\u5c06\u5b98\u7f51\u4e0b\u8f7d\u7684\u6e90\u7801\u8fdb\u884c\u7f16\u8bd1\uff0c\u7f16 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-3647","post","type-post","status-publish","format-standard","hentry","category-day"],"_links":{"self":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3647"}],"version-history":[{"count":4,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3647\/revisions"}],"predecessor-version":[{"id":3652,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3647\/revisions\/3652"}],"wp:attachment":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3647"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}