未加星标

Monitoring of a Ceph Cluster with Ceph-dash on CentOS 7

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二04 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

Ceph-dash is is a WSGI application based on the Flask framework for monitoring of Ceph clusters. It useslibrados to communicate with the Ceph cluster. Ceph-dash has a nice dashboard, it is easy to install has many features, including InfluxDB and Graphite support.

In this tutorial, I will show you to install Ceph-dash and configure it to run under an apache web server with SSL and mod_auth support. In thefirst Ceph tutorial, we've already installed a 'Ceph cluster', in this tutorial, we will configure ceph-dash on the monitor host ' mon1 ' of that setup.

Prerequisites Ceph Cluster -Ceph I Tutorial Monitor node CentOS 7 - mon1 Root privileges Step 1 - Installing Ceph-dashDependencies

In this first step, we will install the dependencies needed by ceph-dash, including apache web server and mod_ssl.

Connect to the mon1 node from the ceph-admin node.

ssh mon1

Install all dependencies needed with the yum command.

sudo yum -y install httpd mod_wsgi mod_ssl git

Then start apache/httpd and add it to be started at boot time.

sudo systemctl start httpd

sudo systemctl enable httpd

Step 2 - Download Ceph-dash

Ceph-dash is an open source application, available from the github repository. Clone the repository to the /var/www/ directory.

cd /var/www/html/

git clone https://github.com/Crapworks/ceph-dash.git

By default, apache/httpd is running under the user name 'apache', so we need to change the owner of ceph-dash files and directories to the 'apache' user.

sudo chown -R /var/www/html/ceph-dash/

Step 3 - Configure an Apache Virtual Host for Ceph-dash

Ceph-dash provides a sample of a virtual host configuration for apache and Nginx in the 'contrib' directory. We will use apache as the web server for Ceph-dash, so we need to copy the configuration file for apache to the apache/httpd directory.

cd /var/www/html/ceph-dash/

cp contrib/apache/cephdash /etc/httpd/conf.d/cephdash.conf

Go to the virtual host configuration directory and edit cephdash.conf file.

cd /etc/httpd/conf.d/

vim cephdash.conf

Change value of the ' ServerName ' to your domain name - in my case ceph-mon.co

Change thewsgi daemon process to runn as the apache user.

Change the cephdash.wsgi directory to ' /var/www/html/ceph-dash/contrib/wsgi/cephdash.wsgi' .

Change the SSL configuration directory to ' /etc/httpd/ssl/ '.

Change the ceph-dash directory to ' /var/www/html/ceph-dash ', then add the basic auth configuration.

Below is the configuration.

<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>

Save the file and exit the editor.

Step 4 - Configure SSL and Apache Basic Auth

In the virtual host configuration, we've already defined the SSL configuration in the '/etc/httpd/ssl' directory, so we need to create the SSL cert and key there.

mkdir -p /etc/httpd/ssl/

Now generate a self-signed SSL certificate file with the OpenSSL command.

openssl req -x509 -nodes -days 365 -newkey rsa:2048 \

-keyout /etc/httpd/ssl/ssl.key -out \

/etc/httpd/ssl/ssl.crt

Change the permissions of the certificate file to 600.

chmod 600 /etc/httpd/ssl/*

Next, add apache basic auth with the htpasswd command below to password protect the Ceph-dash access.

htpasswd -c /etc/httpd/htpasswd hakase

Type your password:

hakaseis the username that I#ve chosen.

If all is done, test the apache configuration file with theapachectl command and make sure the result is ' Syntax OK ', then restart apache.

apachectl configtest

sudo systemctl restart httpd

Step 5 - Add HTTP and HTTPS Port to Firewalld

On the monitor node ' mon1 ', firewalld is enabled. We have to open a new port for thehttp and https connection so we can access Ceph-dash from aweb browser.

Add thehttp and https port to firewalld with the firewall-cmd command.

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent

sudo firewall-cmd --zone=public --add-port=443/tcp --permanent

Reload the firewalld configuration.

sudo firewall-cmd --reload

Step 6 - Testing

Open your web browser and type in the ceph-mon.co domain(use the domain name that you have chosen for your ceph-dash installation) in the address bar, press enter.

You will be asked for username and password, type in your username and password that you used in the htpasswd file.


Monitoring of a Ceph Cluster with Ceph-dash on CentOS 7

Now you can see the Ceph-dash dashboard.

Cluster health Status, Monitor node status, OSD nodes status.


Monitoring of a Ceph Cluster with Ceph-dash on CentOS 7

Storage and PG status.


Monitoring of a Ceph Cluster with Ceph-dash on CentOS 7

Ceph-dashhas been installed under an apache web server on the monitor node ' mon1 '.

Reference https://github.com/Crapworks/ceph-dash http://www.virtualtothecore.com/en/monitor-a-ceph-cluster-with-ceph-dash/

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: CephGISNginxOpenSSLSG
tags: dash,Ceph,ceph,apache,httpd,ssl,etc,configuration,cephdash
分页:12
转载请注明
本文标题:Monitoring of a Ceph Cluster with Ceph-dash on CentOS 7
本站链接:http://www.codesec.net/view/522742.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(89)