#Rocky Linux 9 + Cockpit
Cockpit에 대한 설명은 IDCHOWTO 앞선 게시글에 나와 있습니다.
운영체제 버전 업그레이드에 맞춰 Rocky Linux 9에 Cockpit을 설치해보겠습니다.
Cockpit은 간단하게 말씀드리면 웹 UI를 제공하는 서버 자원 관리 도구라고 생각하시면 됩니다.
- Rocky Linux 9에 Cockpit 설치하기
- Cockpit + Grafana 대시보드 보기
<h2>1. Rocky Linux 9 + Cockpit 설치 🥸</h2>
– 패키지 업그레이드
dnf update -y && dnf upgrade -y
– Cockpit 패키지 설치
dnf install -y cockpit
다운로드 패키지 목록 |
Last metadata expiration check: 0:03:32 ago on Wed Apr 2 13:53:40 2025. Transaction Summary |
– Cockpit 서비스 실행
systemctl enable cockpit.socket --now
소켓 기반으로 실행되기 때문에 위와 같이 서비스 명을 소켓으로 맞춰 줍니다.
방화벽 사용 중이라면 TCP 9090 포트를 등록합니다.
http://<서버IP>:9090 접속 시 아래와 같이 로그인 창이 출력됩니다.
cockpit 초기 접속화면 |
|
– 사용할 계정 생성 후 로그인
wheel 그룹에 속한 user를 생성해줍니다.
useradd -m -G wheel cockpituser && passwd cockpituser
생성 계정 정보 확인 |
[root@cockpit ~]# id cockpituser
[root@cockpit ~]# groups cockpituser |
위 정보로 로그인 시 아래와 같이 기본 화면이 출력됩니다.
cockpit 로그인 후 화면 |
|
위 파란색 박스를 누르고 cockpituser
의 비밀번호를 한 번 더 입력하면 admin 권한으로 변경됩니다.
※ Cockpit에 대해 더 궁금한 점이 있다면 아래 공식 사이트를 참고 바랍니다.
<h2>2. Cockpit + Grafana 대시보드 보기 🥸</h2>
Cockpit Plugin을 계속 찾아봤지만 Noti 관련 Plugin은 딱히 보이지 않았습니다.
Grafana 연동 시 해당 값을 이용하여 쿼리를 생성하려면 알림에 사용 가능한 다른 데이터 소스를 사용해야 합니다.
(찾으신 다른 분이 있다면 댓글로 공유 부탁드립니다.)
– Grafana 설치
Grafana 설치 과정 요약 |
# rpm 패키지 추가 후 설치 cd /usr/local/src wget https://dl.grafana.com/enterprise/release/grafana-enterprise-11.6.0-1.x86_64.rpm dnf install -y grafana-enterprise-11.6.0-1.x86_64.rpm
# grafana-server 서비스 실행 systemctl enable grafana-server –now === Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.service. === netstat -nltp === === # 방화벽을 사용한다면 마찬가지로 TCP 3000번을 추가합니다. # 브라우저에서 http://<서버IP>:3000 접속 후 비밀번호를 변경합니다. 초기 계정과 비밀번호 모두
# Grafana PCP plugin 설치
grafana-cli plugins install performancecopilot-pcp-app systemctl restart grafana-server
# 웹 UI에서 설치한 Plugin 허용 [Administration – Plugins and data – Plugins – |
– Cockpit PCP(Performance Co-Pilot) Plugin 설치
dnf install -y cockpit-pcp pcp pcp-export-pcp2json
관련 서비스들을 실행시켜 줍니다.
systemctl enable pmcd pmlogger pmproxy --now
cockpit pcp 활성화 데몬 목록 |
|
– Grafana에 데이터 연동
[Connections – Data sources – Add data source] |
|
[PCP 검색 – PCP Vector 클릭] |
|
[Name과 URL 입력] |
![]() |
데이터 working이 잘 되는지 확인합니다.
Dashboard Data 출력 확인 |
|
Cockpit 자체도 대시보드가 잘 구성되어 있지만, 연동하여 사용하면 더 많은 방면으로 활용이 가능합니다.
감사합니다.