Calamari 安装
在CentOS 7 安装Calamari
Ceph是一款开源的SDS软件,对于开源安装好可以只是完成了第一步,后面的监控运维才是重点;要想直观的了解集群的运行状态,监控软件也就必不可少了,而对于Ceph的监控用得比较多的有Zabbix,inkScope,Calamari等。下文将详细说明Calamari在CentOS 7上的安装过程。
获取Calamari源码包
#> git clone https://github.com/ceph/calamari.git
#> git clone https://github.com/ceph/calamari-clients.git
#> git clone https://github.com/ceph/Diamond
构建calamari server的rpm包
#> cd calamari
#> yum remove prelink //避免安装时出现cpio Dismatch 错误
#> ./build-rpm.sh
构建完成后会在父目录下的rpmbuild目录路径下生成rpm安装包
安装calamari server
#> cd .. //从calamari目录退出到父目录
#> yum localinstall rpmbuild/RPMS/x86_64/calamari-server-1.3.1.1-101_g945d16a.el6.x86_64.rpm
构建及安装calamari client
安装依赖
#> yum install npm ruby rubygems ruby-devel
#> npm install -g grunt grunt-cli bower grunt-contrib-compass
#> gem update --system && gem install compass
如果由于网络原因,gem源更新失败,请按如下方式处理:
#> gem sources
#> gem sources -r https://rubygems.org/
#> gem sources -a https://ruby.taobao.org/
#> gem sources -u
编译并安装calamari client
#> cd calamari-clients
#> make build-real
#> make dist //会在上级目录生成 calamari-clients_1.2.2.tar.gz tar包
#> cd .. //返回calamari-client父目录
#> tar -zxvf calamari-clients_1.2.2.tar.gz //解压
#> mkdir -p /opt/calamari/webapp/content //创建目录
#> cd calamari-clients-1.2.2
//拷贝内容到下述目录
#>for dir in manage admin login dashboard
do
mkdir -p /opt/calamari/webapp/content/"$dir"
cp -pr "$dir"/dist/* /opt/calamari/webapp/content/"$dir"/
done
如果make build-real
过程中出现如下因为网络原因下载依赖包失败的问题,请将对应文件中的依赖包下载地址替换为一个可用url,举例如下:
phantomjs@1.9.18 install /datapool/calamari-clients/manage/node_modules/karma-phantomjs-launcher/node_modules/phantomjs //install.js目录
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /datapool/calamari-clients/manage/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
Error making request.
Error: connect ETIMEDOUT //GFW导致的下载超时
at errnoException (net.js:905:11)
at Object.afterConnect [as oncomplete] (net.js:896:19)
上述错误提示下载依赖包phantomjs-1.9.8-linux-x86_64.tar.bz2失败,按如下方式替换install.js中的下载地址即可(这里使用淘宝的源):
var cdnUrl = process.env.npm_config_phantomjs_cdnurl || process.env.PHANTOMJS_CDNURL || 'http://npm.taobao.org/mirrors/phantomjs'
初始化calamari
经过上面的过程,calamari server及calamari client就安装完成,在首次使用calamari前需要先完成calamari的初始化,如下:
#> calamari-ctl initialize
如果初始化过程中,出现重启服务卡死,则需要升级supervisor到3.0以上:
#> git clone https://github.com/Supervisor/supervisor.git
#> cd supervisor && python setup.py install
配置calamari server
配置防火墙
### for salt-master
#> iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 4505 -j ACCEPT
#> iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 4506 -j ACCEPT
### for carbon
#> iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 2003 -j ACCEPT
#> iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 2004 -j ACCEPT
配置saltstack认证
当ceph 节点上的salt-minion服务启动之后,会自动向salt-master请求认证。在Calamari server上可以通过下面的命令查看salt-minion密钥的列表:
#> salt-key -L
刚刚启动salt-minion服务的ceph 节点会出现在Unaccepted Keys列表之后,要使得Calamari能够通过saltstack管理ceph 节点,需要对这些密钥进行认证:
#> salt-key -A
安装diamond及salt-minion
构建diamond rpm包
#> cd Diamond
#> git checkout origin/calamari
#> make rpm //在dist目录下生成diamond-3.4.67-0.noarch.rpm 包
在所有ceph节点上安装salt-minion及diamond
首先将刚才构建的diamond rpm包拷贝到所有的ceph节点上,执行下述命令安装相关的软件包:
#> yum localinstall diamond-3.4.67-0.noarch.rpm
#> yum install -y salt-minion
在所有ceph节点上配置salt-minion并启动
#> touch /etc/salt/minion.d/calamari.conf
###calamari-server-name为calamari 服务器的地址(ip或域名)
#> echo "master: {calamari-server-name}" > /etc/salt/minion.d/calamari.conf
### :与后面的地址间有个空格
#> echo "master: {calamari-server-name}" >> /etc/salt/minion
#> service salt-minion restart
#> service diamond start
如果启动diamond失败,查看diamond日志有如下错误:
#> tail -f /var/log/diamond/diamond.log
[2015-11-03 19:06:35,044] [MainThread] pysnmp.entity.rfc3413.oneliner.cmdgen failed to load
请 以root用户运行diamond服务,修改如下:
#> echo "user=root,group=root" >> /etc/diamond/diamond.conf
至此calamari监控就安装配置完成了,你可以再web上看到ceph集群的状态了。如果人品刚好有点问题,那就继续看下面的故障处理吧!
踩过的那些坑
Q:diamond日志文件中出现如下的错误:
-- Unit diamond.service has begun starting up.
Nov 03 18:46:27 ceph-osd2 diamond[3790]: Failed to acquire lockfile: /var/lock/subsys/diamond.
Nov 03 18:46:27 ceph-osd2 diamond[3790]: Held by 14377
Nov 03 18:46:27 ceph-osd2 diamond[3790]: [FAILED]
Nov 03 18:46:27 ceph-osd2 systemd[1]: diamond.service: control process exited, code=exited status=1
Nov 03 18:46:27 ceph-osd2 systemd[1]: Failed to start LSB: System statistics collector for Graphite.
删除/var/lock/subsys目录下面的文件就好了:
#> rm -f /var/lock/subsys/*
Q: 打开网页出现500错误
1)有可能是cthulhu-manager进程没有起来,重启supervisor就好
#> /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf
2)有可能是写日志没有权限/var/log/calamari/*
#> chmod 766 /var && chmod -R 766 /var/calamari
Q: 打开/dashboard/页面总是报internal server error(5),并有如下错误日志:
#> vi /var/log/calamari/calamari.log
2015-11-05 20:25:39,252 - ERROR - django.request Internal Server Error: /api/v1/cluster/4a4dd60f-c8bb-4982-a1b4-9b891f78c30b/osd
Traceback (most recent call last):
File "/opt/calamari/venv/lib/python2.6/site-packages/django/core/handlers/base.py", line 117, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/opt/calamari/venv/lib/python2.6/site-packages/rest_framework/viewsets.py", line 78, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_rest_api-0.1-py2.6.egg/calamari_rest/views/rpc_view.py", line 94, in dispatch
return super(RPCViewSet, self).dispatch(request, *args, **kwargs)
File "/opt/calamari/venv/lib/python2.6/site-packages/django/views/decorators/csrf.py", line 77, in wrapped_view
return view_func(*args, **kwargs)
File "/opt/calamari/venv/lib/python2.6/site-packages/rest_framework/views.py", line 399, in dispatch
response = self.handle_exception(exc)
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_rest_api-0.1-py2.6.egg/calamari_rest/views/rpc_view.py", line 111, in handle_exception
return super(RPCViewSet, self).handle_exception(exc)
File "/opt/calamari/venv/lib/python2.6/site-packages/rest_framework/views.py", line 396, in dispatch
response = handler(request, *args, **kwargs)
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_rest_api-0.1-py2.6.egg/calamari_rest/views/v1.py", line 423, in get
osds, osds_by_pg_state = self.generate(pg_summary, osd_map, server_info, servers)
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_rest_api-0.1-py2.6.egg/calamari_rest/views/v1.py", line 371, in generate
for osd_id, osd_pg_summary in pg_summary['by_osd'].items():
TypeError: 'NoneType' object is unsubscriptable
#> vi /var/log/calamari/cthulhu.log
2015-11-04 17:38:59,278 - ERROR - cthulhu Exception handling message with tag ceph/cluster/4a4dd60f-c8bb-4982-a1b4-9b891f78c30b
Traceback (most recent call last):
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_cthulhu-0.1-py2.6.egg/cthulhu/manager/cluster_monitor.py", line 244, in _run
self.on_heartbeat(data['id'], data['data'])
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_cthulhu-0.1-py2.6.egg/cthulhu/gevent_util.py", line 35, in wrapped
return func(*args, **kwargs)
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_cthulhu-0.1-py2.6.egg/cthulhu/manager/cluster_monitor.py", line 346, in on_heartbeat
cluster_data['versions'][sync_type.str])
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_cthulhu-0.1-py2.6.egg/cthulhu/manager/cluster_monitor.py", line 99, in on_version
self.fetch(reported_by, sync_type)
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_cthulhu-0.1-py2.6.egg/cthulhu/manager/cluster_monitor.py", line 109, in fetch
client = LocalClient(config.get('cthulhu', 'salt_config_path'))
File "/usr/lib/python2.6/site-packages/salt/client/__init__.py", line 136, in __init__
listen=not self.opts.get('__worker', False))
File "/usr/lib/python2.6/site-packages/salt/utils/event.py", line 114, in get_event
return MasterEvent(sock_dir, opts)
File "/usr/lib/python2.6/site-packages/salt/utils/event.py", line 559, in __init__
super(MasterEvent, self).__init__('master', sock_dir, opts)
File "/usr/lib/python2.6/site-packages/salt/utils/event.py", line 181, in __init__
self.get_event(wait=1)
File "/usr/lib/python2.6/site-packages/salt/utils/event.py", line 410, in get_event
ret = self._get_event(wait, tag, tags_regex)
File "/usr/lib/python2.6/site-packages/salt/utils/event.py", line 351, in _get_event
socks = dict(self.poller.poll(wait * 1000))
File "/opt/calamari/venv/lib/python2.6/site-packages/zmq/green/poll.py", line 81, in poll
select.select(rlist, wlist, xlist)
File "/opt/calamari/venv/lib/python2.6/site-packages/gevent/select.py", line 68, in select
result.event.wait(timeout=timeout)
File "/opt/calamari/venv/lib/python2.6/site-packages/gevent/event.py", line 77, in wait
result = self.hub.switch()
File "/opt/calamari/venv/lib/python2.6/site-packages/gevent/hub.py", line 337, in switch
switch_out()
File "/opt/calamari/venv/lib/python2.6/site-packages/calamari_cthulhu-0.1-py2.6.egg/cthulhu/gevent_util.py", line 15, in asserter
raise ForbiddenYield("Context switch during `nosleep` region!")
出现该问题,是因为saltstack(salt, salt-master, salt-minion)与calamari不兼容;在CentOS 7系统上默认安装salt-2015.5.5这个版本,
为解决该问题,需卸载该版本,并安装salt-2014.1.x版本问题解决, 我安装salt-2014.1.13-1工作正常;salt可以从如下站点下载: http://rpmfind.net/
Q: diamond日志文件中出现如下错误:
#> tail -f /var/log/diamond/diamond.log
GraphiteHandler: Failed to connect to 10.168.122.165:2003. timed out.
1).可能是防火墙问题,查看防火墙设置即可
2).可能是路由问题, 查看路由设置即可
3).可能服务端cthulhu-manager进程没有启动,启动该进程即可
Q:安装salt-minion报如下错误:
Error: Package: python-msgpack-0.4.6-1.el6.x86_64 (epel)
Requires: python(abi) = 2.6
Installed: python-2.7.5-16.el7.x86_64 (@anaconda)
python(abi) = 2.7
python(abi) = 2.7
再安装一个python2.6,然后安装salt-minion的时候指定python版本为2.6
configure --with-python2.6=/usr/local/python2.6
Calamari 安装的更多相关文章
- CEPH监控软件
概述 目前主流的Ceph开源监控软件有:Calamari.VSM.Inkscope.Ceph-Dash.Zabbix等,下面简单介绍下各个开源组件. Calamari 概述 Calamari对外提供了 ...
- cephonebox发布
前言 现在已经是2016年收官的一个月了,之前一直想做一个calamari的集成版本,之所以有这个想法,是因为,即使在已经打好包的情况下,因为各种软件版本的原因,造成很多人无法配置成功,calamar ...
- 安装部署Ceph Calamari
根据http://ovirt-china.org/mediawiki/index.php/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2Ceph_Calamari 原文如下: ...
- centos6安装calamari
安装操作系统 首先安装操作系统centos6,安装过程选择的是base server,这个不相同不要紧,出现缺少包的时候去iso找出来安装就可以了 calamari的简单介绍 首先简单的介绍下cala ...
- ceph calamari 监控系统安装 on ubuntu 14.04
在 ubuntu 14.04 上安装ceph calamari时,遇到calamari web界面中node server可以正常添加,但cluster 集群无法显示的问题. 经过定位,是因为salt ...
- 在 CentOS 7.0 上安装配置 Ceph 存储
来自: https://linux.cn/article-6624-1.html Ceph 是一个将数据存储在单一分布式计算机集群上的开源软件平台.当你计划构建一个云时,你首先需要决定如何实现你的存储 ...
- 解决calamari无法获取节点信息的bug
前言 一直在做calamari的相关的一些打包和安装的工作,都是业余弄的东西,所以并没有仔细的进行功能点的验证测试,正好ceph社区群里面有人问了个问题 calamari上是不是能看到ceph的ver ...
- docker——容器安装tomcat
写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...
- 网络原因导致 npm 软件包 node-sass / gulp-sass 安装失败的处理办法
如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件.本文主要讨论在不变更 ...
随机推荐
- 从最近面试聊聊我所感受的.net天花板
#0 前言 入职新公司没多久,闲来无事在博客园闲逛,看到园友分享的面试经历,正好自己这段时间面试找工作,也挺多感想的,干脆趁这个机会总结整理一下.博主13年开始实习,14年毕业.到现在也工作五六年了. ...
- linux目录数
FHS Filesystem Hierarchy Standard(文件系统层次化标准,[ˈhaɪərɑ:rki] 等级制度)的缩写,多数Linux版本采用这种文件组织形式,类似于Windows操作系 ...
- .NET资源泄露与处理方案
.NET虽然拥有强大易用的垃圾回收机制,但并不是因为这样,你就可以对资源管理放任不管,其实在稍不注意的时候,可能就造成了资源泄露,甚至因此导致系统崩溃,到那时再来排查问题就已经是困难重重. 一.知识点 ...
- Json用途
Json用途 转自:https://www.cnblogs.com/daikefeng/p/6366229.html JSON定义 JSON(JavaScript Object Notation) ...
- 2C 还是 2B,跟找工作有什么关系?
通常,我们会把公司的业务类型分成以下几种: 2C,to Customer,指面向个人客户的业务,即将公司的产品或服务销售给个人,通常做出购买决策的个人也是使用产品或服务的用户.举例说明,像 BAT 发 ...
- 物联网架构成长之路(47)-利用GitLab实现CI持续集成
0.前言 前段时间,考虑到要练习部署一套CI/CD的系统.一开始考虑到Jenkins,随着这两天的了解,发现最新版的GitLab已经提供有CI/CD集成了.所以本次博客,干脆一步到位,直接用GitLa ...
- python3 之 函数传参
一.可变对象与不可变对象 在 python 中,strings, tuples, 和 numbers 是不可更改的对象,而 list,dict 等则是可以修改的对象. 不可变类型:变量赋值 a=5 后 ...
- SpringSecurity代码实现JWT接口权限授予与校验
通过笔者前两篇文章的说明,相信大家已经知道JWT是什么,怎么用,该如何结合Spring Security使用.那么本节就用代码来具体的实现一下JWT登录认证及鉴权的流程. 一.环境准备工作 建立Spr ...
- 仿微信 即时聊天工具 - SignalR (一)
话不多说,先上图 背景: 微信聊天,经常会遇见视频发不了,嗯,还有聊天不方便的问题,于是我就自己买了服务器,部署了一套可以直接在微信打开的网页进行聊天,这样只需要发送个url给朋友,就能聊天了! 由于 ...
- Spring(Bean)3
bean的继承<!-- bean 的继承 作为模板来使用. 可以通过abstract="true"来指定把该bean配置为·抽象的. 通过abstract="tru ...