{"id":2472,"date":"2020-11-19T10:08:31","date_gmt":"2020-11-19T02:08:31","guid":{"rendered":"http:\/\/blog.ywdevops.cn\/?p=2472"},"modified":"2024-06-03T17:32:07","modified_gmt":"2024-06-03T09:32:07","slug":"nightingale","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2020\/11\/19\/nightingale\/","title":{"rendered":"\u591c\u83ba\u76d1\u63a7\u5355\u8282\u70b9\u90e8\u7f72(v3)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u591c\u83ba\u67b6\u6784\u56fe\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"448\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/06\/19.png\" alt=\"\" class=\"wp-image-17094\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/06\/19.png 818w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/06\/19-300x164.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/06\/19-768x421.png 768w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/06\/19-600x329.png 600w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6559\u7a0b\u90e8\u7f72\u591c\u83ba\u7684\u65b9\u5f0f\u4e3a\u5355\u8282\u70b9\u90e8\u7f72<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u73af\u5883\u51c6\u5907\uff1acentos7\u7cfb\u7edf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9700\u8981\u5b89\u88c5\u5305\uff1amariadb(mysql)\u3001redis\u3001nginx\u3001\u591c\u83ba\u76f8\u5173\u5305<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u5b89\u88c5\u57fa\u7840\u8d44\u6e90\u5305\uff0c\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7yum\u5b89\u88c5\u5373\u53ef\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">yum  -y install  nginx  redis  mariadb*<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u521b\u5efa\u76ee\u5f55\/home\/n9e \uff0c\u7136\u540e\u5c06\u4e0b\u8f7d\u597d\u7684\u4e8c\u8fdb\u5236\u5305\u89e3\u538b\u5230\u6b64\u76ee\u5f55\u4e0b\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/home\/n9e\nwget http:\/\/116.85.64.82\/n9e.tar.gz\ntar -xf n9e.tar.gz -C \/home\/n9e<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"318\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/11\/123.png\" alt=\"\" class=\"wp-image-2473\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/11\/123.png 596w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/11\/123-300x160.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\u610f\uff1a\/home\/n9e\u8868\u793a\u9ed8\u8ba4\u76ee\u5f55\uff0c\u5982\u679c\u8981\u4fee\u6539\u8fd8\u9700\u8981\u53bb\u4fee\u6539nginx\u7684\u914d\u7f6e\u6587\u4ef6nginx.conf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001 \u521d\u59cb\u5316\u6570\u636e\u5e93\uff0c\u8fd9\u91cc\u5047\u8bbe\u4f7f\u7528root\u8d26\u53f7\uff0c\u5bc6\u78011234\uff0c<strong>\u5982\u679c\u4e0d\u662f\u8fd9\u4e2a\u8d26\u53f7\u5bc6\u7801\uff0c\u6ce8\u610f\u4fee\u6539\/home\/n9e\/etc\/mysql.yml <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/home\/n9e\/sql\nmysql -uroot -p1234 &lt; n9e_ams.sql\nmysql -uroot -p1234 &lt; n9e_hbs.sql\nmysql -uroot -p1234 &lt; n9e_job.sql\nmysql -uroot -p1234 &lt; n9e_mon.sql\nmysql -uroot -p1234 &lt; n9e_rdb.sql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001 redis\u914d\u7f6e\u4fee\u6539\uff0c\u9ed8\u8ba4\u914d\u7f6e\u76846379\u7aef\u53e3\uff0c\u5bc6\u7801\u4e3a\u7a7a\uff0c\u5982\u679c\u9ed8\u8ba4\u914d\u7f6e\u4e0d\u5bf9\uff0c\u53ef\u4ee5\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u770b\u5230\u591a\u4e2a\u914d\u7f6e\u6587\u4ef6\u91cc\u6709redis\u76f8\u5173\u914d\u7f6e\uff0c\u6328\u4e2a\u68c0\u67e5\u4fee\u6539\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/home\/n9e\/etc\ngrep redis -r .<\/pre>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u5982\u679crdb\u4e3a\u5206\u5e03\u5f0f\u90e8\u7f72\uff0c\u8fd8\u9700\u8981\u4fee\u6539redis\u914d\u7f6e\u6587\u4ef6bind\u4e3a0.0.0.0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001 \u4e0b\u8f7d\u524d\u7aef\u9759\u6001\u8d44\u6e90\u6587\u4ef6\uff0c\u653e\u5230\u9ed8\u8ba4\u7684\/home\/n9e\u76ee\u5f55\u4e0b\uff0c\u5982\u679c\u8981\u6539\u76ee\u5f55\uff0c\u9700\u8981\u4fee\u6539\u540e\u9762\u63d0\u5230\u7684<strong>nginx.conf <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/home\/n9e\nwget http:\/\/116.85.64.82\/pub.tar.gz\ntar zxvf pub.tar.gz<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001 \u8986\u76d6nginx.conf\uff0c\u5efa\u8bae\u5927\u5bb6\u8fd8\u662f\u770b\u4e00\u4e0b\u8fd9\u4e2a\u914d\u7f6e\uff0c\u719f\u6089\u4e00\u4e0bnginx\u914d\u7f6e\uff0c\u591c\u83ba\u4e0d\u540cweb\u4fa7\u7ec4\u4ef6\u5c31\u662f\u901a\u8fc7nginx\u7684\u4e0d\u540clocation\u533a\u5206\u7684\u3002\u8986\u76d6\u5b8c\u4e86\u914d\u7f6e\u8bb0\u5f97reload\u4e00\u4e0b\u6216\u8005\u91cd\u542fnginx <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp etc\/nginx.conf \/etc\/nginx\/nginx.conf\nsystemctl reload nginx  \u6216\u8005systemctl restart nginx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">7\u3001 \u68c0\u67e5identity.yml\uff0c\u8981\u4fdd\u8bc1\u8fd9\u4e2ashell\u53ef\u4ee5\u6b63\u5e38\u83b7\u53d6\u672c\u673aip\uff0c\u5982\u679c\u5b9e\u5728\u4e0d\u80fd\u6b63\u5e38\u83b7\u53d6\uff0c\u81ea\u5df1\u53c8\u4e0d\u61c2shell\u4e0d\u4f1a\u6539\uff0c\u5728specify\u5b57\u6bb5\u5199\u6b7b\u4e5f\u884c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u7528\u6765\u505a\u5fc3\u8df3\uff0c\u7ed9\u670d\u52a1\u7aef\u4e0a\u62a5\u672c\u673aip\nip:\n  specify: \"\"\n  shell: ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|head -n 1\n\n# MON\u3001JOB\u7684\u5ba2\u6237\u7aef\u62ff\u6765\u505a\u672c\u673a\u6807\u8bc6\nident:\n  specify: \"\"\n  shell: ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|head -n 1<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">8\u3001 \u68c0\u67e5agent.yml\u7684\u51e0\u4e2ashell\uff0c\u6328\u4e2a\u68c0\u67e5\u662f\u5426\u53ef\u4ee5\u8dd1\u901a\uff0c\u8dd1\u4e0d\u901a\u5c31\u6539\u6210\u9002\u5408\u81ea\u5df1\u7684\uff0c\u5b9e\u5728\u662f\u4e0d\u4f1a\u6539\uff0c\u76f4\u63a5\u5199\u6b7b\uff0c\u6bd4\u5982disk\u90e8\u5206\uff0c\u5199\u6b7b80Gi\u76f4\u63a5\u5199\uff1a<code>disk: echo 80Gi<\/code>\u5373\u53ef <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>report:\n  # ...\n  sn: dmidecode -s system-serial-number | tail -n 1\n\n  fields:\n    cpu: cat \/proc\/cpuinfo | grep processor | wc -l\n    mem: cat \/proc\/meminfo | grep MemTotal | awk '{printf \"%dGi\", $2\/1024\/1024}'\n    disk: df -m | grep '\/dev\/' | grep -v '\/var\/lib' | grep -v tmpfs | awk '{sum += $2};END{printf \"%dGi\", sum\/1024}'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">9\u3001 \u542f\u52a8\u5404\u4e2a\u8fdb\u7a0b\uff0c\u5305\u62ecmysql\u3001redis\u3001nginx\uff0c\u591c\u83ba\u7684\u5404\u4e2a\u7ec4\u4ef6\u76f4\u63a5\u7528control\u811a\u672c\u542f\u52a8\u5373\u53ef\uff0c\u540e\u7eed\u4e0a\u751f\u4ea7\u73af\u5883\uff0c\u53ef\u4ee5\u7528systemd\u4e4b\u7c7b\u7684\u6258\u7ba1 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/home\/n9e\n.\/control  start all || .\/control status all\nsystemctl start  nginx|mariadb|redis<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">10\u3001 \u767b\u5f55web\uff0c\u8d26\u53f7root\uff0c\u5bc6\u7801root.2020\uff0c\u8fdb\u6765\u7b2c\u4e00\u6b65\u4e00\u5b9a\u8981\u4fee\u6539\u5bc6\u7801\uff0c\u5982\u679cnginx\u62a5\u6743\u9650\u7c7b\u7684\u9519\u8bef\uff0c\u68c0\u67e5selinux\u662f\u5426\u5173\u95ed\u4e86\uff0c\u5982\u4e0b\u547d\u4ee4\u53ef\u5173\u95ed <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">setenforce 0  \u8868\u793a\u4e34\u65f6\u5173\u95ed\uff0c\u5982\u679c\u8981\u6c38\u4e45\u9700\u8981\u4fee\u6539\u914d\u7f6e\u6587\u4ef6vim \/etc\/selinux\/config<\/p>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\"><strong>\u6ce8\u610f\uff1a\u5982\u679c\u8bbe\u7f6e\u4e86\u81ea\u5df1\u7684mysql\u5bc6\u7801\u8bb0\u5f97\u66f4\u6539\/etc\/mysql.yml\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u4f8b\u5b50\u4e2d\u90e8\u7f72\u7684\u662f3.1.6\u7248\u672c\uff0c3.4.1\u7248\u672c\u4e0e3.1.6\u7248\u672c\u6709\u4e00\u4e9b\u5dee\u522b\uff0c\u9664\u4e86\u754c\u9762\u5dee\u522b\u5916\uff0c\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684cookieName\u503c\u4e5f\u4e0d\u540c\uff0c3.1.6\u7684\u503c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"599\" height=\"285\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/1-6.png\" alt=\"\" class=\"wp-image-2970\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/1-6.png 599w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/1-6-300x143.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3.4.1\u7248\u672c\u7684\u503c\u4e3a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"599\" height=\"265\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/2-4.png\" alt=\"\" class=\"wp-image-2971\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/2-4.png 599w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/2-4-300x133.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6ce8\uff1ardb\u6a21\u5757\u9700\u8981\u8fde\u63a5mysql\uff0c\u5982\u679c\u4e0d\u5728\u4e00\u53f0\u673a\u5668\u4e0a\uff0c\u9700\u8981\u4fee\u6539mysql\u5141\u8bb8rdb\u673a\u5668\u8fde\u63a5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e38\u89c1\u95ee\u9898\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u90e8\u7f72\u540e\u65e0\u76d1\u63a7\u6307\u6807\uff0c\u663e\u793ano data\uff0c\u53ef\u80fd\u662ftransfer\u6216\u8005tsdb\u6216\u8005index\u7ec4\u4ef6\u95ee\u9898\uff0c\u53ef\u5f00\u542fDEBUG\u6392\u67e5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u591c\u83ba\u67b6\u6784\u56fe\u5982\u4e0b\uff1a \u672c\u6559\u7a0b\u90e8\u7f72\u591c\u83ba\u7684\u65b9\u5f0f\u4e3a\u5355\u8282\u70b9\u90e8\u7f72 \u73af\u5883\u51c6\u5907\uff1acentos7\u7cfb\u7edf \u9700\u8981\u5b89\u88c5\u5305\uff1amariadb( [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":2474,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[109,29],"tags":[],"class_list":["post-2472","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-didi","category-yunwei"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2472"}],"version-history":[{"count":10,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2472\/revisions"}],"predecessor-version":[{"id":17096,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2472\/revisions\/17096"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/2474"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}