ceph mgr module enable dashboard
これで、8443 → 8080 ポートになる。
ceph config set mgr mgr/dashboard/ssl false
# ceph mgr services
{
"dashboard": "http://ceph01:8080/",
}
===== 3.ユーザ設定 =====
user:admin, pass:adminxxxx, role:administratorで設定する場合
<code>
# ceph dashboard ac-user-create admin adminxxxx administrator
{"username": "admin", "lastUpdate": 1592953680, "name": null, "roles": ["administrator"], "password": "$2b$12$iOz46vkfT.zR62AmZXXXXXXXXXXXXXXXAlTOIx1Gz3az1CwqRlFe", "email": null}
これ以降はPrometheus と Grafanaで、Cephの状態を見たい時
cephのモジュールprometheus exporterをenableへ
ceph mgr module enable prometheus
ceph config set mgr mgr/prometheus/rbd_stats_pools glance,cinder,nova
docker-composeでprometheusとgrafanaを作成
mkdir /app/grafana
# cat docker-compose.yml
version: '3'
services:
prometheus:
image: prom/prometheus
container_name: prometheus
environment:
TZ: Asia/Tokyo
volumes:
- ./prometheus:/etc/prometheus
- ./prometheus/data:/prometheus/data
command: "--config.file=/etc/prometheus/prometheus.yaml"
network_mode: "host"
ports:
- 9090:9090
restart: always
grafana:
image: grafana/grafana:7.3.0
container_name: grafana
environment:
- TZ=Asia/Tokyo
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=vonage-status-panel,grafana-piechart-panel,alexanderzobnin-zabbix-app
ports:
- 3000:3000
volumes:
- ./grafana/grafana.ini:/etc/grafana/grafana.ini
- ./grafana/grafana.db:/var/lib/grafana/grafana.db
restart: always
node-exporter:
image: prom/node-exporter
container_name: node-exporter
ports:
- 9100:9100
restart: always
chmod 777 prometheus/data
prometheus/prometheus.yaml
# cat prometheus/prometheus.yaml
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
- job_name: 'ceph'
honor_labels: true
static_configs:
- targets: ['ceph001:9283']
- job_name: 'node'
static_configs:
- targets: ['ceph001:9100']
labels:
instance: "ceph001"
- targets: ['ceph002:9100']
labels:
instance: "ceph002"
- targets: ['ceph003:9100']
labels:
instance: "ceph003"
- targets: ['ceph004:9100']
labels:
instance: "ceph004"
- targets: ['ceph005:9100']
labels:
instance: "ceph005"
- targets: ['ceph006:9100']
labels:
instance: "ceph006"
- targets: ['ceph007:9100']
labels:
instance: "ceph007"
- job_name: 'grafana'
static_configs:
- targets: ['ceph007:9100']
labels:
instance: "ceph007"
Grafana側は、anonymouse と allow_embeddingを有効にしておく
grafana/grafana.ini
# cat grafana/grafana.ini [auth.anonymous] enabled = true org_name = Main Org. org_role = Viewer [security] allow_embedding = true
# cat docker-compose.yml
version: '3'
services:
node-exporter:
image: prom/node-exporter:v0.17.0
container_name: node-exporter
ports:
- 9100:9100
restart: always
deploy:
resources:
limits:
memory: 100m