[Linux]Server Monitoring - Cockpit ์„ค์น˜

2023. 7. 7. 17:03ใ†System ์ž‘์—…์‹ค/LINUX

728x90
๋ฐ˜์‘ํ˜•

 



 

 

 

๐Ÿš€ Cockpit ์„ค์น˜

    ๐Ÿ”ฝ ๊ฐœ์š”

        ๐Ÿ“ฆ ์†Œ๊ฐœ

์ด๋ฒˆ์—๋Š” Linux Server Monitoring์„ ์œ„ํ•œ Tool ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•ด๋ณด๋ ค๊ณ  ํ•ด์š”.

๊ทธ ์ด๋ฆ„ํ•˜์—ฌ! Cockpit์ด๋ผ๋Š” Tool์ธ๋ฐ,
์ด๊ฒƒ์€ ์›น ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์ด์šฉํ•˜์—ฌ ์—ฌ๋Ÿฌ Linux Server Monitoringํ•˜๊ณ ,
๊ด€๋ฆฌํ•˜๋Š” ๊ฐ•๋ ฅํ•œ ๋„๊ตฌ์—์š”.

Cockpit์€ GNU/Linux Server๋ฅผ ์œ„ํ•œ ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฝ๊ณ , ๊ฐ€๋ณ๊ณ  ๊ฐ„๋‹จํ•œ ๊ฐ•๋ ฅํ•œ ์›๊ฒฉ ๊ด€๋ฆฌ์ž์ด๊ณ , ์›น ๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ตํ•ด Live Linux Session์„ ์ œ๊ณตํ•˜๋Š” ๋Œ€ํ™”ํ˜• ์„œ๋ฒ„ ๊ด€๋ฆฌ ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค์—์š”.

Cockpit์€ Debian ๊ณ„์—ด๊ณผ RHEL ๊ณ„์—ด ๋ฟ๋งŒ์•„๋‹ˆ๋ผ, Arch ๊ณ„์—ด Linux ๋ฐฐํฌํŒ์—์„œ ์ด์šฉํ•  ์ˆ˜ ์žˆ์–ด์š”.

Cockpit์„ ์‚ฌ์šฉํ•˜๋ฉด Linux๋ฅผ ๊ฒ€์ƒ‰ํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— System Manager๊ฐ€ Container Start, Storage Management, Network Setting, Auditing Log์™€ ๊ฐ™์€ ์žก์—…์„ ์‰ฝ๊ณ , ์•ˆ์ •์ ์œผ๋กœ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ค€๋‹ต๋‹ˆ๋‹ค.

๋˜ํ•œ, ์‚ฌ์šฉํ•˜๋Š” ๋™์•ˆ ์‚ฌ์šฉ์ž๋Š” ๋ฒˆ๊ฑฐ๋กœ์›€์—†์ด Linux ํ„ฐ๋ฏธ๋„๊ณผ ์›น ๋ธŒ๋ผ์šฐ์ € ์‚ฌ์ด๋ฅผ ์‰ฝ๊ฒŒ ์ „ํ™˜ํ•  ์ˆ˜๋„ ์žˆ์–ด์š”.
๋”์šฑ ์ค‘์š”ํ•œ ๊ฒƒ์€ ์‚ฌ์šฉ์ž๊ฐ€ Cockpit์„ ํ†ตํ•ด ์„œ๋น„์Šค๋ฅผ ์‹œ์ž‘ํ•˜๋ฉด Terminal์„ ํ†ตํ•ด Service ์ค‘์ง€์™€ ๊ฐ™์€ ๊ด€๋ฆฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ๊ณ , Terminal์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜์—๋งŒ Cockpit ์ €๋„ ์ธํ„ฐํŽ˜์ด์Šค์— ํ‘œ์‹œ๋˜๋Š” ๊ธฐ๋Šฅ์„ ๊ฐ–์ถ”๊ณ  ์žˆ์–ด์š”.


  1. Enables managing of multiple servers in one Cockpit session.
  2. Offers a web-based shell in a terminal window.
  3. Containers can be managed via Docker.
  4. Supports efficient management of system user accounts.
  5. Collects system performance information using Performance Co-Pilot framework and displays it in a graph.
  6. Supports gathering of system configuration and diagnostic information using sos-report.
  7. Also supports Kubernetes cluster or an Openshift v3 cluster.
  8. Allows modification of network settings and many more.

 

 

 

    ๐Ÿ”ฝ Cockpit ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ

        ๐Ÿ“ฆ Rocky Linux

์ตœ์ดˆ Rocky Linux์— ์„ค์น˜ํ•˜๊ณ , ๊ตฌ์„ฑํ•˜๋Š” ์ž‘์—…์„ ํ•ด ๋ณผ๊ฒŒ์š”.
RHEL ๊ณ„์—ด์—์„œ๋Š” ์ด ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ต๋‹ˆ๋‹ค.

yum install cockpit

 

 


์ตœ์ดˆ ์œ„ ๋ช…๋ น์–ด๋กœ Package๋ฅผ ๋‚ด๋ ค๋ฐ›๊ณ , ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•ด ์ค„๊ฒŒ์š”.


systemctl enable --now cockpit.socket

 


์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ์œ„ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด Server๊ฐ€ ์žฌ๊ธฐ๋™ ๋˜๋Š” ๋“ฑ์— ์ƒํ™ฉ์—์„œ๋„
์ž๋™์œผ๋กœ Service๊ฐ€ ๊ตฌ๋™๋  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด ์ค„ ์ˆ˜ ์žˆ์–ด์š”.



 

firewall-cmd --add-service=cockpit
firewall-cmd --add-service=cockpit --permanent
728x90

 
๊ทธ๋ฆฌ๊ณ  ์œ„ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๋ฐฉํ™”๋ฒฝ ์ •์ฑ…์— ์ถ”๊ฐ€๋ฅผ ํ•ด ์ฃผ๋„๋ก ํ•˜์˜€์–ด์š”.


systemctl start cockpit

 


๊ทธ๋ฆฌ๊ณ  ์œ„ ๋ช…๋ น์–ด๋กœ Service๋ฅผ ๊ตฌ๋™ ์‹œ์ผœ ์ฃผ์—ˆ์–ด์š”.



cockpit์€ 9090 Port๋ฅผ ํ†ตํ•ด ๋ธŒ๋ผ์šฐ์ €๋กœ ์ ‘์†ํ•  ์ˆ˜ ์žˆ์–ด์š”.

์œ„์™€ ๊ฐ™์ด ์ •์ƒ์ ์œผ๋กœ ๊ตฌ๋™์ค‘์ธ๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.


https://{Server IP ์ฃผ์†Œ}:9090

 


์œ„์™€ ๊ฐ™์ด ์›น ๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ตํ•ด ์ ‘์†ํ•  ์ˆ˜ ์žˆ์–ด์š”.

Login ๊ณ„์ •์€ Linux ์‚ฌ์šฉ์ž ๊ณ„์ •์„ ์ž…๋ ฅํ•˜๋ฉด ์ ‘์†ํ•  ์ˆ˜ ์žˆ์–ด์š”.



์œ„์™€ ๊ฐ™์ด ์ ‘์†ํ•˜๋ฉด Server๋ฅผ ๋ณด๋‹ค ํŽธ๋ฆฌํ•˜๊ฒŒ Monitoring ํ•  ์ˆ˜ ์žˆ์„ ๊ฑฐ์—์š”.



๋ณด๋‹ค ์ž์„ธํ•œ Monitoring์„ ์œ„ํ•ด cockpit-pcp๋ฅผ ์ถ”๊ฐ€๋กœ ์„ค์น˜ํ•ด ์ฃผ๋„๋ก ํ• ๊ฒŒ์š”.


์„ค์น˜๋ฅผ ๋ˆŒ๋Ÿฌ ์ค„๊ฒŒ์š”.



Log out์„ ํ•œ ๋’ค ๋‹ค์‹œ Login์„ ํ•˜๊ณ , ๋‹ค์‹œ ์ด ๊ณณ์œผ๋กœ ๋Œ์•„์™€ ์œ„์™€ ๊ฐ™์ด ๋งคํŠธ๋ฆญ ์„ค์ •์„ ๋ˆŒ๋Ÿฌ์ฃผ๋ฉด



๋ฉ”ํŠธ๋ฆญ ์ˆ˜์ง‘์ด ์žˆ๋Š”๋ฐ, ์ด๊ฑธ ํ™œ์„ฑํ™” ์‹œ์ผœ ์ค„๊ฒŒ์š”.



๊ทธ๋Ÿผ ์œ„์™€ ๊ฐ™์ด ์ถ”๊ฐ€ Monitoring์ด ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋˜์š”.

 

 

 

        ๐Ÿ“ฆ Ubuntu 22.04.01 LTS Desktop

์ด๋ฒˆ์—๋Š” ์ด ์ „์— ์„ค์น˜ํ–ˆ๋˜ VDI์šฉ Ubuntu Desktop์— ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ์„ ์ง„ํ–‰ํ•ด ๋ณผ๊ฒŒ์š”.

apt-get install -y cockpit

๋ฐ˜์‘ํ˜•


์œ„ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด Package๋ฅผ ๋‚ด๋ ค๋ฐ›๊ณ , ์„ค์น˜ํ•ด ์ฃผ๋„๋ก ํ• ๊ฒŒ์š”.



Rocky Linux ๋•Œ์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์žฌ๋ถ€ํŒ… ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์žˆ์„๋•Œ๋„ ์ž๋™์œผ๋กœ ๊ธฐ๋™ํ•˜๊ฒŒ ํ•ด์ฃผ๊ณ ,
์„œ๋น„์Šค๋ฅผ ๊ธฐ๋™ ์‹œ์ผœ ์ฃผ์—ˆ์–ด์š”.



์ •์ƒ์ ์œผ๋กœ ์„œ๋น„์Šค๊ฐ€ ๊ตฌ๋™ ์ค‘์ธ๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.



์šฐ๋ถ„ํˆฌ ์—ญ์‹œ ์ž˜ ์ ‘์† ๋˜๋Š” ๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.









        ๐Ÿ“ฆ Cockpit ์ค‘์•™ ๊ด€๋ฆฌ

์ฃผ๋‹ˆ์˜ ์„œ๋ฒ„ ๊ตฌ์„ฑ์—๋Š” Manager๋ผ๋Š” ๊ฐ€์ƒ Server๊ฐ€ ์กด์žฌํ•˜๊ณ ,
์ด Server๋Š” Rocky Linux๋กœ ์„ค์น˜ ๋˜์–ด ์žˆ์–ด์š”.

์ด Server์—์„œ ๋ชจ๋“  Linux Cockpit์„ ๋“ฑ๋กํ•˜์—ฌ ์ค‘์•™์—์„œ Monitoring์ด ๊ฐ€๋Šฅํ•˜๋„๋ก ์ž‘์—…ํ•ด๋ณด๋ ค ํ•ด์š”.


 

์ตœ์ดˆ cockpit์— ์ ‘์†ํ•œ ๋’ค ์™ผ์ชฝ ์œ—๋ถ€๋ถ„์— ์œ„ ์‚ฌ์ง„๊ณผ ๊ฐ™์ด ํ™”์‚ดํ‘œ๋ฅผ ๋ˆŒ๋Ÿฌ์ค„๊ฒŒ์š”.


๊ทธ๋Ÿฐ ๋’ค ์‹ ๊ทœ ํ˜ธ์ŠคํŠธ ์ถ”๊ฐ€๋ฅผ ๋ˆŒ๋Ÿฌ์ค๋‹ˆ๋‹ค.


ํ˜ธ์ŠคํŠธ ๋ถ€๋ถ„์— Client์˜ IPํ˜น์€ Domain Name ๋“ฑ์„ ๋„ฃ๊ณ ,

์‚ฌ์šฉ์ž ์ด๋ฆ„์—๋Š” ํ•ด๋‹น Client์˜ ์ ‘์† ๊ณ„์ • ์ด๋ฆ„์„ ์ž…๋ ฅํ•ด ์ค๋‹ˆ๋‹ค.
์ฐธ๊ณ ๋กœ root๋ฅผ ์ œ์™ธํ•œ ๊ณ„์ •์„ ์ž…๋ ฅํ•ด ์ฃผ์–ด์•ผ ํ•˜๋Š” ๊ฑฐ ๊ฐ™์•„์š”.

๊ทธ๋ฆฌ๊ณ , ๊ตฌ๋ถ„์„ ์œ„ํ•œ ์ƒ‰์„ ์ง€์ •ํ•ด ์ค„ ์ˆ˜ ์žˆ์–ด์š”.

๋งŒ์•ฝ ์ฃผ๋‹ˆ์ฒ˜๋Ÿผ IP์ฃผ์†Œ๊ฐ€ ์•„๋‹ˆ๋ผ Host๋ช…์„ ์ž…๋ ฅํ•ด ์ฃผ๊ณ  ์‹ถ๋‹ค๋ฉด
๊ด€๋ฆฌ ์„œ๋ฒ„๋กœ ์“ธ ์„œ๋ฒ„์—์„œ ๋Œ€์ƒ ์„œ๋ฒ„์— ๋Œ€ํ•œ Hostname ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ๋ฉด ๋˜์š”.


vim /etc/hosts

 


์ž‘์—… ๋’ค ํ•ด๋‹น Hostname์œผ๋กœ Ping์ด ๊ฐ€๋Š”์ง€ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.



๊ทธ๋Ÿผ ์œ„์™€ ๊ฐ™์€ ๋‚ด์šฉ์ด ๋‚˜์˜ค๊ฒŒ ๋ ํ…๋ฐ, ์ด์•ผ๊ธฐ ํ•ด์ค€๋Œ€๋กœ ๋Œ€์ƒ ์„œ๋ฒ„์—์„œ ์ง„ํ–‰์„ ํ•ด์ค„๊ฒŒ์š”.

 

 


์œ„์™€ ๊ฐ™์ด ์ „์ž์„œ๋ช… Hash ๊ฐ’์ด ๋™์ผํ•œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.




ํ‚ค ์ˆ˜๋ฝ ๋ฐ ์—ฐ๊ฒฐ ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ์ค„๊ฒŒ์š”.



์œ„์™€ ๊ฐ™์ด ๋‚˜์˜ค๋ฉด ๋Œ€์ƒ ์„œ๋ฒ„์˜ ๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ๊ณ , ์„ค์ •ํ•  ssh key ๋น„๋ฐ€ํ‚ค ๊ฐ’์„ ์ž…๋ ฅํ•ด ์ค„๊ฒŒ์š”.

 

๊ทธ๋Ÿฐ ๋’ค ๋กœ๊ทธ์ธ์„ ๋ˆŒ๋Ÿฌ์ค๋‹ˆ๋‹ค.



๊ทธ๋Ÿผ ์œ„์™€ ๊ฐ™์ด ์„œ๋ฒ„๊ฐ€ ์ถ”๊ฐ€๋œ ๊ฒƒ์„ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!



 

 

 

๐Ÿง ์ฐธ๊ณ  ์ž๋ฃŒ

 

Cockpit-์›น ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์—ฌ๋Ÿฌ Linux ์„œ๋ฒ„๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๊ฐ•๋ ฅํ•œ ๋„๊ตฌ

Cockpit-์›น ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์—ฌ๋Ÿฌ Linux ์„œ๋ฒ„๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๊ฐ•๋ ฅํ•œ ๋„๊ตฌ Cockpit์€ GNU/Linux ์„œ๋ฒ„๋ฅผ์œ„ํ•œ ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฝ๊ณ  ๊ฐ€๋ณ๊ณ  ๊ฐ„๋‹จํ•˜๋ฉด์„œ๋„ ๊ฐ•๋ ฅํ•œ ์›๊ฒฉ ๊ด€๋ฆฌ์ž์ด๋ฉฐ ์›น ๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ต

ko.linux-console.net

 

 

How to install Cockpit on Ubuntu 22.04 for better server management

If you'd prefer to administer your Ubuntu servers via a web-based GUI, Jack Wallen thinks Cockpit is a great option, and he's ready to show you how to install it.

www.techrepublic.com




 

 

 

 

728x90
๋ฐ˜์‘ํ˜•