ceph-rest-api的使用
来源:互联网 发布:汕头 钦差 知乎 编辑:程序博客网 时间:2024/05/16 09:16
最近在想怎么去更有效的监控和管理ceph集群的问题,之前主要就是脚本调用ceph的命令,有没有更方便和有效的方式呢?之前部署过calamari,不过这个calamari比较庞大,所以看看ceph原生的rest api.
ceph rest api是一个wsgi(Web Service Gateway Interface)应用,默认监听5000端口
启动ceph-rest-api:
[root@CHN-ID-3-3W7 ~]# ceph-rest-api -n client.admin
* Running on http://0.0.0.0:5000/
* Running on http://0.0.0.0:5000/
如果提示找不到jinja,则需执行:
easy_install Jinja2或者pip install Jinja2
如何使用:
[root@CHN-ID-3-3W7 ~]# curl 127.0.0.1:5000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="/api/v0.1">/api/v0.1</a>. If not click the link.[root@CHN-ID-3-3W7 ~]#
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="/api/v0.1">/api/v0.1</a>. If not click the link.[root@CHN-ID-3-3W7 ~]#
cluster 05fb7439-f063-45b7-aa58-3977c630db3f
health HEALTH_OK
monmap e1: 3 mons at {a=10.20.42.177:6789/0,b=10.20.42.187:6789/0,c=10.20.42.166:6789/0}, election epoch 674, quorum 0,1,2 c,a,b
osdmap e1157: 188 osds: 188 up, 188 in
pgmap v2394280: 84928 pgs, 9 pools, 426 GB data, 1094 kobjects
2742 GB used, 681 TB / 683 TB avail
84928 active+clean
client io 144 kB/s rd, 438 B/s wr, 109 op/s
min_size: 1
相应的可以在启动ceph-rest-api的终端看到请求的url和对应的响应码:
[root@CHN-ID-3-3W7 ~]# ceph-rest-api -n client.admin
* Running on http://0.0.0.0:5000/
127.0.0.1 - - [18/Jun/2015 19:34:28] "GET /api/v0.1/status HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2015 19:34:42] "GET / HTTP/1.1" 302 -
127.0.0.1 - - [18/Jun/2015 19:35:09] "GET /api/v0.1/status HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2015 19:35:53] "GET /api/v0.1/osd/pool/get?pool=.rgw.buckets&var=min_size HTTP/1.1" 200 -
* Running on http://0.0.0.0:5000/
127.0.0.1 - - [18/Jun/2015 19:34:28] "GET /api/v0.1/status HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2015 19:34:42] "GET / HTTP/1.1" 302 -
127.0.0.1 - - [18/Jun/2015 19:35:09] "GET /api/v0.1/status HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2015 19:35:53] "GET /api/v0.1/osd/pool/get?pool=.rgw.buckets&var=min_size HTTP/1.1" 200 -
从这里看其功能和我们直接在节点上执行cli的命令的作用相同,但是其提供这种http请求方式的接口去管理和监控集群,能够很方便的集成到监控平台中。
参考:
https://dmsimard.com/2013/12/21/experimenting-with-the-ceph-rest-api/
https://ceph.com/category/ceph-rest-api/ -------------这个包含了所有的api对应的url
0 0
- ceph-rest-api的使用
- ceph-rest-api的使用
- Ceph Rest Api 文档
- Director REST API 的使用
- hbase rest api的使用
- python使用Ceph API 查看image使用的大小
- REST API 使用
- ceph的librados api解释
- 使用 web.rest 调用 REST API
- 使用 Rest-Assured 测试 REST API
- ALM11的REST API
- REST风格的API
- rest api的编写
- ceph 0.47的使用
- ceph-dencoder的使用
- 转 -- 使用 Twitter REST API
- 使用SoapUI mock REST API
- 使用SpringMVC 创建REST API
- 自己动手解Json!(IOS利用分治法解析Json)(三)
- 【Android】利用Notification操作设备的通知栏
- POJ 1001-Exponentiation,测试用例及本人未优化代码
- c++的设计模式之备忘录模式
- Android-IM架构设计
- ceph-rest-api的使用
- OpenCV基础篇之Mat数据结构
- 在Ubuntu Kylin下安装QQ教程
- 二叉树 UVA 548 Tree
- 判断和类型
- uCOS中任务调度时的上下文切换
- 【华为oj】计算每个名字最大可能的“漂亮度”
- iBatis开发环境搭建和第一个程序
- 制作自己的静态链接库并应用到程序中