ceph rgw的使用,dashboard和监控
1.部署RadosGW 服务
将ceph-mgr1、ceph-mgr2 服务器部署为高可用的radosGW 服务
1.1 安装radosgw 服务
root@mgr1:~# apt install radosgw root@mgr2:~# apt install radosgw
1.2 初始化rgw节点
$ ceph-deploy --overwrite-conf rgw create mgr1
$ ceph-deploy --overwrite-conf rgw create mgr2
1.3 验证radosgw 服务状态
$ ceph -s
cluster:
id: 54ed6318-9830-4152-917c-f1af7fa1002a
health: HEALTH_OK
services: mon: 3 daemons, quorum mon1,mon2,mon3 (age 3d)
mgr: mgr1(active, since 3d), standbys: mgr2
mds: 2/2 daemons up, 2 standby
osd: 20 osds: 20 up (since 3d), 20 in (since 3d)
rgw: 2 daemons active (2 hosts, 1 zones)
data:
volumes: 1/1 healthy
pools: 8 pools, 217 pgs
bjects: 477 objects, 774 MiB
usage: 11 GiB used, 1.9 TiB / 2.0 TiB avail
pgs: 217 active+clean
1.4 验证radosgw 服务进程
root@mgr1:~# ps -ef |grep radosgw
ceph 1261 1 0 10:40 ? 00:00:02 /usr/bin/radosgw -f --cluster ceph --name client.rgw.mgr1 --setuser ceph --setgroup ceph
root@mgr2:~# ps -ef |grep radosgw
ceph 32197 1 0 10:41 ? 00:00:02 /usr/bin/radosgw -f --cluster ceph --name client.rgw.mgr2 --setuser ceph --setgroup ceph
2.radosgw 服务配置
2.1 自定义端口
2.1.1 配置文件可以在ceph deploy 服务器修改然后统一推送,或者单独修改每个radosgw 服务器的配置为同一配置。
[client.rgw.mgr1] rgw_host = mgr1 rgw_frontends = civetweb port=8080
[client.rgw.mgr2] rgw_host = mgr2 rgw_frontends = civetweb port=8080
2.1.2 同步配置文件到rgw1(mgr1),rgw2(mgr2)
cephuser@ceph-deploy:~/ceph-cluster$ scp ceph.conf root@mgr1:/etc/ceph/
cephuser@ceph-deploy:~/ceph-cluster$ scp ceph.conf root@mgr2:/etc/ceph/
2.1.3 在rgw节点重启rgw服务
root@mgr1:~# systemctl restart ceph-radosgw@rgw.mgr1.service
root@mgr2:~# systemctl restart ceph-radosgw@rgw.mgr2.service
root@mgr2:~# netstat -ntlp |grep radosgw
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address
Foreign Address State PID/Program name tcp 0 0
0.0.0.0:8080 0.0.0.0:* LISTEN 32197/radosgw
2.2 配置nginx 代理
2.2.1 安装nginx并配置
apt install nginx
rm -f /etc/nginx/sites-enabled/default
vim /etc/nginx/sites-enabled/ceph_rgw.conf
upstream rgw_yanceph {
server 192.168.2.31:8080;
server 192.168.2.32:8080;
}
server {
listen 80;
server_name rgw.yanceph.com;
charset utf-8;
location / {
proxy_pass http://rgw_yanceph;
proxy_set_header Host $host;
access_log /var/log/nginx/rgw.yanceph.com.log;
}
}
# nginx 配置检查
nginx -t
# nginx 后台启动
nginx
2.2.2 winows测试机上配置hosts
192.168.2.2 rgw.yanceph.com
2.2.3 访问rgw.yanceph.com 测试:

2.2.4 如需https协议, 可以申请域名的ssl证书并在nginx配置即可,配置文件修改如下
listen 443 ssl;
server_name lrgw.yanceph.com;
ssl_certificate cert/rgw.yanceph.comt.pem;
ssl_certificate_key cert/rgw.yanceph.com.key;
charset utf-8;
3.Ceph dashboard
Ceph dashboard 是通过一个web 界面,对已经运行的ceph 集群进行状态查看及功能配置等功能,
3.1 启用dashboard 插件
Ceph mgr 是一个多插件( 模块化) 的组件, 其组件可以单独的启用或关闭
root@mgr1:~# apt install ceph-mgr-dashboard
3.2 查看开启的模块
cephuser@ceph-deploy:~/ceph-cluster$ ceph mgr module ls |head -n 30
{
...
"enabled_modules": [
"dashboard",
"iostat",
"nfs",
"restful"
],
...
}
3.3 启用dashboard 模块
Ceph dashboard 在mgr 节点进行开启设置,并且可以配置开启或者关闭SSL
# 开启dashboard模块
$ ceph mgr module enable dashboard
# 开启dashboard模块的ssl (关闭是false)
$ ceph config set mgr mgr/dashboard/ssl true
# 设置监听地址
ceph confi set mgr mgr/dashboard/mgr1/server_addr 192.168.2.31
#设置监听端口
ceph confi set mgr mgr/dashboard/mgr1/server_port 9009
如果集群报错,需要重启mgr服务
cephuser@ceph-deploy:~/ceph-cluster$ ceph -s
cluster:
id: 54ed6318-9830-4152-917c-f1af7fa1002a
health: HEALTH_ERR
Module 'dashboard' has failed: OSError("Port 8080 not free on '192.168.2.31'",)
root@mgr1:~# systemctl restart ceph-mgr@mgr1.service
3.4 查看dashboard服务状态
cephuser@ceph-deploy:~/ceph-cluster$ ceph mgr services
{
"dashboard": "http://192.168.2.31:9009/"
}
3.5 设置dashboard账号和密码
$ touch ceph-dashboard-passwd.txt
$ echo admin123123 >> ceph-dashboard-passwd.txt
$ ceph dashboard set-login-credentials admin -i ceph-dashboard-passwd.txt
******************************************************************
*** WARNING: this command is deprecated. ***
*** Please use the ac-user-* related commands to manage users. ***
******************************************************************
3.6 验证并访问dashboard
3.7 配置dashboard SSL
# ceph 自签名证书
$ ceph dashboard create-self-signed-cert
Self-signed certificate created
$ ceph config set mgr mgr/dashboard/ssl true
如果不生效需要重启mgr服务
root@mgr1:~# systemctl restart ceph-mgr@mgr1.service
3.8 查看dashboard ssl
cephuser@ceph-deploy:~/ceph-cluster$ ceph mgr services
{
"dashboard": "https://192.168.2.31:8443/"
}
3.9 使用https访问dashboard

4.使用prometheus监控ceph node节点
4.1 部署prometheus
# 创建专用目录
mkdir /apps
cd /apps
# 下载安装包
root@mgr1:/apps# wget https://mirrors.tuna.tsinghua.edu.cn/github-release/prometheus/prometheus/LatestRelease/prometheus-2.29.2.linux-amd64.tar.gz
# 解压安装包
root@mgr1:/apps# tar xf prometheus-2.29.2.linux-amd64.tar.gz
# 创建软连接,主要方便后续版本升级,执行修改软连接即可
root@mgr1:/apps# ln -s /apps/prometheus-2.29.2.linux-amd64 /apps/prometheus
4.2 配置prometheus
# 新建配置文件
# vim /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target
[Service]
Restart=on-failure
WorkingDirectory=/apps/prometheus/
ExecStart=/apps/prometheus/prometheus --config.file=/apps/prometheus/prometheus.yml
[Install]
WantedBy=multi-user.target
#启动服务
root@mgr1:/apps/prometheus# systemctl daemon-reload
root@mgr1:/apps/prometheus# systemctl restart prometheus
root@mgr1:/apps/prometheus# systemctl enable prometheus
4.3 浏览器访问prometheus
4.4 部署node_exporter
各node(osd)节点安装node_exporter
# 创建目录
root@osd1:/apps# mkdir /apps && cd !$
# 下载安装包
root@osd1:/apps# wget https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz
# 解压
root@osd1:/apps# tar xf node_exporter-1.2.2.linux-amd64.tar.gz
# 为方便后续版本升级创建软连接
root@osd1:/apps# ln -sv /apps/node_exporter-1.2.2.linux-amd64
4.5 配置node_exporter
# 创建配置文件
root@osd1:/apps# vim /etc/systemd/system/node-exporter.service
[Unit]
Description=Prometheus Node Exporter
After=network.target
[Service]
ExecStart=/apps/node_exporter/node_exporter
[Install]
WantedBy=multi-user.target
# 启动服务
root@osd1:/apps# systemctl daemon-reload
root@osd1:/apps# systemctl restart node-exporter
root@osd1:/apps# systemctl enable node-exporter
# 查看进程和监听端口号
root@osd1:/apps# ps -ef |grep exporter
root 29396 1 0 16:23 ? 00:00:00 /apps/node_exporter/node_exporter
root 29457 29017 0 16:23 pts/0 00:00:00 grep --color=auto exporter
root@osd1:/apps# netstat -ntlp |grep exporter
tcp6 0 0 :::9100 :::* LISTEN 29396/node_exporter
其他node节点也需安装
4.6 配置prometheus server,增加node节点监控配置
root@mgr1:/apps/prometheus# vim prometheus.yml
- job_name: 'ceph-node-data'
static_configs:
- targets: ['192.168.2.41:9100','192.168.2.42:9100','192.168.2.43:9100','192.168.2.44:9100']
-
# 重启服务
root@mgr1:/apps/prometheus# systemctl restart prometheus.service
4.7浏览器访问

5.通过prometheus 监控ceph 服务
Ceph manager 内部的模块中包含了prometheus 的监控模块,并监听在每个manager 节点的9283 端口,该端口用于将采集到的信息通过http 接口向prometheus 提供数据
5.1 启用ceph prometheus 监控模块
$ ceph mgr module enable prometheus
5.2 prometheus server 验证监听端口
root@mgr1:/apps/prometheus# netstat -ntlp |grep 9283
tcp 0 0 192.168.2.31:9283 0.0.0.0:* LISTEN 2687/ceph-mgr
5.3 验证manager 数据
curl "http://192.168.2.31:9283"
5.4 配置prometheus采集数据
root@mgr1:/apps/prometheus# vim prometheus.yml
- job_name: 'ceph-cluster-data'
static_configs:
- targets: ['192.168.2.31:9283']
6. 通过grafana显示监控数据
通过granfana 显示对ceph 的集群监控数据及node 数据
6.1 安装grafana
# 安装依赖包
root@mgr1:/apps# apt-get install -y adduser libfontconfig1
# 下载安装包
root@mgr1:/apps# wget https://dl.grafana.com/oss/release/grafana_8.1.2_amd64.deb
# 安装
root@mgr1:/apps# dpkg -i grafana_8.1.2_amd64.deb
# 启动
root@mgr1:/apps# systemctl restart grafana-server.service
# 设置开机自启动
root@mgr1:/apps# systemctl enable grafana-server.service
6.2 浏览器访问
初始账号密码admin:admin
6.3 配置数据源
configuration -> Data souces

6.4 导入模板
create -> import
2842

5346

ceph rgw的使用,dashboard和监控的更多相关文章
- Centos7下设置ceph 12.2.1 (luminous)dashboard UI监控功能
前言 本文所使用的集群是作者在博客 Centos7下部署ceph 12.2.1 (luminous)集群及RBD使用 中所搭建的集群 dashboard是为了完成对集群状态进行UI监控所开发的功能, ...
- 分布式存储系统之Ceph集群启用Dashboard及使用Prometheus监控Ceph
前文我们了解了Ceph之上的RadosGW基础使用相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/16768998.html:今天我们来聊一聊Ceph启 ...
- ceph rgw java sdk 使用域名访问服务时需要设置s3client的配置项 PathStyleAccess 为true, 负责将报域名异常
Caused by: java.net.UnknownHostException: my-new-bucket.s3.yyclouds.com at java.net.InetAddress.getA ...
- 趣解 ceph rgw multisite data sync 机制
multisite是ceph rgw对象数据异地容灾备份的一个有效方案,笔者希望深入理解该技术,并应用于生产环境中,然而rgw的这部分代码晦涩难懂,笔者多次尝试阅读,仍云里雾里不解其意,最终流着泪咬着 ...
- CEPH RGW多 ZONE的配置
相关的名称解释 Region :可以理解为区域,是基于地理位置的逻辑划分:如:华南,华北之类,包含多个region的Ceph集群必须指定一个master region,一个region可以包含一个或者 ...
- SpringCloud学习笔记(5):Hystrix Dashboard可视化监控数据
简介 上篇文章中讲了使用Hystrix实现容错,除此之外,Hystrix还提供了近乎实时的监控.本文将介绍如何进行服务监控以及使用Hystrix Dashboard来让监控数据图形化. 项目介绍 sc ...
- 010 Ceph RGW对象存储
一.对象存储 1.1 介绍 通过对象存储,将数据存储为对象,每个对象除了包含数据,还包含数据自身的元数据 对象通过Object ID来检索,无法通过普通文件系统操作来直接访问对象,只能通过API来访问 ...
- Ceph RGW服务 使用s3 java sdk 分片文件上传API 报‘SignatureDoesNotMatch’ 异常的定位及规避方案
import java.io.File; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile ...
- Ceph RGW 创建默认的pool
使用Ceph-deploy完成RGW服务部署后(最好是在部署RGW服务前建立如下这些pool),使用sudo ceph osd lspools 命令,会发现RGW自动以默认参数创建了N个rgw相关的p ...
随机推荐
- 云原生的弹性 AI 训练系列之三:借助弹性伸缩的 Jupyter Notebook,大幅提高 GPU 利用率
Jupyter Notebooks 在 Kubernetes 上部署往往需要绑定一张 GPU,而大多数时候 GPU 并没有被使用,因此利用率低下.为了解决这一问题,我们开源了 elastic-jupy ...
- C#开发BIMFACE系列50 Web网页中使用jQuery加载模型与图纸
BIMFACE二次开发系列目录 [已更新最新开发文章,点击查看详细] 在前一篇博客<C#开发BIMFACE系列49 Web网页集成BIMFACE应用的技术方案>中介绍了目前市场主流 ...
- .NET 分布式系统架构(有转载部分)
一.设计目的 搭建一个大型平台需要综合考虑很多方面,不单纯是软件架构,还包括网络和硬件设备等.由于现代大部分应用建设都面临用户多.高并发.高可用的需求,传统软件架构已不能满足需求,需要支持分布式软件架 ...
- ScatterLayout:分散布局在py中的引用
""" ScatterLayout:分散布局 """ from kivy.app import App from kivy.uix.scat ...
- Java-基础-ArrayList
1. 简介 ArrayList 实现了 List 接口,其底层基于数组实现容量大小动态可变.既然是数组,那么元素存放一定是有序的,并允许包括 null 在内的所有元素. 每个 ArrayList 实例 ...
- Java:并发笔记-08
Java:并发笔记-08 说明:这是看了 bilibili 上 黑马程序员 的课程 java并发编程 后做的笔记 7. 共享模型之工具-1 7.1 线程池 1. 自定义线程池 步骤1:自定义拒绝策略接 ...
- Java:并发笔记-05
Java:并发笔记-05 说明:这是看了 bilibili 上 黑马程序员 的课程 java并发编程 后做的笔记 4. 共享模型之内存 本章内容 上一章讲解的 Monitor 主要关注的是访问共享变量 ...
- Ubuntu 用户管理/权限管理
Ubuntu 用户管理/权限管理 小小记录一下 Ubuntu 下用户/权限管理常用的一些命令 用户管理 组管理 文件权限 给用户添加 sudo 权限 给用户添加 sudo 权限 首先先给出几个文件 / ...
- [技术博客]WEB实现划词右键操作
[技术博客]WEB实现划词右键操作 一.功能解释 简单地对题目中描述的功能进行解释:在浏览器中,通过拖动鼠标选中一个词(或一段文字),右键弹出菜单,且菜单为自定义菜单,而非浏览器本身的菜单.类似的功能 ...
- [BZOJ4399]魔法少女LJJ----------线段树进阶
感谢线段树进阶,给了我重新做人的机会.---------------某不知名OIer,Keen_z Description 题目描述 在森林中见过会动的树,在沙漠中见过会动的仙人掌过后,魔法少女LJJ ...