安装calamari-server

之前已经打好了calamari-server的rpm包这里直接安装就可以了

添加salt的源

[root@calamari el6]# vim /etc/yum.repos.d/repo-saltstack-el7.repo

添加

[repo-saltstack-el7]
name=SaltStack EL7 Repo
baseurl=https://repo.saltstack.com/yum/rhel7/
skip_if_unavailable=True
gpgcheck=0
gpgkey=https://repo.saltstack.com/yum/rhel7/SALTSTACK-GPG-KEY.pub
enabled=1
enabled_metadata=1
[root@calamari el6]# yum makecache

安装calamari-server

将calamari-server-1.3.1.1-105_g79c8df2.el7.centos.x86_64.rpm拷贝到系统的/root/下

[root@calamari ~]# yum localinstall calamari-server-1.3.1.1-105_g79c8df2.el7.centos.x86_64.rpm
[root@calamari ~]# yum install mod_wsgi

注意检查下下载的salt相关版本是不是下面的这个版本(其他版本有bug)

salt    noarch  2015.8.1-1.el7

配置calamari-server

初始化calmari

[root@calamari ~]# calamari-ctl initialize
[INFO] Loading configuration..
[INFO] Starting/enabling salt...
[INFO] Starting/enabling postgres...
[INFO] Initializing database...
[INFO] You will now be prompted for login details for the administrative user account.  This is the account you will use to log into the web interface once setup is complete.
Username (leave blank to use 'root'): root
Email address: test@qq.com
Password: 
Password (again): 
Superuser created successfully.
[INFO] Initializing web interface...
[INFO] Starting/enabling services...
[INFO] Restarting services...
[INFO] Complete.

这个地方是启动的一些服务的初始化,配置的是访问web的用户名密码,我的是 root,123456

修改calamari的密码的方法

修改用户名密码

# calamari-ctl change_password --password {password} {user-name}
[root@calamari ~]# calamari-ctl change_password --password 1234567 root
[root@calamari ceph]# ceph-deploy calamari connect calamari

在所有节点安装diamond

这个是用来收集系统上的监控数据的,然后发送给cabon 这个需要在所有的节点上安装,这个会发送集群的数据和系统的监控数据给监控平台

[root@calamari calamari]# rpm -ivh diamond-3.4.67-0.noarch.rpm
[root@calamari calamari]#  mv /etc/diamond/diamond.conf.example /etc/diamond/diamond.conf
[root@calamari ceph]# /etc/init.d/diamond restart
Restarting diamond (via systemctl):                        [  OK  ]

如果想修改数据的刷新频率修改两个地方

修改文件 /etc/graphite/storage-schemas.conf(默认60s)

[calamari]
pattern = .*
retentions = 60s:1d,15m:7d

修改为

[calamari]
pattern = .*
retentions = 10s:1d,15m:7d

修改: cat /etc/diamond/diamond.conf|grep

interval = 60

修改为

interval = 10

如果在初始化前,可以修改模板,注意初始化会用模板文件覆盖 /opt/calamari/salt/salt/base/diamond.conf

interval = 60

修改成

interval = 10

更新频率就是这两个文件控制的

这个地方注意修改配置文件/etc/diamond/diamond.conf 将其中的

# Graphite server host
host = node2

这个地方的host要填写你的calamari的管理平台的那台机器的主机名,这个地方是用diamond收集集群数据和硬件的数据发送到管理平台的机器的carbon进程,然后存储在whisper这个数据库当中的,所有的需要收集数据的机器都需要修改

在所有的节点上安装salt-minion

[root@calamari ceph]# yum install salt-minion

修改配置文件

[root@calamari ceph]# vim /etc/salt/minion

添加salt-master的主机名

master: calamari

重启服务

[root@calamari ceph]# service salt-minion restart

salt-master认证认可

在salt-master上执行认证的工作(也就是安装calamari-server的机器上) 查询当前的认证请求

[root@calamari ceph]#  salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
calamari
Rejected Keys:

批准认证的请求

[root@calamari ceph]# salt-key -A
The following keys are going to be accepted:
Unaccepted Keys:
calamari
Proceed? [n/Y] y
Key for minion calamari accepted.

查询是否通过认证

[root@calamari ceph]#  salt-key -L
Accepted Keys:
calamari
Denied Keys:
Unaccepted Keys:
Rejected Keys:

配置好了后用

[root@calamari calamari]# salt '*' test.ping
[root@calamari calamari]# salt '*' ceph.get_heartbeats

如果异常就要检查这里出现的是什么问题

配置calamari-server机器的文件权限

[root@calamari ceph]# cd /var/log/calamari/
[root@calamari calamari]# ll
total 320
-rw-r--r--. 1 apache apache      0 Nov 28 13:46 calamari.log
-rw-r--r--. 1 root   root   291070 Nov 28 14:09 cthulhu.log
-rw-r--r--. 1 root   root        0 Nov 28 13:46 httpd_access.log
-rw-r--r--. 1 root   root        0 Nov 28 13:46 httpd_error.log
[root@calamari calamari]# chmod 777 -R *
[root@calamari calamari]# service supervisord restart

这个地方是因为执行程序需要对这个日志有权限,不然程序会报错,这里给权限即可,给完权限重启下控制的服务,/var/log/calamari/是calamari的系统的日志目录,有问题可以在这里面查询日志 到这里就配置完了calamari-server的服务了

results matching ""

    No results matching ""