如何在 CentOS 8/RHEL 8 上安裝和使用 Cockpit

Linux中國發表於2019-10-13

Cockpit 是一個基於 Web 的伺服器管理工具,可用於 CentOS 和 RHEL 系統。最近釋出的 CentOS 8 和 RHEL 8,其中 cockpit 是預設的伺服器管理工具。它的軟體包在預設的 CentOS 8 和 RHEL 8 倉庫中就有。Cockpit 是一個有用的基於 Web 的 GUI 工具,系統管理員可以通過該工具監控和管理 Linux 伺服器,它還可用於管理伺服器、容器、虛擬機器中的網路和儲存,以及檢查系統和應用的日誌。

在本文中,我們將演示如何在 CentOS 8 和 RHEL 8 中安裝和設定 Cockpit。

在 CentOS 8/RHEL 8 上安裝和設定Cockpit

登入你的 CentOS 8/RHEL 8,開啟終端並執行以下 dnf 命令:

[root@linuxtechi ~]# dnf install cockpit -y

執行以下命令啟用並啟動 cockpit 服務:

[root@linuxtechi ~]# systemctl start cockpit.socket
[root@linuxtechi ~]# systemctl enable cockpit.socket

使用以下命令在系統防火牆中允許 Cockpit 埠:

[root@linuxtechi ~]# firewall-cmd --permanent --add-service=cockpit
[root@linuxtechi ~]# firewall-cmd --reload

驗證 cockpit 服務是否已啟動和執行,執行以下命令:

[root@linuxtechi ~]# systemctl status cockpit.socket
[root@linuxtechi ~]# ss -tunlp | grep cockpit
[root@linuxtechi ~]# ps auxf|grep cockpit

cockpit-status-centos8-rhel8

在 CentOS 8/RHEL 8 上訪問 Cockpit

正如我們在上面命令的輸出中看到的,cockpit 正在監聽 tcp 9090 埠,開啟你的 Web 瀏覽器並輸入 url:https://<Your-CentOS8/RHEL8-System-IP>:9090

CentOS8-cockpit-login-screen

RHEL 8 中的 Cockpit 登入頁面:

RHEL8-Cockpit-Login-Screen

使用有管理員許可權的使用者名稱,或者我們也可以使用 root 使用者的密碼登入。如果要將管理員許可權分配給任何本地使用者,請執行以下命令:

[root@linuxtechi ~]# usermod -G wheel pkumar

這裡 pkumar 是我的本地使用者,

在輸入使用者密碼後,選擇 “Reuse my password for privileged tasks”,然後單擊 “Log In”,然後我們看到以下頁面:

cockpit-dashboard-centos8

在左側欄上,我們可以看到可以通過 cockpit GUI 監控和配置的內容,

假設你要檢查 CentOS 8/RHEL 8 中是否有任何可用更新,請單擊 “System Updates”:

Software-Updates-Cockpit-GUI-CentOS8-RHEL8

要安裝所有更新,點選 “Install All Updates”:

Install-Software-Updates-CentOS8-RHEL8

如果想要修改網路並要新增 Bond 介面和網橋,請單擊 “Networking”:

Networking-Cockpit-Dashboard-CentOS8-RHEL8

如上所見,我們有建立 Bond 介面、網橋和 VLAN 標記介面的選項。

假設我們想建立一個 br0 網橋,並要為它新增 enp0s3 埠,單擊 “Add Bridge”:

將網橋名稱指定為 br0,將埠指定為 enp0s3,然後單擊“Apply”。

Add-Bridge-Cockpit-CentOS8-RHEL8

在下個頁面,我們將看到該網橋處於活動狀態,並且獲得了與 enp0s3 介面相同的 IP:

Bridge-Details-Cockpit-Dashboard-CentOS8-RHEL8

如果你想檢查系統日誌,單擊 “Logs”,我們可以根據嚴重性檢視日誌:

System-Logs-Cockpit-Dashboard-CentOS8-RHEL8

本文就是這些了,類似地,系統管理員可以使用 cockpit 的其他功能來監控和管理 CentOS 8 和 RHEL 8 伺服器。如果這些步驟可以幫助你在 Linux 伺服器上設定 cockpit,請在下面的評論欄分享你的反饋和意見。


via: https://www.linuxtechi.com/install-use-cockpit-tool-centos8-rhel8/

作者:Pradeep Kumar 選題:lujun9972 譯者:geekpi 校對:wxy

本文由 LCTT 原創編譯,Linux中國 榮譽推出

如何在 CentOS 8/RHEL 8 上安裝和使用 Cockpit

訂閱“Linux 中國”官方小程式來檢視

相關文章