{"id":4131,"date":"2022-03-09T10:01:57","date_gmt":"2022-03-09T02:01:57","guid":{"rendered":"http:\/\/www.ylicloud.com\/?p=4131"},"modified":"2022-03-09T10:01:57","modified_gmt":"2022-03-09T02:01:57","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-%e4%b8%8a%e5%ae%89%e8%a3%85-cockpit","status":"publish","type":"post","link":"http:\/\/www.yliyun.com\/2022\/03\/09\/%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-%e4%b8%8a%e5%ae%89%e8%a3%85-cockpit\/","title":{"rendered":"\u5982\u4f55\u5728 CentOS 8 \u4e0a\u5b89\u88c5 Cockpit"},"content":{"rendered":"\n

Cockpit \u662f\u4e00\u4e2a\u514d\u8d39\u548c\u5f00\u6e90\u7684\u57fa\u4e8e Web \u7684\u670d\u52a1\u5668\u7ba1\u7406\u8f6f\u4ef6\u3002\u5b83\u6709\u4e00\u4e2a\u6f02\u4eae\u7684 Web \u63a7\u5236\u53f0\uff0c\u5141\u8bb8\u7cfb\u7edf\u7ba1\u7406\u5458\u8f7b\u677e\u6267\u884c\u4efb\u52a1\uff0c\u4f8b\u5982\u5b58\u50a8\u7ba1\u7406\u3001\u7f51\u7edc\u914d\u7f6e\u3001\u542f\u52a8 Docker \u5bb9\u5668\u3001\u68c0\u67e5\u670d\u52a1\u5668\u6027\u80fd\u3001\u542f\u52a8\u548c\u505c\u6b62\u670d\u52a1<\/a>\u4ee5\u53ca\u8bb8\u591a\u5176\u4ed6\u7ba1\u7406\u64cd\u4f5c\u3002Cockpit \u5728\u6211\u4eec\u7684 GNU\/Linux \u670d\u52a1\u5668\u4e2d\u7684\u4e00\u4e9b\u4ee4\u4eba\u656c\u754f\u7684\u597d\u5904\u5982\u4e0b\uff1a<\/p>\n\n\n\n

  1. \u5b83\u7531 systemd \u670d\u52a1\u7ba1\u7406\u5668\u7ec4\u6210\uff0c\u4ee5\u65b9\u4fbf\u4f7f\u7528\u3002<\/li>
  2. \u5b83\u6709\u4e00\u4e2a\u65e5\u5fd7\u65e5\u5fd7\u67e5\u770b\u5668\u6765\u6267\u884c\u6545\u969c\u6392\u9664\u548c\u65e5\u5fd7\u5206\u6790\u3002<\/li>
  3. \u5305\u62ecLVM<\/a>\u5728\u5185\u7684\u5b58\u50a8\u8bbe\u7f6e\u4ece\u672a\u5982\u6b64\u7b80\u5355\u3002<\/li>
  4. \u57fa\u672c\u7f51\u7edc\u914d\u7f6e\u53ef\u4ee5\u4e0e Cockpit \u4e00\u8d77\u5e94\u7528<\/li>
  5. \u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u6dfb\u52a0\u548c\u5220\u9664\u672c\u5730\u7528\u6237\u5e76\u7ba1\u7406\u591a\u4e2a\u670d\u52a1\u5668\u3002<\/li><\/ol>\n\n\n\n

    \u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u5728CentOS 8<\/a>\u4e0a\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684 Cockpit \u3002<\/p>\n\n\n\n

    \u5728 Centos 8\/7 \u548c RHEL 8 \u4e0a<\/h2>\n\n\n\n

    \u66f4\u65b0\u7cfb\u7edf\u5305<\/h3>\n\n\n\n

    \u5728\u6211\u4eec\u5b89\u88c5 Cockpit \u8f6f\u4ef6\u5305\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u66f4\u65b0\u7cfb\u7edf\uff1a<\/p>\n\n\n\n

    $ sudo yum -y update\nCentOS-8 - AppStream                                        1.7 kB\/s | 4.3 kB     00:02    \nCentOS-8 - Base                                             1.2 kB\/s | 3.8 kB     00:03    \nCentOS-8 - Extras                                           1.4 kB\/s | 1.5 kB     00:01    \nExtra Packages for Enterprise Linux 8 - x86_64               12 kB\/s |  32 kB     00:02    \nExtra Packages for Enterprise Linux 8 - x86_64               86 kB\/s | 1.7 MB     00:20    \nDependencies resolved. \nNothing to do.\nComplete!<\/code><\/pre>\n\n\n\n

    \u7531\u4e8e Centos 8 \u521a\u521a\u53d1\u5e03\uff0c\u5728\u64b0\u5199\u672c\u6587\u65f6\uff0c\u8fd8\u6ca1\u6709\u4efb\u4f55\u66f4\u65b0\u3002<\/p>\n\n\n\n

    \u4ece\u5b58\u50a8\u5e93\u5b89\u88c5 Cockpit \u8f6f\u4ef6\u5305<\/h3>\n\n\n\n

    \u5728 Centos 8 \u4e2d\uff0cCockpit \u8f6f\u4ef6\u5305\u9ed8\u8ba4\u5305\u542b\u5728 extras \u5b58\u50a8\u5e93\u4e2d\uff0c\u60a8\u53ef\u4ee5\u7acb\u5373\u5b89\u88c5\u5b83\uff0c\u8fd9\u4e0e Centos 7 \u4e0d\u540c\u7684\u662f\uff0c\u60a8\u9700\u8981\u5148\u6dfb\u52a0 epel repo\u3002\u6211\u4eec\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8 Cockpit \u5b89\u88c5\uff1a<\/p>\n\n\n\n

    $ sudo yum install cockpit<\/code><\/pre>\n\n\n\n
    $ sudo yum install cockpit\nLast metadata expiration check: 0:04:25 ago on Thu 26 Sep 2019 03:10:41 PM UTC.\nDependencies resolved.\n================================================================================\n Package                               Arch            Version         \n================================================================================\nInstalling:\n cockpit                               x86_64          185.1-1.el8_0            \nInstalling dependencies:\n PackageKit                            x86_64          1.1.12-2.el8    \n PackageKit-glib                       x86_64          1.1.12-2.el8            \n cairo                                 x86_64          1.15.12-3.el8      \n cairo-gobject                         x86_64          1.15.12-3.el8        \n libX11                                x86_64          1.6.7-1.el8        \n libX11-common                         noarch          1.6.7-1.el8           \n libXau                                x86_64          1.0.8-13.el8         \n libXext                               x86_64          1.3.3-9.el8          \n libXrender                            x86_64          0.9.10-7.el8         \n libxcb                                x86_64          1.13-5.el8              \n pixman                                x86_64          0.36.0-1.el8           \n python3-cairo                         x86_64          1.16.3-6.el8             \n python3-gobject                       x86_64          3.28.3-1.el8             \n python3-systemd                       x86_64          234-8.el8           \n setroubleshoot-plugins                noarch          3.3.10-1.el8        \n checkpolicy                           x86_64          2.8-2.el8                   \n\n.....        \n\nTransaction Summary\n================================================================================\nInstall  42 Packages\n\nTotal download size: 16 M\nInstalled size: 46 M\nIs this ok [y\/N]: \n<\/code><\/pre>\n\n\n\n

    \u952e\u5165\u201cy\u201d\uff0c\u5b83\u5c06\u5f00\u59cb\u4e0b\u8f7d\u548c\u5b89\u88c5\u6240\u9700\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n\n\n\n

    \u5728 Fedora \u4e0a<\/h2>\n\n\n\n

    \u540c\u6837\uff0cCentOS \u4e5f\u9ed8\u8ba4\u5728 Fedora \u7684\u5b98\u65b9\u5b58\u50a8\u5e93\u4e2d\u53ef\u7528\uff0c\u6211\u4eec\u53ea\u9700\u4f7f\u7528 dnf \u5305\u7ba1\u7406\u5668\u5b89\u88c5 cockpit\u3002<\/p>\n\n\n\n

    # dnf install cockpit<\/code><\/pre>\n\n\n\n

    \u5728 Arch Linux \u4e0a<\/h2>\n\n\n\n

    Cockpit \u76ee\u524d\u5728 Arch Linux \u7684\u5b98\u65b9\u5b58\u50a8\u5e93\u4e2d\u4e0d\u53ef\u7528\uff0c\u4f46\u5b83\u5728 Arch \u7528\u6237\u5b58\u50a8\u5e93\u4e2d\u53ef\u7528\uff0c\u4e5f\u79f0\u4e3a AUR\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u5c06\u7b80\u5355\u5730\u8fd0\u884c\u4ee5\u4e0b yaourt \u547d\u4ee4\u6765\u5b89\u88c5\u5b83\u3002<\/p>\n\n\n\n

    # yaourt cockpit<\/code><\/pre>\n\n\n\n

    \u5728 Ubuntu \u4e0a<\/h2>\n\n\n\n

    \u4f7f\u7528 apt \u547d\u4ee4\u5728 ubuntu \u6216 debian \u4e0a\u5b89\u88c5 cockpit<\/p>\n\n\n\n

    sudo apt update\nsudo apt -y install cockpit\nsudo systemctl status cockpit<\/code><\/pre>\n\n\n\n

    \u5728\u9632\u706b\u5899\u4e0a\u5141\u8bb8\u7aef\u53e3 9090<\/p>\n\n\n\n

    sudo ufw allow 9090<\/code><\/pre>\n\n\n\n

    \u542f\u7528\u5e76\u542f\u52a8 Cockpit \u670d\u52a1<\/h2>\n\n\n\n

    \u6211\u4eec\u73b0\u5728\u5fc5\u987b\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u7528 Cockpit\uff1a<\/p>\n\n\n\n

    $ sudo systemctl enable --now cockpit.socket\nCreated symlink \/etc\/systemd\/system\/sockets.target.wants\/cockpit.socket \u2192 \/usr\/lib\/systemd\/system\/cockpit.socket.\n<\/code><\/pre>\n\n\n\n

    \u5e76\u542f\u52a8 Cockpit\uff1a<\/p>\n\n\n\n

    $ sudo systemctl start cockpit<\/code><\/pre>\n\n\n\n

    \u8bbe\u7f6e\u9632\u706b\u5899<\/h2>\n\n\n\n

    \u6700\u540e\uff0c\u8ba9\u6211\u4eec\u786e\u4fdd\u9632\u706b\u5899\u4e0d\u4f1a\u963b\u6b62 Cockpit\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u60a8\u8bbf\u95ee Cockpit \u5e94\u8be5\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u4f46\u4ee5\u9632\u4e07\u4e00\u6211\u4eec\u5c06\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6253\u5f00\u6240\u9700\u7684\u7aef\u53e3\uff1a<\/p>\n\n\n\n

    $ sudo firewall-cmd --permanent --zone=public --add-service=cockpit\nWarning: ALREADY_ENABLED: cockpit\nsuccess\n\n$ sudo firewall-cmd --reload\nsuccess<\/code><\/pre>\n\n\n\n

    \u5982\u60a8\u6240\u89c1\uff0cCockpit \u5df2\u6dfb\u52a0\u5230\u9632\u706b\u5899\u89c4\u5219\u4e2d\u3002\u4f46\u6700\u597d\u8fd0\u884c\u5b83\u4ee5\u9632\u4e07\u4e00\uff0c\u5e76\u907f\u514d\u9632\u706b\u5899\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n

    Cockpit \u7684\u5b89\u88c5\u73b0\u5df2\u5b8c\u6210\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5bfc\u822a\u5230\u4ee5\u4e0b URL \u6765\u8bbf\u95ee\u4eea\u8868\u677f\uff1a<\/p>\n\n\n\n

    https://localhost:9090<\/code><\/pre>\n\n\n\n

    \u5982\u679c\u4f60\u6709\u4e00\u4e2a\u9759\u6001 IP \u5730\u5740\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\u4f60\u7684 IP \u800c\u4e0d\u662f\u201clocalhost\u201d\u6765\u4ece\u4efb\u4f55\u5730\u65b9\u8bbf\u95ee Cockpit\u3002<\/p>\n\n\n\n

    \u767b\u5f55\u9a7e\u9a76\u8231<\/h2>\n\n\n\n

    \u5bfc\u822a\u5230 Cockpit URL \u65f6\uff0c\u60a8\u53ef\u80fd\u4f1a\u6536\u5230\u6709\u5173\u7ad9\u70b9 SSL \u8bc1\u4e66\u7684\u5b89\u5168\u8b66\u544a\u63d0\u793a\uff0c\u56e0\u4e3a\u5b83\u662f\u81ea\u7b7e\u540d\u7684\u3002\u60a8\u53ef\u4ee5\u5ffd\u7565\u8b66\u544a\u5e76\u8fdb\u5165\u767b\u5f55\u533a\u57df\u3002\u4f7f\u7528\u8d85\u7ea7\u7528\u6237\u51ed\u636e\u767b\u5f55 Cockpit\u3002<\/p>\n\n\n\n

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

    \u767b\u5f55\u540e\uff0c\u60a8\u5c06\u770b\u5230\u7cfb\u7edf\u4fe1\u606f\u548c\u8d44\u6e90\u76d1\u63a7\u9875\u9762\uff1a<\/p>\n\n\n\n

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

    \u5411 Cockpit \u6dfb\u52a0\u65b0\u670d\u52a1\u5668<\/p>\n\n\n\n

    \"\u9a7e\u9a76\u8231\u4eea\u8868\u677f\"<\/figure>\n\n\n\n

    \u9a7e\u9a76\u8231\u5e10\u6237\u9875\u9762<\/p>\n\n\n\n

    \"\u9a7e\u9a76\u8231\u5e10\u6237\u9875\u9762\"<\/figure>\n\n\n\n

    Cockpit KernelDump \u9875\u9762<\/p>\n\n\n\n

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

    \u9a7e\u9a76\u8231\u7f51\u7edc\u9875\u9762<\/p>\n\n\n\n

    \"\u9a7e\u9a76\u8231\u7f51\u7edc\u9875\u9762\"<\/figure>\n\n\n\n

    Cockpit SELinux \u9875\u9762<\/p>\n\n\n\n

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

    \u9a7e\u9a76\u8231\u670d\u52a1\u9875\u9762<\/p>\n\n\n\n

    \"\u9a7e\u9a76\u8231\u670d\u52a1\u9875\u9762\"<\/figure>\n\n\n\n

    \u9a7e\u9a76\u8231\u7ec8\u7aef<\/p>\n\n\n\n

    \"\u9a7e\u9a76\u8231\u7ec8\u7aef\"<\/figure>\n\n\n\n

    \u7ed3\u8bba<\/h2>\n\n\n\n

    Cockpit \u662f\u7ba1\u7406\u5458\u548c\u5f00\u53d1\u4eba\u5458\u5fc5\u5907\u7684\u5de5\u5177\u3002\u4e00\u65e6\u4f60\u5f00\u59cb\u4f7f\u7528\u5b83\uff0c\u4f60\u5c31\u4f1a\u5c06\u5b83\u5b89\u88c5\u5728\u4f60\u6240\u6709\u7684 Linux \u670d\u52a1\u5668\u4e0a\u3002\u6b63\u5982\u6211\u4eec\u5728\u672c\u6559\u7a0b\u4e2d\u770b\u5230\u7684\uff0cCockpit \u662f\u4e00\u6b3e\u51fa\u8272\u7684 Linux \u670d\u52a1\u5668\u7ba1\u7406\u5de5\u200b\u200b\u5177\u3002\u5982\u679c\u60a8\u6709\u4efb\u4f55\u610f\u89c1\u548c\u95ee\u9898\uff0c\u8bf7\u5728\u4e0b\u9762\u7684\u8bc4\u8bba\u90e8\u5206\u53d1\u8868\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    Cockpit \u662f\u4e00\u4e2a\u514d\u8d39\u548c\u5f00\u6e90\u7684\u57fa\u4e8e Web \u7684 […]<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,15],"class_list":["post-4131","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rd","tag-centos","tag-cockpit"],"_links":{"self":[{"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/posts\/4131","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=4131"}],"version-history":[{"count":0,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/posts\/4131\/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=4131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/categories?post=4131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yliyun.com\/wp-json\/wp\/v2\/tags?post=4131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}