{"id":1032207,"date":"2024-12-31T11:31:45","date_gmt":"2024-12-31T03:31:45","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1032207.html"},"modified":"2024-12-31T11:31:47","modified_gmt":"2024-12-31T03:31:47","slug":"%e5%a6%82%e4%bd%95%e5%b0%86python%e4%bb%a3%e7%a0%81%e9%83%a8%e7%bd%b2%e5%9c%a8linux","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1032207.html","title":{"rendered":"\u5982\u4f55\u5c06python\u4ee3\u7801\u90e8\u7f72\u5728linux"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/d0be956b-566e-4c1d-bbee-43776a5e14a0.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u5c06python\u4ee3\u7801\u90e8\u7f72\u5728linux\" \/><\/p>\n<p><p> <strong>\u8981\u5c06Python\u4ee3\u7801\u90e8\u7f72\u5728Linux\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8bbe\u7f6ePython\u73af\u5883\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u3001\u5c06\u4ee3\u7801\u4f20\u8f93\u5230\u670d\u52a1\u5668\u3001\u914d\u7f6e\u548c\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f<\/strong>\u3002\u5176\u4e2d\uff0c\u8bbe\u7f6ePython\u73af\u5883\u662f\u6700\u5173\u952e\u7684\u4e00\u6b65\uff0c\u56e0\u4e3a\u5b83\u786e\u4fdd\u4f60\u7684\u4ee3\u7801\u80fd\u591f\u5728\u670d\u52a1\u5668\u4e0a\u987a\u5229\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u8bbe\u7f6ePython\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5728\u90e8\u7f72Python\u4ee3\u7801\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u4e86Python\u53ca\u5176\u4f9d\u8d56\u9879\u3002\u9996\u5148\uff0c\u68c0\u67e5\u670d\u52a1\u5668\u4e0a\u662f\u5426\u5df2\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt-get update<\/p>\n<p>sudo apt-get install python3 python3-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5efa\u8bae\u521b\u5efa\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u9879\u76ee\u7684\u4f9d\u8d56\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m venv myenv<\/p>\n<p>source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u865a\u62df\u73af\u5883\u6fc0\u6d3b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>pip<\/code> \u6765\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install -r requirements.txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u865a\u62df\u73af\u5883\u4e0d\u4ec5\u80fd\u591f\u907f\u514d\u4f9d\u8d56\u51b2\u7a81\uff0c\u8fd8\u80fd\u786e\u4fdd\u4e0d\u540c\u9879\u76ee\u95f4\u7684\u4f9d\u8d56\u72ec\u7acb\u7ba1\u7406\u3002<\/strong>\u8fd9\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u6b65\uff0c\u5c24\u5176\u662f\u5f53\u4f60\u5728\u540c\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u591a\u4e2a\u9879\u76ee\u65f6\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56<\/p>\n<\/p>\n<p><p>\u9664\u4e86Python\u73af\u5883\uff0c\u8fd8\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u7cfb\u7edf\u7ea7\u4f9d\u8d56\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u4ee3\u7801\u4f9d\u8d56\u4e8e\u67d0\u4e9b\u7cfb\u7edf\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt-get install libname-dev<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u786e\u4fdd\u6240\u6709\u4f9d\u8d56\u9879\u90fd\u5728 <code>requirements.txt<\/code> \u6587\u4ef6\u4e2d\u5217\u51fa\uff0c\u8fd9\u6837\u53ef\u4ee5\u901a\u8fc7\u4e00\u6761\u547d\u4ee4\u5feb\u901f\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install -r requirements.txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u5c06\u4ee3\u7801\u4f20\u8f93\u5230\u670d\u52a1\u5668<\/p>\n<\/p>\n<p><p>\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5c06\u4ee3\u7801\u4f20\u8f93\u5230\u670d\u52a1\u5668\u4e0a\uff0c\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 <code>scp<\/code> \u6216\u8005 <code>rsync<\/code>\u3002\u4f8b\u5982\uff0c\u4f7f\u7528 <code>scp<\/code> \u53ef\u4ee5\u5c06\u672c\u5730\u4ee3\u7801\u4f20\u8f93\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">scp -r \/path\/to\/local\/code username@server:\/path\/to\/remote\/directory<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\u4f7f\u7528 <code>rsync<\/code> \u8fdb\u884c\u540c\u6b65\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">rsync -avz \/path\/to\/local\/code username@server:\/path\/to\/remote\/directory<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u914d\u7f6e\u548c\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f<\/p>\n<\/p>\n<p><p>\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u7684\u7c7b\u578b\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u5f0f\u6765\u542f\u52a8\u548c\u7ba1\u7406\u5b83\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8eWeb\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>gunicorn<\/code> \u4f5c\u4e3a\u5e94\u7528\u670d\u52a1\u5668\uff0c\u5e76\u4f7f\u7528 <code>nginx<\/code> \u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u5b89\u88c5 <code>gunicorn<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install gunicorn<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">gunicorn --bind 0.0.0.0:8000 myapp:app<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e3a\u4e86\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u5728\u91cd\u542f\u540e\u81ea\u52a8\u542f\u52a8\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>systemd<\/code> \u6765\u7ba1\u7406\u670d\u52a1\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 <code>systemd<\/code> \u670d\u52a1\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo nano \/etc\/systemd\/system\/myapp.service<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-ini\">[Unit]<\/p>\n<p>Description=My Python Application<\/p>\n<p>After=network.target<\/p>\n<p>[Service]<\/p>\n<p>User=username<\/p>\n<p>Group=www-data<\/p>\n<p>WorkingDirectory=\/path\/to\/remote\/directory<\/p>\n<p>ExecStart=\/path\/to\/remote\/directory\/myenv\/bin\/gunicorn --workers 3 --bind unix:\/path\/to\/remote\/directory\/myapp.sock myapp:app<\/p>\n<p>[Install]<\/p>\n<p>WantedBy=multi-user.target<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u65b0\u52a0\u8f7d <code>systemd<\/code> \u914d\u7f6e\u5e76\u542f\u52a8\u670d\u52a1\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo systemctl daemon-reload<\/p>\n<p>sudo systemctl start myapp<\/p>\n<p>sudo systemctl enable myapp<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u914d\u7f6e <code>nginx<\/code> \u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 <code>nginx<\/code> \u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo nano \/etc\/nginx\/sites-av<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>lable\/myapp<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-nginx\">server {<\/p>\n<p>    listen 80;<\/p>\n<p>    server_name example.com;<\/p>\n<p>    location \/ {<\/p>\n<p>        proxy_pass http:\/\/unix:\/path\/to\/remote\/directory\/myapp.sock;<\/p>\n<p>        proxy_set_header Host $host;<\/p>\n<p>        proxy_set_header X-Real-IP $remote_addr;<\/p>\n<p>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<\/p>\n<p>        proxy_set_header X-Forwarded-Proto $scheme;<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u521b\u5efa\u7b26\u53f7\u94fe\u63a5\u5230 <code>sites-enabled<\/code> \u76ee\u5f55\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo ln -s \/etc\/nginx\/sites-available\/myapp \/etc\/nginx\/sites-enabled<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6d4b\u8bd5 <code>nginx<\/code> \u914d\u7f6e\u5e76\u91cd\u65b0\u52a0\u8f7d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo nginx -t<\/p>\n<p>sudo systemctl restart nginx<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u73b0\u5728\uff0c\u4f60\u7684Python\u5e94\u7528\u7a0b\u5e8f\u5df2\u7ecf\u90e8\u7f72\u5e76\u53ef\u4ee5\u901a\u8fc7\u57df\u540d\u8bbf\u95ee\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u76d1\u63a7\u548c\u65e5\u5fd7\u7ba1\u7406<\/p>\n<\/p>\n<p><p>\u90e8\u7f72\u5b8c\u6210\u540e\uff0c\u76d1\u63a7\u548c\u65e5\u5fd7\u7ba1\u7406\u662f\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u7a33\u5b9a\u8fd0\u884c\u7684\u91cd\u8981\u73af\u8282\u3002\u53ef\u4ee5\u4f7f\u7528 <code>systemd<\/code> \u548c <code>nginx<\/code> \u7684\u65e5\u5fd7\u529f\u80fd\u6765\u76d1\u63a7\u5e94\u7528\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u6001\u3002<\/p>\n<\/p>\n<p><p>\u67e5\u770b <code>systemd<\/code> \u670d\u52a1\u65e5\u5fd7\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">journalctl -u myapp<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u67e5\u770b <code>nginx<\/code> \u8bbf\u95ee\u548c\u9519\u8bef\u65e5\u5fd7\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo tail -f \/var\/log\/nginx\/access.log<\/p>\n<p>sudo tail -f \/var\/log\/nginx\/error.log<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u7684\u76d1\u63a7\u548c\u7ba1\u7406\uff0c\u53ef\u4ee5\u4f7f\u7528\u76d1\u63a7\u5de5\u5177\u5982 <code>Prometheus<\/code> \u548c <code>Grafana<\/code>\uff0c\u6216\u8005\u4f7f\u7528\u65e5\u5fd7\u6536\u96c6\u5de5\u5177\u5982 <code>ELK<\/code>\uff08Elasticsearch, Logstash, Kibana\uff09\u5806\u6808\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u5b89\u5168\u548c\u4f18\u5316<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u5168\u6027\uff0c\u9700\u8981\u8fdb\u884c\u4ee5\u4e0b\u51e0\u9879\u914d\u7f6e\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528\u9632\u706b\u5899<\/strong>\uff1a\u914d\u7f6e\u9632\u706b\u5899\u6765\u9650\u5236\u4e0d\u5fc5\u8981\u7684\u7aef\u53e3\u8bbf\u95ee\u3002\u4f8b\u5982\uff0c\u4f7f\u7528 <code>ufw<\/code> \u914d\u7f6e\u9632\u706b\u5899\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">sudo ufw allow OpenSSH<\/p>\n<p>sudo ufw allow &#39;Nginx Full&#39;<\/p>\n<p>sudo ufw enable<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528SSL\/TLS<\/strong>\uff1a\u914d\u7f6e <code>nginx<\/code> \u4f7f\u7528SSL\/TLS\u8bc1\u4e66\u6765\u52a0\u5bc6\u4f20\u8f93\u6570\u636e\u3002\u53ef\u4ee5\u4f7f\u7528 <code>Let&#39;s Encrypt<\/code> \u514d\u8d39\u83b7\u53d6SSL\u8bc1\u4e66\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">sudo apt-get install certbot python3-certbot-nginx<\/p>\n<p>sudo certbot --nginx -d example.com<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u4f18\u5316\u6027\u80fd<\/strong>\uff1a\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u7684\u9700\u6c42\uff0c\u8c03\u6574 <code>nginx<\/code> \u548c <code>gunicorn<\/code> \u7684\u914d\u7f6e\u6765\u4f18\u5316\u6027\u80fd\u3002\u4f8b\u5982\uff0c\u589e\u52a0 <code>gunicorn<\/code> \u7684\u5de5\u4f5c\u8fdb\u7a0b\u6570\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">ExecStart=\/path\/to\/remote\/directory\/myenv\/bin\/gunicorn --workers 5 --bind unix:\/path\/to\/remote\/directory\/myapp.sock myapp:app<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u6210\u529f\u5730\u5c06Python\u4ee3\u7801\u90e8\u7f72\u5230Linux\u670d\u52a1\u5668\u4e0a\uff0c\u5e76\u786e\u4fdd\u5176\u7a33\u5b9a\u3001\u5b89\u5168\u5730\u8fd0\u884c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684Linux\u7248\u672c\u6765\u90e8\u7f72Python\u4ee3\u7801\uff1f<\/strong><br \/>\u9009\u62e9Linux\u7248\u672c\u65f6\uff0c\u8003\u8651\u5230\u60a8\u9879\u76ee\u7684\u9700\u6c42\u548c\u517c\u5bb9\u6027\u975e\u5e38\u91cd\u8981\u3002\u5e38\u89c1\u7684\u9009\u62e9\u5305\u62ecUbuntu\u3001CentOS\u548cDebian\u7b49\u3002Ubuntu\u9002\u5408\u5feb\u901f\u5f00\u53d1\u548c\u90e8\u7f72\uff0cCentOS\u5219\u66f4\u9002\u5408\u9700\u8981\u957f\u671f\u652f\u6301\u548c\u7a33\u5b9a\u6027\u7684\u4f01\u4e1a\u73af\u5883\u3002\u786e\u4fdd\u6240\u9009Linux\u7248\u672c\u652f\u6301\u60a8\u6240\u9700\u7684Python\u7248\u672c\u53ca\u76f8\u5173\u5e93\u3002<\/p>\n<p><strong>\u5728Linux\u4e0a\u90e8\u7f72Python\u4ee3\u7801\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4f9d\u8d56\u9879\uff1f<\/strong><br \/>\u5728\u90e8\u7f72Python\u4ee3\u7801\u4e4b\u524d\uff0c\u52a1\u5fc5\u786e\u8ba4\u6240\u6709\u4f9d\u8d56\u9879\u5df2\u7ecf\u5b89\u88c5\u3002\u4f7f\u7528<code>requirements.txt<\/code>\u6587\u4ef6\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u548c\u5b89\u88c5\u4f9d\u8d56\u9879\u3002\u901a\u8fc7\u8fd0\u884c<code>pip install -r requirements.txt<\/code>\u547d\u4ee4\uff0c\u60a8\u53ef\u4ee5\u786e\u4fdd\u6240\u6709\u5fc5\u8981\u7684\u5e93\u90fd\u88ab\u6b63\u786e\u5b89\u88c5\u3002\u6b64\u5916\uff0c\u6ce8\u610f\u64cd\u4f5c\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5668\uff08\u5982apt\u6216yum\uff09\u4e5f\u80fd\u5e2e\u52a9\u5b89\u88c5\u67d0\u4e9b\u7cfb\u7edf\u7ea7\u7684\u4f9d\u8d56\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Linux\u4e0a\u8bbe\u7f6ePython\u865a\u62df\u73af\u5883\u4ee5\u907f\u514d\u5e93\u51b2\u7a81\uff1f<\/strong><br \/>\u5728Linux\u4e0a\u4f7f\u7528Python\u865a\u62df\u73af\u5883\u662f\u7ba1\u7406\u9879\u76ee\u4f9d\u8d56\u7684\u6709\u6548\u65b9\u6cd5\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\u3002\u547d\u4ee4\u4e3a<code>python3 -m venv myenv<\/code>\uff0c\u5176\u4e2d<code>myenv<\/code>\u4e3a\u60a8\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u6240\u6709\u5b89\u88c5\u7684\u5e93\u5c06\u4ec5\u5728\u6b64\u73af\u5883\u4e2d\u53ef\u7528\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u4e0e\u7cfb\u7edf\u7ea7Python\u5e93\u53d1\u751f\u51b2\u7a81\u3002<\/p>\n<p><strong>\u5982\u4f55\u76d1\u63a7\u90e8\u7f72\u5728Linux\u4e0a\u7684Python\u5e94\u7528\u7684\u6027\u80fd\u548c\u9519\u8bef\uff1f<\/strong><br \/>\u76d1\u63a7Python\u5e94\u7528\u7684\u6027\u80fd\u548c\u9519\u8bef\u662f\u786e\u4fdd\u5176\u6b63\u5e38\u8fd0\u884c\u7684\u5173\u952e\u3002\u53ef\u4ee5\u4f7f\u7528\u5de5\u5177\u5982Prometheus\u548cGrafana\u8fdb\u884c\u6027\u80fd\u76d1\u63a7\uff0c\u6216\u8005\u4f7f\u7528Sentry\u7b49\u5de5\u5177\u6765\u6355\u6349\u548c\u62a5\u544a\u8fd0\u884c\u65f6\u9519\u8bef\u3002\u7ed3\u5408\u8fd9\u4e9b\u76d1\u63a7\u5de5\u5177\uff0c\u53ef\u4ee5\u5b9e\u65f6\u83b7\u53d6\u5e94\u7528\u7684\u5065\u5eb7\u72b6\u6001\uff0c\u5e76\u53ca\u65f6\u5904\u7406\u6f5c\u5728\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5c06Python\u4ee3\u7801\u90e8\u7f72\u5728Linux\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8bbe\u7f6ePython\u73af\u5883\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u3001\u5c06\u4ee3\u7801\u4f20\u8f93\u5230\u670d [&hellip;]","protected":false},"author":3,"featured_media":1032221,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1032207"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1032207"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1032207\/revisions"}],"predecessor-version":[{"id":1032222,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1032207\/revisions\/1032222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1032221"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1032207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1032207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1032207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}