CentOS 7에서 Ceph-dash로 Ceph 클러스터 모니터링
이 페이지에서
- 1단계 - Ceph-dash 종속성 설치
- 2단계 - Ceph-dash 다운로드
- 3단계 - Ceph-dash용 Apache 가상 호스트 구성\n
- 4단계 - SSL 및 Apache 기본 인증 구성
- 5단계 - 방화벽에 HTTP 및 HTTPS 포트 추가\n
- 6단계 - 테스트
- 참조
Ceph-dash는 Ceph 클러스터 모니터링을 위한 Flask 프레임워크 기반의 WSGI 애플리케이션입니다. librados를 사용하여 Ceph 클러스터와 통신합니다. Ceph-dash에는 멋진 대시보드가 있으며 설치가 쉽고 InfluxDB 및 Graphite 지원을 비롯한 많은 기능이 있습니다.
이 튜토리얼에서는 Ceph-dash를 설치하고 SSL 및 mod_auth를 지원하는 Apache 웹 서버에서 실행되도록 구성하는 방법을 보여줍니다. 첫 번째 Ceph 자습서에서는 이미 Ceph 클러스터를 설치했습니다. 이 자습서에서는 해당 설정의 모니터 호스트 mon1에 ceph-dash를 구성합니다.
전제 조건
- Ceph 클러스터 - Ceph I 자습서
- 모니터 노드 CentOS 7 - mon1
- 루트 권한\n
1단계 - Ceph-dash 종속성 설치
이 첫 번째 단계에서는 apache 웹 서버 및 mod_ssl을 포함하여 ceph-dash에 필요한 종속성을 설치합니다.
ceph-admin 노드에서 mon1 노드에 연결합니다.
ssh mon1
yum 명령에 필요한 모든 종속성을 설치합니다.
sudo yum -y install httpd mod_wsgi mod_ssl git
그런 다음 apache/httpd를 시작하고 부팅 시 시작되도록 추가합니다.
sudo systemctl start httpd
sudo systemctl enable httpd
2단계 - Ceph-dash 다운로드
Ceph-dash는 github 리포지토리에서 사용할 수 있는 오픈 소스 애플리케이션입니다. 리포지토리를 /var/www/ 디렉터리에 복제합니다.
cd /var/www/html/
git clone https://github.com/Crapworks/ceph-dash.git
기본적으로 apache/httpd는 사용자 이름 apache로 실행되므로 ceph-dash 파일 및 디렉토리의 소유자를 apache 사용자로 변경해야 합니다.
sudo chown -R /var/www/html/ceph-dash/
3단계 - Ceph-dash용 Apache 가상 호스트 구성
Ceph-dash는 contrib 디렉토리에서 apache 및 Nginx에 대한 가상 호스트 구성 샘플을 제공합니다. 우리는 apache를 Ceph-dash용 웹 서버로 사용할 것이므로 apache용 구성 파일을 apache/httpd 디렉토리에 복사해야 합니다.
cd /var/www/html/ceph-dash/
cp contrib/apache/cephdash /etc/httpd/conf.d/cephdash.conf
가상 호스트 구성 디렉터리로 이동하여 cephdash.conf 파일을 편집합니다.
cd /etc/httpd/conf.d/
vim cephdash.conf
ServerName의 값을 귀하의 도메인 이름으로 변경하십시오 - 제 경우 ceph-mon.co
apache 사용자로 실행되도록 wsgi 데몬 프로세스를 변경합니다.
cephdash.wsgi 디렉토리를 /var/www/html/ceph-dash/contrib/wsgi/cephdash.wsgi로 변경합니다.
SSL 구성 디렉토리를 /etc/httpd/ssl/로 변경합니다.
ceph-dash 디렉토리를 /var/www/html/ceph-dash로 변경한 다음 기본 인증 구성을 추가합니다.
아래는 구성입니다.
<VirtualHost *:80>
ServerName ceph-mon.co
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/server-status
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
ServerName ceph-mon.co
WSGIDaemonProcess cephdash user=apache group=apache processes=1 threads=5
WSGIScriptAlias / /var/www/html/ceph-dash/contrib/wsgi/cephdash.wsgi
WSGIPassAuthorization On
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/ssl.crt
SSLCertificateKeyFile /etc/httpd/ssl/ssl.key
<Directory /var/www/html/ceph-dash>
WSGIProcessGroup cephdash
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
</VirtualHost>
파일을 저장하고 편집기를 종료합니다.
4단계 - SSL 및 Apache 기본 인증 구성
가상 호스트 구성에서 /etc/httpd/ssl 디렉토리에 SSL 구성을 이미 정의했으므로 거기에 SSL 인증서와 키를 만들어야 합니다.
mkdir -p /etc/httpd/ssl/
이제 OpenSSL 명령을 사용하여 자체 서명된 SSL 인증서 파일을 생성합니다.
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/httpd/ssl/ssl.key -out \
/etc/httpd/ssl/ssl.crt
인증서 파일의 권한을 600으로 변경합니다.
chmod 600 /etc/httpd/ssl/*
다음으로 아래의 htpasswd 명령으로 apache 기본 인증을 추가하여 Ceph-dash 액세스를 암호로 보호합니다.
htpasswd -c /etc/httpd/htpasswd hakase
Type your password:
hakase는 내가 선택한 사용자 이름입니다.
모든 작업이 완료되면 apachectl 명령어로 apache 구성 파일을 테스트하고 결과가 Syntax OK인지 확인한 다음 apache를 다시 시작합니다.
apachectl configtest
sudo systemctl restart httpd
5단계 - 방화벽에 HTTP 및 HTTPS 포트 추가
모니터 노드 mon1에서 firewalld가 활성화됩니다. 웹 브라우저에서 Ceph-dash에 액세스할 수 있도록 http 및 https 연결을 위한 새 포트를 열어야 합니다.
firewall-cmd 명령을 사용하여 http 및 https 포트를 firewalld에 추가합니다.
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
firewalld 구성을 다시 로드합니다.
sudo firewall-cmd --reload
6단계 - 테스트
웹 브라우저를 열고 주소 표시줄에 ceph-mon.co 도메인(ceph-dash 설치를 위해 선택한 도메인 이름 사용)을 입력하고 Enter 키를 누릅니다.
사용자 이름과 암호를 묻는 메시지가 나타나면 htpasswd 파일에서 사용한 사용자 이름과 암호를 입력하십시오.

이제 Ceph-dash 대시보드를 볼 수 있습니다.
클러스터 상태 상태, 모니터 노드 상태, OSD 노드 상태.

스토리지 및 PG 상태.

Ceph-dash는 모니터 노드 mon1의 Apache 웹 서버 아래에 설치되었습니다.
참조
- http://www.virtualtothecore.com/en/monitor-a-ceph-cluster-with-ceph-dash/