How to install Calamari for Ceph Cluster on Ubuntu 14.04

ceph calamari dashboard
Calamari is a web-based monitoring and management for Ceph. In this post we will install Calamari on a working ceph cluster. Calamari node and all Ceph nodes are running ubuntu 14.04. We will use ceph-deploy utility to install packages. This article is just for test purposes and give you an idea about Calamari installation.
We have 3 nodes in Ceph Cluster
cpm01 – Ceph Mon
cpm02 – Ceph OSD
cpm03 – Ceph OSD

Prepare a Ubuntu 14.04 machine ( can be VM ) and follow the steps below. Default installation.
Step 1
edit your /etc/hosts file and add all of your ceph nodes
10.4.4.1 cpm01
10.4.4.2 cpm02
10.4.4.3 cpm03
etc
.
.

create a user on your ceph nodes ( same username as you use in Calamari node )
ssh user@ceph-server
sudo useradd -d /home/calamariuser -m calamariuser
sudo passwd calamariuser

On ceph nodes, add your new user to sudoers in order to run without password prompt
echo "calamariuser ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/calamariuser
sudo chmod 0440 /etc/sudoers.d/calamariuser

On Calamari node, generate ssh key and copy it to all your ceph nodes.
do not run this command with sudo or root user. run it under calamariuser. Enter with defaults no password.
ssh-keygen

now copy the generated key to your ceph nodes
ssh-copy-id calamariuser@cpm01
ssh-copy-id calamariuser@cpm02
ssh-copy-id calamariuser@cpm03
etc
.
.

to make things tidy and in place
cd ~
mkdir calamarifiles
cd calamarifiles

Now download and install “ceph-deploy” utility. Don’t install ceph-deploy from default ubuntu repos. Because it doesn’t have calamari commands.( ver 1.40 ). So we will install latest deb packages from ceph.
wget http://download.ceph.com/debian-firefly/pool/main/c/ceph-deploy/ceph-deploy_1.5.28trusty_all.deb
sudo dpkg -i ceph-deploy_1.5.28trusty_all.deb
run "sudo apt-get -f install" if you meet any dependency problem.

Download the calamari deb packages
wget http://download.ceph.com/calamari/1.3.1/ubuntu/trusty/pool/main/c/calamari/calamari-server_1.3.1.1-1trusty_amd64.deb
wget http://download.ceph.com/calamari/1.3.1/ubuntu/trusty/pool/main/c/calamari-clients/calamari-clients_1.3.1.1-1trusty_all.deb
wget http://download.ceph.com/calamari/1.3.1/ubuntu/trusty/pool/main/d/diamond/diamond_3.4.67_all.deb

Step 2
Installing Salt packages
wget -O - https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
add the line in /etc/apt/sources.list
deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main
Then run the commands below
sudo apt-get update
sudo apt-get install salt-syndic
sudo apt-get install salt-minion
sudo apt-get install salt-master
sudo apt-get install -y apache2 libapache2-mod-wsgi libcairo2 supervisor python-cairo libpq5 postgresql

sudo dpkg -i calamari-server*.deb calamari-clients*.deb
After this step you may see some python dependency errors. like “python-gevent python-twisted python-greenlet python-txamqp”
It’s normal. just run sudo apt-get -f install to fix dependencies.

Once, everything is OK. run the following command and follow the instructions. It will ask you some account information for management.
sudo calamari-ctl initialize
Finally, open your web browser and visit Calamari node address then log into the Calamari user interface with the account you created.

Now,you should see a screen like below
calamarifirst

Let’s connect our nodes.

Step 1
As mentioned in the web interface we will use ceph-deploy to connect and install required packages to the nodes.
Edit cephdeploy.conf and add the master definition in the file. This information will be used by your ceph nodes to connect.

On calamari node,
nano ~/.cephdeploy.conf
add these lines top of the file. Change the master address. Save and exit.
[ceph-deploy-calamari]
master = your calamari FQDN address

Now run the following command and follow debug messages. Everything should be done without error.
ceph-deploy calamari connect [ ...]
Example
ceph-deploy calamari connect cpm01 copm02 cpm03

Step 2
Now we should copy the diamond_3.4.67_all.deb file to all ceph nodes and install it.Diamond is a python daemon that collects system metrics.

On calamari node,
cd ~/calamarifiles
scp diamond_3.4.67_all.deb calamariuser@cephnode:/tmp/

Now SSH to each ceph node and install it.
cd /tmp
dpkg -i diamond_3.4.67_all.deb

fix any dependencies if met as before.

Step 3

SSH and check each ceph node if they are all have the master: calamarinodeFQDN the following config file. Otherwise, add and restart minion service.
sudo nano /etc/salt/minion.d/calamari.conf
sudo service salt-minion restart

Make sure ceph nodes solve your calamari node FQDN. Otherwise add it to their /etc/hosts file

Step 4
Now refresh your calamari web interface. You should see your nodes requesting to register. Follow the screen instructions.
That’s all. you have a working monitoring and management system for ceph.
Feel free to ask any question

5 thoughts on “How to install Calamari for Ceph Cluster on Ubuntu 14.04”

  1. Please help me to configure calamari. Calamari failing with the below error, detailed information is as follows.

    calamari URL displays below error:

    New Calamari Installation
    This appears to be the first time you have started Calamari and there are no clusters currently configured.
    3 Ceph servers are connected to Calamari, but no Ceph cluster has been created yet. Please use ceph-deploy to create a cluster; please see the Inktank Ceph Enterprise documentation for more details.

    When executed ceph-deploy connect again, “calamari.conf”file is changes “master: None”.

    My cluster have 4 nodes:
    AMCNode: admin + mon + calamari
    siteAosd
    siteBosd
    siteCosd

    ceph version 10.2.2 on ubuntu 14.04
    salt version 2014.7.5+ds-1ubuntu1
    diamond 3.4.67_all.deb

    1. Install deb packages for calamari on admin/calamari server node

    wget http://download.ceph.com/debian-jewel/pool/main/c/ceph-deploy/ceph-deploy_1.5.34_all.deb
    sudo dpkg -i ceph-deploy_1.5.34_all.deb

    2. Downloaded calamari deb packages on admin/calamari server node

    sudo wget http://download.ceph.com/calamari/1.3.1/ubuntu/trusty/pool/main/c/calamari/calamari-server_1.3.1.1-1trusty_amd64.deb
    sudo wget http://download.ceph.com/calamari/1.3.1/ubuntu/trusty/pool/main/c/calamari-clients/calamari-clients_1.3.1.1-1trusty_all.deb
    sudo wget http://download.ceph.com/calamari/1.3.1/ubuntu/trusty/pool/main/d/diamond/diamond_3.4.67_all.deb

    3. Install salt 2014.7 version on admin/calamari server node

    sudo add-apt-repository ppa:saltstack/salt2014-7

    4. Then ran the commands below from calamari server or admin node

    sudo apt-get update
    sudo apt-get install salt-master
    sudo apt-get install salt-minion
    sudo apt-get install -y apache2 libapache2-mod-wsgi libcairo2 supervisor python-cairo libpq5 postgresql
    sudo apt-get -f install
    sudo dpkg -i calamari-server*.deb calamari-clients*.deb
    sudo calamari-ctl initialize

    5. Edited ceph.conf file and added

    [ceph-deploy-calamari]
    master = amcnode

    pushed config file to all other nodes
    ceph-deploy –overwrite-conf config push amcnode siteAosd siteBosd siteCosd

    6. Installed salt package on other nodes. Copied diamond package to all other nodes and installed

    sudo add-apt-repository ppa:saltstack/salt2014-7
    sudo dpkg -i diamond_3.4.67_all.deb
    sudo apt-get install python-support

    7. Executed the below command from calamari server node /admin node

    ceph-deploy calamari connect siteAosd siteBosd siteCosd

    8. URL shows all the 3 nodes and requested to “Add”. Adding the nodes failed.

    9. calamari.conf file in calamari client nodes has “master: None”, modified it to “master: amcnode”, restarted salt minion.

    sudo vi /etc/salt/minion.d/calamari.conf
    master: amcnode

    sudo service salt-minion restart

    10. URL still shows the below error:

    New Calamari Installation
    This appears to be the first time you have started Calamari and there are no clusters currently configured.
    3 Ceph servers are connected to Calamari, but no Ceph cluster has been created yet. Please use ceph-deploy to create a cluster; please see the Inktank Ceph Enterprise documentation for more details.

    11. Executed ceph-deploy connect again, now calamari.conf file is changed to “master: None” again.

    Thanks for your help in advance.

  2. hey any ideas about this erros in /var/log/calamari.log , after following above steps ?

    2016-07-06 06:59:13,098 – ERROR – django.request Internal Server Error: /dashboard/
    Traceback (most recent call last):
    File “/opt/calamari/venv/lib/python2.7/site-packages/django/core/handlers/base.py”, line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File “/opt/calamari/venv/lib/python2.7/site-packages/django/contrib/auth/decorators.py”, line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
    File “/opt/calamari/venv/lib/python2.7/site-packages/calamari_web-0.1-py2.7.egg/calamari_web/views.py”, line 38, in dashboard
    clusters = client.list_clusters()
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/core.py”, line 260, in
    return lambda *args, **kargs: self(method, *args, **kargs)
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/core.py”, line 245, in __call__
    return self._process_response(request_event, bufchan, timeout)
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/core.py”, line 217, in _process_response
    reply_event = bufchan.recv(timeout)
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/channel.py”, line 267, in recv
    event = self._input_queue.get(timeout=timeout)
    File “/opt/calamari/venv/lib/python2.7/site-packages/gevent/queue.py”, line 200, in get
    result = waiter.get()
    File “/opt/calamari/venv/lib/python2.7/site-packages/gevent/hub.py”, line 575, in get
    return self.hub.switch()
    File “/opt/calamari/venv/lib/python2.7/site-packages/gevent/hub.py”, line 338, in switch
    return greenlet.switch(self)
    LostRemote: Lost remote after 10s heartbeat

  3. Hey, i keep getting these errors in /var/log/calamari/calamari.log . Any ideas ? Thanks!

    2016-07-07 04:30:26,379 – ERROR – django.request Internal Server Error: /dashboard/
    Traceback (most recent call last):
    File “/opt/calamari/venv/lib/python2.7/site-packages/django/core/handlers/base.py”, line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File “/opt/calamari/venv/lib/python2.7/site-packages/django/contrib/auth/decorators.py”, line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
    File “/opt/calamari/venv/lib/python2.7/site-packages/calamari_web-0.1-py2.7.egg/calamari_web/views.py”, line 38, in dashboard
    clusters = client.list_clusters()
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/core.py”, line 260, in
    return lambda *args, **kargs: self(method, *args, **kargs)
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/core.py”, line 245, in __call__
    return self._process_response(request_event, bufchan, timeout)
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/core.py”, line 217, in _process_response
    reply_event = bufchan.recv(timeout)
    File “/opt/calamari/venv/lib/python2.7/site-packages/zerorpc/channel.py”, line 267, in recv
    event = self._input_queue.get(timeout=timeout)
    File “/opt/calamari/venv/lib/python2.7/site-packages/gevent/queue.py”, line 200, in get
    result = waiter.get()
    File “/opt/calamari/venv/lib/python2.7/site-packages/gevent/hub.py”, line 575, in get
    return self.hub.switch()
    File “/opt/calamari/venv/lib/python2.7/site-packages/gevent/hub.py”, line 338, in switch
    return greenlet.switch(self)
    LostRemote: Lost remote after 10s heartbeat

  4. root@calamari-xxx:~/calamarifiles# apt-get -f install
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
    root@calamari-lsh:~/calamarifiles# sudo dpkg -i ceph-deploy_1.5.28trusty_all.deb
    Selecting previously unselected package ceph-deploy.
    (Reading database … 59809 files and directories currently installed.)
    Preparing to unpack ceph-deploy_1.5.28trusty_all.deb …
    Unpacking ceph-deploy (1.5.28trusty) …
    dpkg: dependency problems prevent configuration of ceph-deploy:
    ceph-deploy depends on python-setuptools; however:
    Package python-setuptools is not installed.

    dpkg: error processing package ceph-deploy (–install):
    dependency problems – leaving unconfigured
    Errors were encountered while processing:
    ceph-deploy

Leave a Reply