{"id":7032,"date":"2022-06-27T18:45:08","date_gmt":"2022-06-27T10:45:08","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=7032"},"modified":"2022-06-28T05:16:43","modified_gmt":"2022-06-27T21:16:43","slug":"coreos835-stable-version-install","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/coreos835-stable-version-install.html","title":{"rendered":"CoreOS 835.12.0 \u7a33\u5b9a\u7248\u5b89\u88c5"},"content":{"rendered":"
\n

\u672c\u6587\u7531lrxjmw.cn\u56e2\u961f\u6210\u5458\u5cb3\u56fd\u5e05<\/span>\u6574\u7406\u53d1\u5e03\uff0c\u539f\u6587\u6765\u81ea\uff1aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66<\/a>\u3002<\/p>\n<\/div>\n\n\n\n
\u5bfc\u8bfb<\/td>\nCoreOS\u662f\u4e00\u4e2a\u57fa\u4e8eDocker\u7684\u8f7b\u91cf\u7ea7\u5bb9\u5668\u5316Linux\u53d1\u884c\u7248\uff0c\u4e3aDocker\u800c\u751f\uff0cCoreOS\u4f5c\u4e3aDocker\u751f\u6001\u5708\u4e2d\u7684\u91cd\u8981\u4e00\u5458\uff0c\u65e5\u76ca\u5f97\u5230\u5404\u5927\u4e91\u670d\u52a1\u5546\u7684\u91cd\u89c6\uff0c\u53d1\u5c55\u98ce\u5934\u6b63\u52b2\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
CoreOS\u5ba3\u79f0\u6700\u5c0f\u5316\u7684\u5b9a\u5236\u7248linux\u7cfb\u7edf\uff1a<\/strong><\/div>\n
    \n
  1. \n
    \u00a0Linux\u5185\u6838<\/strong><\/span><\/div>\n

    Linux\u8fd0\u884c\u6240\u9700\u5b58\u5728\u4e24\u4e2aROOT\u5206\u533a\uff0c\u4e00\u4e2a\u88ab\u7528\u4f5c\u542f\u52a8\u5206\u533a\uff0c\u4e00\u4e2a\u88ab\u7528\u4f5c\u66f4\u65b0\u5206\u533a\u66f4\u65b0\u5206\u533a\u5728\u66f4\u65b0\u5b8c\u6210\u540e\uff0c\u81ea\u52a8\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\uff0c\u5f53\u524d\u673a\u5668\u4e0d\u9700\u8981\u4ece\u8d1f\u8f7d\u96c6\u7fa4\u4e2d\u79fb\u9664\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u5176\u5b83\u5e94\u7528\u7a0b\u5e8f\u4e0d\u88ab\u6253\u65ad\uff0c\u4f1a\u901a\u8fc7Linux cgroup\u9650\u5236\u66f4\u65b0\u8fc7\u7a0b\u4e2d\u7684\u78c1\u76d8\u3001\u7f51\u7edc\u7b49IO\u4f7f\u7528\u3002<\/li>\n

  2. \n
    systemd<\/strong><\/span><\/div>\n

    \u4f5c\u4e3a\u9ed8\u8ba4\u7cfb\u7edf\u548c\u670d\u52a1\u7ba1\u7406\u5668\uff0c\u5176\u4f18\u79c0\u7279\u6027\uff1a<\/p>\n

    \u652f\u6301\u5e76\u884c\u5316\u4efb\u52a1\uff1b\r\n\u540c\u65f6\u91c7\u7528 socket \u5f0f\u4e0e D-Bus \u603b\u7ebf\u5f0f\u6fc0\u6d3b\u670d\u52a1\uff1b\r\n\u6309\u9700\u542f\u52a8\u5b88\u62a4\u8fdb\u7a0b\uff08daemon\uff09\uff1b\r\n\u5229\u7528 Linux \u7684 cgroups \u76d1\u89c6\u8fdb\u7a0b\uff1b\r\n\u652f\u6301\u5feb\u7167\u548c\u7cfb\u7edf\u6062\u590d\uff1b\r\n\u7ef4\u62a4\u6302\u8f7d\u70b9\u548c\u81ea\u52a8\u6302\u8f7d\u70b9\uff1b\r\n\u5404\u670d\u52a1\u95f4\u57fa\u4e8e\u4f9d\u8d56\u5173\u7cfb\u8fdb\u884c\u7cbe\u5bc6\u63a7\u5236\u3002<\/code><\/pre>\n<\/li>\n
  3. \n
    root\u5206\u533a\u88ab\u8bbe\u8ba1\u6210\u53ea\u8bfb<\/strong><\/span><\/div>\n

    root\u5206\u533a\u88ab\u8bbe\u8ba1\u6210\u53ea\u8bfb\uff0c\u7528\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u4e00\u81f4\u6027\u548c\u66f4\u65b0\u53ef\u7528<\/li>\n

  4. \n
    CPU\u3001IO\u7b49\u8d44\u6e90\u9694\u79bb<\/strong><\/span><\/div>\n

    \u81ea\u7136\u8981\u796d\u51fa\u5bb9\u5668(Container)\u6765\uff0cCoreOS\u5f88\u660e\u667a\u4f7f\u7528Docker\u4f5c\u4e3a\u5bb9\u5668\u7ba1\u7406\u5668\u7528\u4ee5\u6784\u5efa\u3001\u53d1\u5e03\u5e94\u7528\uff0c\u4ece\u8fd9\u4e2a\u5c42\u9762\u6765\u770b\uff0c\u4e00\u4e2a\u5e94\u7528\u5176\u5b9e\u5c31\u662f\u4e00\u4e2a\u5bb9\u5668\u3002<\/li>\n

  5. \n
    etcd\u7ec4\u4ef6\u8d1f\u8d23\u670d\u52a1\u53d1\u73b0\u548c\u914d\u7f6e\u5171\u4eab<\/strong><\/span><\/div>\n

    \u91c7\u7528Raft\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\u534f\u8bae\u7b97\u6cd5\uff0c\u627f\u62c5\u8d77\uff0c\u7ec4\u4ef6\u4e4b\u95f4\u670d\u52a1\u901a\u4fe1\u4f7f\u7528\u3002\u5f88\u81ea\u7136\u7684\uff0c\u5bb9\u5668(Container)\u4e4b\u95f4\u5e94\u7528\u3001\u670d\u52a1\u7684\u4f38\u7f29\uff0c\u5c31\u663e\u5f97\u5f88\u7b80\u5355\u4e86\u3002\u5176\u57fa\u56e0\u5c42\u9762\u652f\u6301\u96c6\u7fa4\u7279\u6027\uff0c\u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u89e3\u8bfb\u4e3a\u4e91\u73af\u5883\u7684\u652f\u6301\u3002<\/li>\n<\/ol>\n

    \u4e00\uff1a\u51c6\u5907SSH\u516c\u94a5\/\u79c1\u94a5 \u6216 \u5bc6\u7801 <\/strong><\/div>\n

    SSH\u516c\u94a5\/\u79c1\u94a5\u5236\u4f5c \uff1a\u5728\u5176\u4ed6linux\u5ba2\u6237\u673a\u673a\u4e0a\u6267\u884c ssh-keygen :
    \n
    \n[root@localhost ~]# ssh-keygen
    \nGenerating public\/private rsa key pair.
    \nEnter file in which to save the key (\/root\/.ssh\/id_rsa):
    \nCreated directory '\/root\/.ssh'.
    \nEnter passphrase (empty for no passphrase):
    \nEnter same passphrase again:
    \nYour identification has been saved in \/root\/.ssh\/id_rsa.
    \nYour public key has been saved in \/root\/.ssh\/id_rsa.pub.
    \nThe key fingerprint is:
    \nd3:b5:fe:05:81:55:4b:6c:be:08:aa:28:7c:0d:e4:9d root@localhost.localdomain
    \nThe key's randomart image is:
    \n+--[ RSA 2048]----+
    \n| oo.|
    \n| o.o.|
    \n| o +. |
    \n| . . o . o |
    \n| o . S o o o .|
    \n| o E o . . o |
    \n| . + . . .|
    \n| o o o . . |
    \n| o . |
    \n+-----------------+
    \n<\/code>
    \n\u4e2d\u95f4\u9700\u8981\u9009\u62e9\u7684\u6b65\u9aa4\uff0c\u5168\u90e8\u9ed8\u8ba4\u56de\u8f66\u5b8c\u6210\u3002\u7136\u540e\u5728\u5f53\u524d\u7528\u6237\u7684~\/.ssh\/\u4e0b\u9762\u751f\u6210\u4e86id_rsa id_rsa.pub2\u4e2a\u6587\u4ef6\uff0c\u5c06id_rsa.pub\u91cc\u9762\u7684\u52a0\u5bc6\u4e32\u8d34\u5728\u4e0b\u4e00\u6b65\u7684\u5bc6\u94a5\u7248 cloud-config.yaml\u6587\u4ef6 ssh-authorized-keys \u5bf9\u5e94\u7684\u503c\u4e0a\u3002<\/p>\n

    \u5bc6\u7801\u5236\u4f5c \uff1a\u5728\u5176\u4ed6linux\u5ba2\u6237\u673a\u673a\u4e0a\u6267\u884c \uff1a<\/p>\n


    \n[root@localhost ~]# openssl passwd -1 > 1234.txt
    \nPassword: [\u8f93\u5165\u5bc6\u7801]
    \nVerifying - Password: [\u518d\u6b21\u8f93\u5165\u5bc6\u7801]
    \n[root@localhost ~]#
    \n[root@localhost ~]# cat 1234.txt
    \n$1$ywWEh18N$JPwtTtm54yxmEDNegE5.Z0
    \n<\/code>
    \n\u5c061234.txt\u91cc\u9762\u7684\u52a0\u5bc6\u4e32\u8d34\u5728\u4e0b\u4e00\u6b65\u7684 \u5bc6\u7801\u7248 cloud-config.yaml\u6587\u4ef6 passwd \u5bf9\u5e94\u7684\u503c\u4e0a\u3002<\/p>\n

    \u4e8c\uff1a\u51c6\u5907cloud-config.yaml\u6587\u4ef6 <\/strong><\/div>\n

    SSH\u5bc6\u5319\u7248\u672c\uff1a<\/p>\n

     <\/p>\n

    #cloud-config<\/p>\n

    hostname: myhost<\/p>\n

    coreos:
    \netcd:
    \naddr: $private_ipv4:4001
    \npeer-addr: $private_ipv4:7001
    \nunits:
    \n- name: etcd.service
    \ncommand: start
    \n- name: fleet.service
    \ncommand: start
    \n- name: static.network
    \ncontent: |
    \n[Match]
    \nName=eno16777736<\/p>\n

    [Network]
    \nAddress=192.168.31.122\/24
    \nGateway=192.168.31.1
    \nDNS=223.5.5.5
    \nDNS=223.6.6.6
    \nusers:
    \n- name: core
    \nssh-authorized-keys:
    \n- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8C++zc+hDTWOe5DV+WnEa5\/Y+dWN1UDVKX3pBYGHbNCYObpJdYpnaHbe+3NQijt15ZAYqOh6fYJlTx8L08z\/bJvmj2n+N0hgO3onB4JsH70bSAL41FPzel7BKFnDlvJ1s3GJahdVzBsrDrCwzM96ofUcImtwji0oWPT3bMApkKa8e2Ty5+WwBuxFKDq\/MJVqBK4yJmBnylGzmEyyRnlVpQjsDGdbYjDtHU1ECU+H4oSE7o0cSBQntQeH0ckHMU9cnwnLO8IoHIYad4oY\/u+UvLq+58kO85ltioaEmTPkWBIzSB6hP\/ghHrQUN\/Kf22ECgD5H9CaDDGKHrlwJUZDq1 root@kali<\/p>\n

    - groups:
    \n- sudo
    \n- docker<\/p>\n

     <\/p>\n

    \u5bc6\u7801\u7248\u672c\uff1a<\/p>\n

     <\/p>\n

    #cloud-config<\/p>\n

    hostname: myhost<\/p>\n

    coreos:
    \netcd:
    \naddr: $private_ipv4:4001
    \npeer-addr: $private_ipv4:7001
    \nunits:
    \n- name: etcd.service
    \ncommand: start
    \n- name: fleet.service
    \ncommand: start
    \n- name: static.network
    \ncontent: |
    \n[Match]
    \nName=eno16777736<\/p>\n

    [Network]
    \nAddress=192.168.31.122\/24
    \nGateway=192.168.31.1
    \nDNS=223.5.5.5
    \nDNS=223.6.6.6
    \nusers:
    \n- name: core
    \npasswd\uff1a$1$ywWEh18N$JPwtTtm54yxmEDNegE5.Z0
    \n- groups:
    \n- sudo
    \n- docker<\/p>\n

     <\/p>\n

    \u4e09\uff1a\u4e0b\u8f7d\u53ca\u5b89\u88c5 <\/strong><\/div>\n

    \u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u7f16\u5199\u597d \u201ccloud-config.yaml\u201d\uff0c\u53ef\u4ee5\u4e0b\u8f7d\u5e76\u5b89\u88c5CoreOS\u4e86\u3002<\/p>\n

    ISO\u4e0b\u8f7d\u94fe\u63a5\uff1ahttp:\/\/stable.release.core-os.net\/amd64-usr\/current\/coreos_production_iso_image.iso<\/p>\n

    \u7528ISO\u76d8\u542f\u52a8\uff0c\u4f1a\u81ea\u52a8\u8fdb\u5165bash\u547d\u4ee4\u884c\uff0c\u7528\u6237\u4e3acore\u3002\u6ce8\u610f\u6b64\u65f6\u7cfb\u7edf\u53ea\u662f\u52a0\u8f7d\u5230RAM\u800c\u5df2\uff0c\u5e76\u672a\u5b89\u88c5\u3002<\/p>\n

    \u5982\u679c\u60f3\u8f6c\u5230root\u8eab\u4efd\u5bf9\u5f53\u524d\u914d\u7f6e\u3001\u7f51\u7edc\u7b49\u64cd\u4f5c\uff0csudo -i \u3002<\/p>\n

    \u4e0b\u8f7d \u5236\u4f5c\u597d\u7684cloud-config.yaml \u6587\u4ef6 \uff1a<\/p>\n


    \nwget http:\/\/192.168.220.137:8080\/cloud-config.yaml
    \n<\/code><\/p>\n

    \u6b64\u523b\u51c6\u5907\u5de5\u4f5c\u5df2\u7ecf\u5b8c\u6210\u4e86\uff0c\u5982\u679c\u60f3\u8981\u5b89\u88c5\u5230sda\u8fd9\u5757\u786c\u76d8\u4e0a\u3002<\/p>\n


    \n[core@server ~]$ sudo coreos-install -d \/dev\/sda -C stable -c .\/cloud-config.yaml
    \n<\/code>
    \n\u5176\u4e2d\uff1a
    \n-d \u6307\u5b9a\u76ee\u6807\u8bbe\u5907
    \n-C \u6307\u5b9a\u7248\u672c\uff0c\u8fd9\u91cc\u6211\u7528stable
    \n-c \u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\uff0ccloud-config.yaml<\/p>\n

    \u6267\u884c\u5b89\u88c5\u547d\u4ee4\u540e\uff0c\u5de5\u5177\u4f1a\u81ea\u52a8\u5230\u7f51\u7ad9\u4e0b\u8f7dCoreOS\u7684\u786c\u76d8\u955c\u50cf\uff0c\u5e76\u5b89\u88c5\u5230\u786c\u76d8\u4e0a\u9762\u3002
    \n\u770b\u5230\u8fd9\u53e5\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u4e86\uff1a
    \n
    \nSuccess! CoreOS stable 835.13.0 is installed on \/dev\/sda
    \n<\/code><\/p>\n

    \u5982\u65e0\u610f\u5916\uff0c\u5b89\u88c5\u5b8c\u4e86\u5c31\u53ef\u4ee5\u91cd\u542f\uff0c\u5e76\u53ef\u901a\u8fc7\u4e4b\u524d\u914d\u7f6e\u7684SSH\u5ba2\u6237\u7aef\u673a\u5668\u767b\u5f55\u548c\u4e4b\u524d\u8bbe\u7f6e\u7684\u5bc6\u7801\u76f4\u63a5\u767b\u5f55\u3002
    \n
    \n[root@localhost ~]# ssh core@192.168.31.122
    \nThe authenticity of host '192.168.220.143 (192.168.220.143)' can't be established.
    \nED25519 key fingerprint is fb:ba:38:e3:bc:14:21:33:0b:0e:46:a3:62:f2:9a:1f.
    \nAre you sure you want to continue connecting (yes\/no)? yes
    \nWarning: Permanently added '192.168.220.143' (ED25519) to the list of known hosts.
    \nCoreOS stable (835.13.0)
    \ncore@myhost ~ $
    \n<\/code><\/p>\n

    \n

    \u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/coreos835-stable-version-install.html<\/a>\u7f16\u8f91\uff1a\u5cb3\u56fd\u5e05\uff0c\u5ba1\u6838\u5458\uff1a\u5f20\u5b8f\u5b87<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

    \u5bfc\u8bfb CoreOS\u662f\u4e00\u4e2a\u57fa\u4e8eDocker\u7684\u8f7b\u91cf\u7ea7\u5bb9\u5668\u5316Linux\u53d1\u884c\u7248\uff0c\u4e3aDocker\u800c\u751f\uff0cCoreOS\u4f5c\u4e3aD […]<\/p>\n","protected":false},"author":317,"featured_media":3696,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-7032","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\/7032","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\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=7032"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/7032\/revisions"}],"predecessor-version":[{"id":246515,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/7032\/revisions\/246515"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/3696"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=7032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=7032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=7032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}