Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม Bash

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้น

Cockpit เป็น Remote Manager สำหรับ GNU/Linux Servers ที่ใช้งานง่าย เบา และเรียบง่ายแต่อย่างมีอำนาจ มันเป็น Interactive Server Administration User Interface ที่เสนอ Live Linux Session ผ่าน Web Browser

มันสามารถรันบนหลาย Linux Distributions ที่พัฒนาจาก RHEL และ Debian Derivatives รวมถึง Ubuntu, Linux Mint, Fedora, CentOS, Rocky Linux, AlmaLinux, Arch Linux และอื่นๆ

Cockpit ทำให้ Linux เข้าถึงได้ง่ายขึ้น ทำให้ System Administrators สามารถทำงานต่างๆ ได้อย่างง่ายและน่าเชื่อถือ เช่น เริ่ม Containers, จัดการ Storage, Network Configurations, ตรวจสอบ Logs และอื่นๆ อีกมากมาย

[ คุณอาจชอบ: 20 Command Line Tools to Monitor Linux Performance ]

ขณะใช้งาน ผู้ใช้สามารถสลับระหว่าง Linux Terminal และ Web Browser ได้อย่างราบรื่น สำคัญคือ เมื่อผู้ใช้เริ่ม Service ผ่าน Cockpit มันสามารถหยุดได้ผ่าน Terminal และในกรณีที่มีข้อผิดพลาดเกิดขึ้นใน Terminal มันจะแสดงใน Cockpit Journal Interface

คุณสมบัติของ Cockpit:

  • เปิดใช้งานการจัดการหลาย Servers ใน Cockpit Session เดียว
  • เสนอ Web-based Shell ในหน้าต่าง Terminal
  • Containers สามารถจัดการได้ผ่าน Docker
  • รองรับการจัดการ System User Accounts อย่างมีประสิทธิภาพ
  • รวบรวมข้อมูลประสิทธิภาพระบบโดยใช้ Performance Co-Pilot Framework และแสดงในรูปกราฟ
  • รองรับการรวบรวมข้อมูลการกำหนดค่าระบบและข้อมูลวินิจฉัยโดยใช้ sos-report
  • รองรับ Kubernetes Cluster หรือ Openshift v3 Cluster ด้วย
  • อนุญาตให้แก้ไข Network Settings และอื่นๆ อีกมากมาย

วิธีติดตั้ง Cockpit ใน Linux Systems

คุณสามารถติดตั้ง Cockpit ในทุก Linux Distributions จาก Default Official Repositories ของพวกเขา ดังนี้:

ติดตั้ง Cockpit บน Fedora และ CentOS

เพื่อติดตั้งและเปิดใช้งาน Cockpit บน Fedora Distributions ใช้คำสั่งต่อไปนี้:

# yum install cockpit
# systemctl enable --now cockpit.socket
# firewall-cmd --add-service=cockpit
# firewall-cmd --add-service=cockpit --permanent
# firewall-cmd --reload

ติดตั้ง Cockpit บน Rocky Linux และ AlmaLinux

เพื่อติดตั้งและเปิดใช้งาน Cockpit บน Rocky/AlmaLinux Distributions ใช้คำสั่งต่อไปนี้:

# yum install cockpit
# systemctl enable --now cockpit.socket
# firewall-cmd --add-service=cockpit
# firewall-cmd --add-service=cockpit --permanent
# firewall-cmd --reload

ติดตั้ง Cockpit บน RHEL

Cockpit ถูกเพิ่มเข้าไปใน Red Hat Enterprise Linux Extras Repository ตั้งแต่รุ่น 7.1 เป็นต้นไป:

# yum install cockpit
# systemctl enable --now cockpit.socket
# firewall-cmd --add-service=cockpit --permanent
# firewall-cmd --reload

ติดตั้ง Cockpit บน Debian

Cockpit รวมอยู่ใน Debian Official Repositories และคุณสามารถติดตั้งได้ด้วยคำสั่งต่อไปนี้:

# apt-get update
# apt-get install cockpit
# mkdir -p /usr/lib/x86_64-linux-gnu/udisks2/modules
# ufw allow 9090
# ufw allow 80

ติดตั้ง Cockpit บน Ubuntu และ Linux Mint

ใน Ubuntu และ Linux Mint Distributions Cockpit ไม่ได้รวมอยู่ แต่คุณสามารถติดตั้งจาก Cockpit PPA อย่างเป็นทางการ โดยรันคำสั่งต่อไปนี้:

$ sudo add-apt-repository ppa:cockpit-project/cockpit
$ sudo apt-get update
$ sudo apt-get install cockpit
$ sudo systemctl enable --now cockpit.socket

ติดตั้ง Cockpit บน Arch Linux

ผู้ใช้ Arch Linux สามารถติดตั้ง Cockpit จาก Arch User Repository โดยใช้คำสั่งต่อไปนี้:

# yaourt cockpit
# systemctl start cockpit
# systemctl enable cockpit.socket

วิธีใช้ Cockpit ใน Linux

หลังจากติดตั้ง Cockpit สำเร็จ คุณสามารถเข้าถึงได้ผ่าน Web Browser ที่ที่อยู่ต่อไปนี้:

https://ip-address:9090 OR https://server.domain.com:9090

ป้อน Username และ Password ของระบบเพื่อ Login ใน Interface ด้านล่าง:

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นCockpit Web Interface

หลัง Login คุณจะได้รับ Summary ของข้อมูลระบบและกราฟประสิทธิภาพสำหรับ CPU, Memory, Disk I/O และ Network Traffic ตามภาพถัดไป:

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นLinux System Performance Summary

ต่อไปใน Dashboard Menu คือ Services ที่นี่คุณสามารถดู Targets, System Services, Sockets, Timers และ Paths Pages

Interface ด้านล่างแสดง Services ที่กำลังทำงานบนระบบของคุณ

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นShowing Current Running Services on Linux

คุณสามารถคลิก Service เดียวเพื่อจัดการได้ เพียงคลิกที่ Drop-down Menus เพื่อได้ฟังก์ชันที่ต้องการ

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นView Linux Service Summary

เมนู Logs แสดงหน้า Logs ซึ่งอนุญาตให้ตรวจสอบ Logs Logs ถูกจัดหมวดหมู่เป็น Errors, Warnings, Notices และ All ตามภาพด้านล่าง

เพิ่มเติม คุณยังสามารถดู Logs ตามเวลาได้ เช่น Logs สำหรับ 24 ชั่วโมงที่ผ่านมา หรือ 7 วัน

Suggested Read: 4 Best Log Monitoring and Management Tools for Linux

เพื่อตรวจสอบ Log Entry เดียว เพียงคลิกที่มัน

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นLinux Logs Monitoring

Cockpit ยังช่วยให้คุณจัดการ User Accounts บนระบบได้ ไปที่ Tools คลิก Accounts การคลิกที่ User Account ให้คุณดูรายละเอียดบัญชีของผู้ใช้

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นManage Linux User Accounts

เพื่อเพิ่ม System User คลิกปุ่ม “Create New Account” และป้อนข้อมูลผู้ใช้ที่จำเป็นใน Interface ด้านล่าง

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นCreate User Account in Linux

เพื่อรับ Terminal Window ไปที่ Tools → Terminal

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นCockpit – Linux Web Terminal

วิธีเพิ่ม Linux Server เข้า Cockpit

สำคัญ: โปรดทราบว่าคุณต้องติดตั้ง Cockpit บน Remote Linux Servers ทั้งหมด เพื่อให้สามารถ Monitor ได้บน Cockpit Dashboard โปรดติดตั้งก่อนเพิ่ม Server ใหม่เข้า Cockpit

เพื่อเพิ่ม Server อื่น คลิกที่ Dashboard คุณจะเห็นหน้าจอด้านล่าง คลิกเครื่องหมาย (+) และป้อน IP Address ของ Server จำไว้ว่า ข้อมูลสำหรับแต่ละ Server ที่คุณเพิ่ม จะแสดงใน Cockpit โดยใช้สีที่แตกต่างกัน

Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นAdd Linux Server to Cockpit Cockpit: การจัดการ Linux Server แบบ Web-based ทำให้ง่ายขึ้นCockpit – Remote Linux Server Monitoring

เช่นเดียวกัน คุณสามารถเพิ่ม Linux Servers หลายตัวภายใต้ Cockpit และจัดการได้อย่างมีประสิทธิภาพโดยไม่มีปัญหา

ขอจบเพียงเท่านี้ แต่คุณสามารถสำรวจเพิ่มเติมได้ หากคุณติดตั้ง Server Remote Manager ที่เรียบง่ายและยอดเยี่ยมนี้แล้ว

Cockpit Official Documentation: https://cockpit-project.org/guide/latest/

สำหรับคำถาม ข้อเสนอแนะ หรือ Feedback เกี่ยวกับหัวข้อนี้ อย่าลังเลใช้ Comment Section ด้านล่างเพื่อติดต่อกลับมาหาเรา