如何在CentOS 8/RHEL 8上安裝和使用Cockpit
Cockpit 是一個(gè)基于 Web 的服務(wù)器管理工具,可用于 CentOS 和 RHEL 系統(tǒng)。最近發(fā)布的 CentOS 8 和 RHEL 8,其中 cockpit 是默認(rèn)的服務(wù)器管理工具。它的軟件包在默認(rèn)的 CentOS 8 和 RHEL 8 倉(cāng)庫(kù)中就有。Cockpit 是一個(gè)有用的基于 Web 的 GUI 工具,系統(tǒng)管理員可以通過(guò)該工具監(jiān)控和管理 Linux 服務(wù)器,它還可用于管理服務(wù)器、容器、虛擬機(jī)中的網(wǎng)絡(luò)和存儲(chǔ),以及檢查系統(tǒng)和應(yīng)用的日志。
在本文中,我們將演示如何在 CentOS 8 和 RHEL 8 中安裝和設(shè)置 Cockpit。
在 CentOS 8/RHEL 8 上安裝和設(shè)置Cockpit
登錄你的 CentOS 8/RHEL 8,打開(kāi)終端并執(zhí)行以下 dnf
命令:
[root@linuxtechi ~]# dnf install cockpit -y
運(yùn)行以下命令啟用并啟動(dòng) cockpit 服務(wù):
[root@linuxtechi ~]# systemctl start cockpit.socket
[root@linuxtechi ~]# systemctl enable cockpit.socket
使用以下命令在系統(tǒng)防火墻中允許 Cockpit 端口:
[root@linuxtechi ~]# firewall-cmd --permanent --add-service=cockpit
[root@linuxtechi ~]# firewall-cmd --reload
驗(yàn)證 cockpit 服務(wù)是否已啟動(dòng)和運(yùn)行,執(zhí)行以下命令:
[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 上訪(fǎng)問(wèn) Cockpit
正如我們?cè)谏厦婷畹妮敵鲋锌吹降模琧ockpit 正在監(jiān)聽(tīng) tcp 9090 端口,打開(kāi)你的 Web 瀏覽器并輸入 url:https://<Your-CentOS8/RHEL8-System-IP>:9090
。
CentOS8-cockpit-login-screen
RHEL 8 中的 Cockpit 登錄頁(yè)面:
RHEL8-Cockpit-Login-Screen
使用有管理員權(quán)限的用戶(hù)名,或者我們也可以使用 root 用戶(hù)的密碼登錄。如果要將管理員權(quán)限分配給任何本地用戶(hù),請(qǐng)執(zhí)行以下命令:
[root@linuxtechi ~]# usermod -G wheel pkumar
這里 pkumar
是我的本地用戶(hù),
在輸入用戶(hù)密碼后,選擇 “Reuse my password for privileged tasks”,然后單擊 “Log In”,然后我們看到以下頁(yè)面:
cockpit-dashboard-centos8
在左側(cè)欄上,我們可以看到可以通過(guò) cockpit GUI 監(jiān)控和配置的內(nèi)容,
假設(shè)你要檢查 CentOS 8/RHEL 8 中是否有任何可用更新,請(qǐng)單擊 “System Updates”:
Software-Updates-Cockpit-GUI-CentOS8-RHEL8
要安裝所有更新,點(diǎn)擊 “Install All Updates”:
Install-Software-Updates-CentOS8-RHEL8
如果想要修改網(wǎng)絡(luò)并要添加 Bond 接口和網(wǎng)橋,請(qǐng)單擊 “Networking”:
Networking-Cockpit-Dashboard-CentOS8-RHEL8
如上所見(jiàn),我們有創(chuàng)建 Bond 接口、網(wǎng)橋和 VLAN 標(biāo)記接口的選項(xiàng)。
假設(shè)我們想創(chuàng)建一個(gè) br0
網(wǎng)橋,并要為它添加 enp0s3
端口,單擊 “Add Bridge”:
將網(wǎng)橋名稱(chēng)指定為 br0
,將端口指定為 enp0s3
,然后單擊“Apply”。
Add-Bridge-Cockpit-CentOS8-RHEL8
在下個(gè)頁(yè)面,我們將看到該網(wǎng)橋處于活動(dòng)狀態(tài),并且獲得了與 enp0s3 接口相同的 IP:
Bridge-Details-Cockpit-Dashboard-CentOS8-RHEL8
如果你想檢查系統(tǒng)日志,單擊 “Logs”,我們可以根據(jù)嚴(yán)重性查看日志:
System-Logs-Cockpit-Dashboard-CentOS8-RHEL8
本文就是這些了,類(lèi)似地,系統(tǒng)管理員可以使用 cockpit 的其他功能來(lái)監(jiān)控和管理 CentOS 8 和 RHEL 8 服務(wù)器。如果這些步驟可以幫助你在 Linux 服務(wù)器上設(shè)置 cockpit,請(qǐng)?jiān)谙旅娴脑u(píng)論欄分享你的反饋和意見(jiàn)。