在CentOS 7 安装Calamari

2016年04月17日 18:59:06 lizhongwen1987 阅读数 8055更多

分类专栏: Ceph

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/lzw06061139/article/details/51174588

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.log2015-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.logGraphiteHandler: 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

转载于:https://www.cnblogs.com/flytor/p/11425135.html

Calamari 安装相关推荐

  1. Ceph Calamari安装问题汇总

    在Ceph Calamari的安装(Ubuntu 14.04)过程中遇到很多问题,现总结如下: 1 saltstack报错:The Salt Master has rejected this mini ...

  2. Ceph 集群监控之Calamari 安装部署

    部署环境说明 其中,Calamari Server的版本是从ceph社区百度网盘共享的镜像安装的. 网盘地址是: http://pan.baidu.com/s/1o6BT8sa#path=%252FC ...

  3. Ceph Calamari 安装(Ubuntu14.04)

    1. 概述 Calamari的整个部署架构可以简化为下图,包含客户端和Calamari系统.而Calamari系统由Calamari服务端和运行在Ceph集群上的代理组成.代理不断将数据发送到Cala ...

  4. calamari 安装步骤

    1.获取calamari相关代码 # git clone https://github.com/ceph/calamari.git # git clone https://github.com/cep ...

  5. 在ceph 的admin-node安装calamari详细步骤

    ####ceph系统#### 1.linux版本:Centos Linux release 7.1.1503 2.内核版本:Linux version 3.10.0-229.20.1.el7.x86_ ...

  6. ceph管理界面calamari(未成功)

    其他监控方案见如下网址 https://www.cnblogs.com/yuezhimi/p/13067499.html calamari介绍 calamari安装包括calamari-server. ...

  7. 将ceph与calamari相连(connect ceph servers to calamari)

    前提: 已安装Calamari server,且the ceph servers are accessible from the Calamari server using SSH. 方法1: 用 c ...

  8. 解决Failure to find org.glassfish:javax.el:pom:3.0.1-b06-SNAPSHOT

    问题描述 Maven项目编译打包报错 Failure to find org.glassfish:javax.el:pom:3.0.1-b06-SNAPSHOT. Failure to find or ...

  9. rcm认证_这款小型rcm可以更精确地执行外科手术

    rcm认证 Harvard researchers drew upon inspiration from the Japanese art of Origami to develop this inn ...

最新文章

  1. 2022-2028年中国二次供水产业发展动态及投资战略规划报告
  2. [C++]constexpr函数
  3. 已安装nginx动态添加模块
  4. C++ vector用法
  5. NotificationManager滑动不退出_退出支付宝的相互宝大病互助计划居然需要8个步骤!...
  6. 最后一战 源代码_不会为争冠出卖灵魂!卡特职业生涯最后一章:“半神半人”的切换...
  7. 汉字笔顺口诀_【小学语文知识】汉字书写笔顺口诀+书写规则
  8. IE10 访问 ASP.NET 站点的问题
  9. CSS demo:flaot amp; clear float
  10. 如何格式化搭载 Apple 芯片的 Mac?
  11. 机器学习时会发生什么
  12. 转载--认识迅雷界面引擎
  13. pxe(hanewin)安装ubuntu-七侠镇莫小贝
  14. windows xp sp3 下载地址
  15. Trilateration三边测量定位算法
  16. BZOJ 2286 SDOI2011 消耗战 倍增LCA+单调栈
  17. python 当前日期_python 当前时间获取方法
  18. 【信息检索】【评价】 IR Evaluation
  19. 水星怎么设置网速最快_水星路由器怎么设置网速最快
  20. 舒缓肩颈酸痛,温暖呵护颈椎,宾多康智能颈椎按摩仪体验

热门文章

  1. Vue - 网站首屏加载等待动画(极简解决方案)
  2. 小程序商城和社区团购小程序,商家应该选哪个?
  3. 织梦任意前台密码修改漏洞复现
  4. 使用python包scanpy读取单细胞h5ad文件
  5. 表达式的LenB(123程序设计ABC)的值是27吗
  6. Python栈的应用之二进制与十进制转换
  7. 基于物联网的室内环境监测系统的背景描述
  8. 2016团体程序设计天梯赛-决赛-部分题解
  9. linux u盘版下载官网,Linux助手:Universal USB Installer新版下载
  10. 《分布式计算云计算与大数据》第一章