{"id":7734,"date":"2023-10-09T09:55:50","date_gmt":"2023-10-09T01:55:50","guid":{"rendered":"http:\/\/www.yliyun.com\/?p=7734"},"modified":"2023-10-09T09:55:50","modified_gmt":"2023-10-09T01:55:50","slug":"%e4%b8%80%e7%b2%92%e4%ba%91%e5%b8%b8%e7%94%a8%e7%bb%b4%e6%8a%a4%e6%89%8b%e5%86%8c","status":"publish","type":"post","link":"http:\/\/www.yliyun.com\/2023\/10\/09\/%e4%b8%80%e7%b2%92%e4%ba%91%e5%b8%b8%e7%94%a8%e7%bb%b4%e6%8a%a4%e6%89%8b%e5%86%8c\/","title":{"rendered":"\u4e00\u7c92\u4e91\u5e38\u7528\u7ef4\u62a4\u624b\u518c"},"content":{"rendered":"\n

\u4e00\u3001\u5e38\u7528\u547d\u4ee4\u548c\u65e5\u5fd7<\/strong><\/h1>\n\n\n\n

\u5e38\u7528\u547d\u4ee4<\/strong><\/h2>\n\n\n\n

1\u3001\u542f\u52a8\u6216\u505c\u6b62\u6574\u4e2a\u4e91\u76d8\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/yliyun start\\stop<\/p>\n\n\n\n

2\u3001\u542f\u52a8\u6216\u505c\u6b62MySQL\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/mysql start\\stop<\/p>\n\n\n\n

3\u3001\u542f\u52a8\u6216\u505c\u6b62FDFS\u5b58\u50a8\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/fdfs start\\stop<\/p>\n\n\n\n

4\u3001\u91cd\u542f\u6216\u542f\u52a8\u6216\u505c\u6b62Nginx\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/nginx restart\\start\\stop<\/p>\n\n\n\n

5\u3001\u542f\u52a8\u6216\u505c\u6b62Redis\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/redis start\\stop<\/p>\n\n\n\n

6\u3001\u91cd\u542f\u6216\u542f\u52a8\u6216\u505c\u6b62pm2\u670d\u52a1<\/p>\n\n\n\n

pm2 restart\\start\\stop all<\/p>\n\n\n\n

7\u3001\u67e5\u770b\u4e91\u76d8\u6240\u6709\u670d\u52a1\u8fdb\u7a0b<\/p>\n\n\n\n

ps -ef | grep yliyun<\/p>\n\n\n\n

\u65e5\u5fd7<\/strong><\/h2>\n\n\n\n

1\u3001\u4e00\u7c92\u4e91\u6240\u6709\u5b9e\u65f6\u65e5\u5fd7<\/p>\n\n\n\n

pm2 logs app<\/p>\n\n\n\n

\u5982\u679c\u63d0\u793a\u201d-bash: pm2: command not found\u201d \uff0c\u8bf7\u6267\u884c<\/p>\n\n\n\n

source \/etc\/profile<\/p>\n\n\n\n

2\u3001MySQL\u3001Nginx\u3001Node\u3001Redis\u65e5\u5fd7\u6240\u5728\u8def\u5f84<\/p>\n\n\n\n

\/opt\/yliyun\/logs\/<\/p>\n\n\n\n

\u251c\u2500\u2500 mysql<\/p>\n\n\n\n

\u251c\u2500\u2500 nginx<\/p>\n\n\n\n

\u251c\u2500\u2500 node<\/p>\n\n\n\n

\u2514\u2500\u2500 redis<\/p>\n\n\n\n

3\u3001FastDFS\u5b58\u50a8\u65e5\u5fd7\u8def\u5f84<\/p>\n\n\n\n

\/opt\/yliyun\/data\/tracker\/logs\/<\/p>\n\n\n\n

\u251c\u2500\u2500 storage<\/p>\n\n\n\n

\u2502 \u2514\u2500\u2500 logs<\/p>\n\n\n\n

\u2502 \u2514\u2500\u2500 storaged.log<\/p>\n\n\n\n

\u2514\u2500\u2500 tracker<\/p>\n\n\n\n

\u2514\u2500\u2500 logs<\/p>\n\n\n\n

\u2514\u2500\u2500 trackerd.log<\/p>\n\n\n\n

\u4e8c\u3001\u66f4\u6539\u4e91\u76d8\u9ed8\u8ba4\u7aef\u53e3<\/strong><\/h1>\n\n\n\n

1\u3001\u4fee\u6539\u6587\u4ef6\u524d\u5148\u505a\u5907\u4efd<\/p>\n\n\n\n

cp -r \/opt\/yliyun\/openresty\/nginx\/conf\/nginx.conf \/opt\/yliyun\/openresty\/nginx\/conf\/nginx.conf.bak<\/p>\n\n\n\n

cp -r \/opt\/yliyun\/work\/node\/config\/app.json \/opt\/yliyun\/work\/node\/config\/app.json.bak<\/p>\n\n\n\n

2\u3001\u7f16\u8f91nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u627e\u5230listen 80\u66f4\u6539\u6210listen 8088<\/p>\n\n\n\n

\u8fd9\u91cc\u6211\u4eec\u628a\u9ed8\u8ba4\u7aef\u53e380\u6539\u6210\u81ea\u5b9a\u4e49\u7aef\u53e38088\u4e3a\u4f8b<\/p>\n\n\n\n

vi \/opt\/yliyun\/openresty\/nginx\/conf\/nginx.conf<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

3\u3001\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff0c\u5728web\u5730\u5740\u540e\u52a0\u4e0a\u7aef\u53e3<\/p>\n\n\n\n

vi \/opt\/yliyun\/work\/node\/config\/app.json<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

4\u3001\u91cd\u542fnginx<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/nginx restart<\/p>\n\n\n\n

5\u3001\u5f00\u653e\u9632\u706b\u58998088\u7aef\u53e3<\/p>\n\n\n\n

firewall-cmd –zone=public –add-port=8088\/tcp –permanent<\/p>\n\n\n\n

firewall-cmd –reload<\/p>\n\n\n\n

6\u3001\u8bbf\u95ee\u6d4b\u8bd5<\/p>\n\n\n\n

\u6d4f\u89c8\u5668\u8bbf\u95ee\u670d\u52a1\u5668\u5730\u5740\u52a0\u81ea\u5b9a\u4e49\u7aef\u53e3\uff0c\u5982\uff1a192.168.0.90:8088<\/p>\n\n\n\n

\u6d4b\u8bd5\u4e91\u76d8\u4e0a\u4f20\u4e0b\u8f7d\u3001\u65b0\u4e0a\u4f20\u6587\u4ef6\u9884\u89c8\u7b49\u529f\u80fd\u662f\u5426\u6b63\u5e38\u3002<\/p>\n\n\n\n

\u4e09\u3001\u914d\u7f6eHTTPS<\/strong><\/h1>\n\n\n\n

1\u3001\u4fee\u6539\u6587\u4ef6\u524d\u5148\u505a\u5907\u4efd<\/p>\n\n\n\n

cp -r\/opt\/yliyun\/openresty\/nginx\/conf\/nginx.conf \/opt\/yliyun\/openresty\/nginx\/conf\/nginx.conf.bak<\/p>\n\n\n\n

2\u3001\u83b7\u53d6SSL\u8bc1\u4e66<\/p>\n\n\n\n

\u83b7\u53d6\u5230SSL\u8bc1\u4e66\u6587\u4ef6\u540e\uff0c\u5c06\u8bc1\u4e66\u6587\u4ef6\u4e2dNginx\u76ee\u5f55\u4e0b\u7684crt\u548ckey\u6587\u4ef6\uff0c\u653e\u81f3\u4e91\u76d8\u670d\u52a1\u5668\u7684\/opt\/yliyun\/openresty\/nginx\/conf\/\u76ee\u5f55\u4e0b\u3002<\/p>\n\n\n\n

3\u3001\u4fee\u6539Nginx \u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n

\u6ce8\u610f\u81ea\u5b9a\u4e49\u7aef\u53e3\u7684\u95ee\u9898<\/p>\n\n\n\n

vi \/opt\/yliyun\/openresty\/nginx\/conf\/nginx.conf<\/p>\n\n\n\n

\u82e5\u5df2\u7ecf\u6709\u6ce8\u91ca\u8fc7\u7684\u914d\u7f6e\u5b58\u5728\uff0c\u53ea\u9700\u8981\u5c06\u6ce8\u91ca\u7b26\u53f7\u53bb\u6389\u5373\u53ef\u3002\u5982\u4e0b\u56fe:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

4\u3001\u91cd\u542fnginx\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/nginx restart<\/p>\n\n\n\n

5\u3001\u5f00\u653e\u9632\u706b\u5899443\u7aef\u53e3<\/p>\n\n\n\n

firewall-cmd –zone=public –add-port=443\/tcp –permanent<\/p>\n\n\n\n

firewall-cmd –reload<\/p>\n\n\n\n

6\u3001\u6d4b\u8bd5\u8bbf\u95ee<\/p>\n\n\n\n

\u6d4f\u89c8\u5668\u901a\u8fc7https:\/\/\u2019\u57df\u540d\u2019\u6216\u201d\u516c\u7f51IP\u201d\u8bbf\u95ee\u3002<\/p>\n\n\n\n

\u6d4b\u8bd5\u4e91\u76d8\u4e0a\u4f20\u4e0b\u8f7d\u3001\u65b0\u4e0a\u4f20\u6587\u4ef6\u9884\u89c8\u7b49\u529f\u80fd\u662f\u5426\u6b63\u5e38\u3002<\/p>\n\n\n\n

\u56db\u3001\u66f4\u6539\u5b58\u50a8\u8def\u5f84<\/strong><\/h1>\n\n\n\n

1\u3001\u4fee\u6539\u6587\u4ef6\u524d\u5148\u505a\u5907\u4efd<\/p>\n\n\n\n

cp -r \/opt\/yliyun\/fdfs\/etc\/storage.conf \/opt\/yliyun\/fdfs\/etc\/storage.conf.bak<\/p>\n\n\n\n

cp -r \/opt\/yliyun\/fdfs\/etc\/mod_fastdfs.conf \/opt\/yliyun\/fdfs\/etc\/mod_fastdfs.conf.bak<\/p>\n\n\n\n

2\u3001\u4fee\u6539\u5b58\u50a8\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n

\u627e\u5230store_path0\u53c2\u6570\u5e76\u4fee\u6539\u4e3a\u81ea\u5b9a\u4e49\u53c2\u6570\u503c\uff0c\u5982\u6709\u591a\u4e2astore_path\u6839\u636e\u5b9e\u9645\u9700\u6c42\u66f4\u6539\u5373\u53ef<\/p>\n\n\n\n

vi \/opt\/yliyun\/fdfs\/etc\/storage.conf<\/p>\n\n\n\n

vi \/opt\/yliyun\/fdfs\/etc\/mod_fastdfs.conf<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

3\u3001\u91cd\u542ffdfs\u548cnginx\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/fdfs stop && \/opt\/yliyun\/bin\/fdfs start<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/nginx restart<\/p>\n\n\n\n

4\u3001\u6d4b\u8bd5<\/p>\n\n\n\n

\u7b49\u5f85\u51e0\u79d2\u540e\uff0c\u8fdb\u5165\u4e91\u76d8\u6d4b\u8bd5\u6587\u4ef6\u4e0a\u4f20\u4e0b\u8f7d\u3001\u65b0\u4e0a\u4f20\u6587\u4ef6\u9884\u89c8\u7b49\u529f\u80fd\u662f\u5426\u6b63\u5e38\u3002<\/p>\n\n\n\n

\u4e94\u3001\u5b58\u50a8\u6269\u5bb9<\/strong><\/h1>\n\n\n\n

1\u3001\u4fee\u6539\u6587\u4ef6\u524d\u5148\u505a\u5907\u4efd<\/p>\n\n\n\n

cp -r \/opt\/yliyun\/fdfs\/etc\/storage.conf \/opt\/yliyun\/fdfs\/etc\/storage.conf.bak<\/p>\n\n\n\n

cp -r \/opt\/yliyun\/fdfs\/etc\/mod_fastdfs.conf \/opt\/yliyun\/fdfs\/etc\/mod_fastdfs.conf.bak<\/p>\n\n\n\n

2\u3001\u4fee\u6539\u5b58\u50a8\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n

\u914d\u7f6e\u6587\u4ef6\u4e2dstore_path_count\u53c2\u6570\u9ed8\u8ba4\u4e3a1\uff0c\u5982\u679c\u65b0\u589e1\u6761\u5b58\u50a8\u8def\u5f84\uff0c\u5219\u9700\u8981\u6539\u4e3a2\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n\n\n\n

\u914d\u7f6e\u4e2dstore_path0=\/opt\/yliyun\/data\/g1_data0 \u4e3a\u4e91\u76d8\u9ed8\u8ba4\u7684\u5b58\u50a8\u4f4d\u7f6e\uff0c\u53ef\u4fee\u6539\u3002\u5982\u9700\u65b0\u589e\u5b58\u50a8\uff0c\u5728\u4e0b\u4e00\u884c\u6dfb\u52a0store_path1=\u2019\u65b0\u5b58\u50a8\u8def\u5f84\u2019\uff0c\u6309\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

3\u3001\u91cd\u542ffdfs\u548cnginx\u670d\u52a1<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/fdfs stop && \/opt\/yliyun\/bin\/fdfs start<\/p>\n\n\n\n

\/opt\/yliyun\/bin\/nginx restart<\/p>\n\n\n\n

4\u3001\u6d4b\u8bd5<\/p>\n\n\n\n

\u7b49\u5f85\u51e0\u79d2\u540e\u8fdb\u5165\u4e91\u76d8\u540e\u53f0\u7ba1\u7406\uff0c\u70b9\u51fb\u7cfb\u7edf\u201c\u6982\u89c8\u6a21\u5757<\/strong>\u201d\u770b\u7a7a\u95f4\u5927\u5c0f\u662f\u5426\u589e\u52a0\uff0c\u7136\u540e\u6d4b\u8bd5\u6587\u4ef6\u4e0a\u4f20\u4e0b\u8f7d\u3001\u65b0\u4e0a\u4f20\u6587\u4ef6\u9884\u89c8\u7b49\u529f\u80fd\u662f\u5426\u6b63\u5e38\u3002<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

\u516d\u3001\u914d\u7f6e\u5ba2\u6237\u7aef\u9ed8\u8ba4\u5730\u5740<\/strong><\/h1>\n\n\n\n

1\u3001\u4fee\u6539\u6587\u4ef6\u524d\u5148\u505a\u5907\u4efd<\/p>\n\n\n\n

cp -r \/opt\/yliyun\/work\/node\/default.json \/opt\/yliyun\/work\/node\/default.json.bak<\/p>\n\n\n\n

2\u3001\u4fee\u6539\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n

vi \/opt\/yliyun\/work\/node\/default.json<\/p>\n\n\n\n

3\u3001\u91cd\u542f\u670d\u52a1<\/p>\n\n\n\n

pm2 restart all<\/p>\n\n\n\n

\u4e03\u3001CentOS7 \u78c1\u76d8\u6302\u8f7d<\/strong><\/h1>\n\n\n\n

1\u3001\u67e5\u770b\u5f53\u524d\u6240\u5b58\u5728\u7684\u78c1\u76d8<\/p>\n\n\n\n

fdisk -l<\/p>\n\n\n\n

2\u3001\u67e5\u770b\u78c1\u76d8\u6302\u8f7d\u5b58\u50a8<\/p>\n\n\n\n

lsblk<\/p>\n\n\n\n

3\u3001\u67e5\u770b\u78c1\u76d8\u6302\u8f7d\u8be6\u7ec6\u4fe1\u606f<\/p>\n\n\n\n

lsblk -f<\/p>\n\n\n\n

4\u3001\u683c\u5f0f\u5316\u78c1\u76d8\/dev\/sdb\uff0c\u8bbe\u7f6e\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b\u4e3axfs\uff0csdb\u662f\u793a\u4f8b\u9700\u6839\u636e\u60c5\u51b5\u66f4\u6539\u3002\u6ce8\u610f\u78c1\u76d8\u5185\u662f\u5426\u6709\u6570\u636e\u518d\u786e\u5b9a\u683c\u5f0f\u5316\u78c1\u76d8<\/strong><\/p>\n\n\n\n

mkfs.xfs \/dev\/sdb<\/p>\n\n\n\n

5\u3001\u628a\/dev\/sdb\u78c1\u76d8\uff0c\u6302\u8f7d\u5230\u6240\u9700\u76ee\u5f55\uff0c\u5217\u5982\/opt\u76ee\u5f55<\/p>\n\n\n\n

mount \/dev\/sdb \/opt<\/p>\n\n\n\n

6\u3001\u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\uff0c\u6587\u4ef6\u4fe1\u606f\u4e00\u5b9a\u8981\u586b\u5199\u6b63\u786e\u4e0d\u7136\u670d\u52a1\u5668\u91cd\u542f\u540e\u4f1a\u62a5\u9519<\/p>\n\n\n\n

vi \/etc\/fstab<\/p>\n\n\n\n

7\u3001\u670d\u52a1\u5668\u91cd\u542f<\/p>\n\n\n\n

reboot<\/p>\n\n\n\n

\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u5bfb\u627e\u5ba2\u670d\u652f\u6301<\/p>\n\n\n\n

\"\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u5bfb\u627e\u5ba2\u670d\u652f\u6301\"<\/figure>\n","protected":false},"excerpt":{"rendered":"

\u4e00\u3001\u5e38\u7528\u547d\u4ee4\u548c\u65e5\u5fd7 \u5e38\u7528\u547d\u4ee4 1\u3001\u542f\u52a8\u6216\u505c\u6b62\u6574\u4e2a\u4e91 […]<\/p>\n","protected":false},"author":1,"featured_media":7637,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[21,25,57],"class_list":["post-7734","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowstore","tag-linux","tag-25","tag-57"],"_links":{"self":[{"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/posts\/7734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/comments?post=7734"}],"version-history":[{"count":0,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/posts\/7734\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.yliyun.com\/wp-json\/"}],"wp:attachment":[{"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/media?parent=7734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/categories?post=7734"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/tags?post=7734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}