系统版本选择:

root@calamari-ubuntu:~# lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 14.04.3 LTS

Release: 14.04

Codename: trusty

root@calamari-ubuntu:~# 


注:千万不要用14.04.4 LTS


#ubuntu-server 14.04-tls 手动安装 ceph calamari 

#构建 Calamari Server 安装包

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

#一. 编译 Calamari Server 的安装包

#安装依赖包:

apt-get update

apt-get install -y git-core curl build-essential openssl libssl-dev ruby-compass rubygems-integration devscripts debhelper


#编译和安装 Node:

cd /root/ 

git clone https://github.com/nodejs/node.git

cd node

./configure

make -j4

make install



#编译和安装 NPM:

mkdir /root/npm

cd /root/npm

wget --no-check-certificate https://npmjs.org/install.sh

sh install.sh


#安装 bower

npm install -g bower

#安装 coffee-script

npm install -g coffee-script

#安装 grunt-cli

npm install -g grunt-cli

#由于 Calamari 不兼容 bootstrap,需要升级 ruby compass ,此步耗时较长

gem install compass

#由于 Calamari 不兼容 bootstrap,需要升级 ruby sass

gem install sass


#准备编译 Calamari Server 的依赖包:

apt-get -y install libcairo2-dev python-pip libpq-dev python-dev python-virtualenv ruby-dev

apt-get install python-msgpack -y


cd /root

git clone https://github.com/ceph/calamari.git

cd calamari


cd debian

mv source source.old

cd ..


################以下部分检查一下如果已经更改就不用更改了#########################

#vim ./repobuild/conf/trusty/upstream.packages

#vim ./repobuild/conf/wheezy/upstream.packages

#vim ./repobuild/conf/precise/upstream.packages

#均把 msgpack-python 修改为 python-msgpack

##################################################################################

#有时可能会卡住,因为会从国外网站下载一些东西,重复执行一下就可以了

dpkg-buildpackage

#编译完成后,在~/目录下会看到 calamari-server 的 deb 包(编译过程会下载不少的包,耐心等待)


####以下用

vim calamari/debian/debian/calamari-server.substvars

修改 python-msgpack-python 为 python-msgpack







#二. 编译 Calamari Client 的安装包

#开始构建 calamari clients 的安装包:

cd /root

git clone https://github.com/ceph/calamari-clients.git

cd calamari-clients

tar zcvf calamari-clients-build-output.tar.gz *

dpkg-buildpackage

#编译完成后在~/目录会看到 calamari-clients 的安装包。




#三. 编译 Diamond 的安装包

#构建 Diamond 安装包

cd /root

git clone https://github.com/ceph/Diamond.git --branch=calamari

cd Diamond

apt-get install python-mock python-configobj cdbs python-support -y

dpkg-buildpackage


四. 安装 Calamari Server 和 Clients

#安装 salt-master,因为calamari对salt的版本是有要求的,版本太高图形显示会有问题,所以需要安装以下版本的salt

sudo apt-get install software-properties-common -y

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

sudo apt-get update  -y

sudo apt-get -y install salt-master

sudo apt-get -y install salt-minion


echo "master: 192.168.10.5" >/etc/salt/minion.d/calamari.conf

/etc/init.d/salt-minion restart


#安装 Apache 和 PostgreSQL:

apt-get install -y apache2 libapache2-mod-wsgi libcairo2 supervisor python-cairo libpq5 postgresql


#安装 Calamari Server:

cd /root

dpkg -i calamari-server_1.0.0-1_amd64.deb

#出现以下提示:

root@calamari-ubuntu:~# dpkg -i calamari-server_1.0.0-1_amd64.deb

Selecting previously unselected package calamari-server.

(Reading database ... 70510 files and directories currently installed.)

Preparing to unpack calamari-server_1.0.0-1_amd64.deb ...

Unpacking calamari-server (1.0.0-1) ...

dpkg: dependency problems prevent configuration of calamari-server:

 calamari-server depends on salt-minion; however:

  Package salt-minion is not installed.

 calamari-server depends on python-twisted; however:

  Package python-twisted is not installed.

 calamari-server depends on python-txamqp; however:

  Package python-txamqp is not installed.

 calamari-server depends on python-sqlalchemy; however:

  Package python-sqlalchemy is not installed.

 calamari-server depends on python-gevent; however:

  Package python-gevent is not installed.

 calamari-server depends on python-msgpack-python; however:

  Package python-msgpack-python is not installed.

 calamari-server depends on python-greenlet; however:

  Package python-greenlet is not installed.


dpkg: error processing package calamari-server (--install):

 dependency problems - leaving unconfigured

Errors were encountered while processing:

 calamari-server

root@calamari-ubuntu:~# 


#安装对应的依赖包:

apt-get -f install -y

apt-get install python-msgpack -y


重新编译:

#有时可能会卡住,因为会从国外网站下载一些东西,重复执行一下就可以了

cd calamari

dpkg-buildpackage

#编译完成后,在~/目录下会看到 calamari-server 的 deb 包(编译过程会下载不少的包,耐心等待)



#再次执行:

dpkg -i calamari-server_1.0.0-1_amd64.deb

#安装 Calamari Clients:

dpkg -i calamari-clients_1.0.0-616-gf17527d_all.deb


初始化 Calamari Server:

/usr/bin/calamari-ctl initialize


此时,虽然已经初始化了,但是还未完成得(这个明显是官方有 bug):

cd   ~/calamari-clients/debian/calamari-clients/login

make

cp -r dist /opt/calamari/webapp/content/login

cd   ~/calamari-clients/debian/calamari-clients/manage

make

cp -r dist /opt/calamari/webapp/content/manage

cd   ~/calamari-clients/debian/calamari-clients/dashboard

make

cp -r dist /opt/calamari/webapp/content/dashboard

cd   ~/calamari-clients/debian/calamari-clients/admin

make

cp -r dist /opt/calamari/webapp/content/admin

此时可以打开 http://ip/,浏览页面:




五. 在 Ceph 的 mon 和 osd 安装 Diamond 包

安装 IPVSADM:

如果需要发送 IOPS 和其他监控信息去 Calamari Server,需要安装 ipvsadm:

apt-get -y install ipvsadm

ln -s /sbin/ipvsadm /usr/bin/ipvsadm

安装 diamond:

apt-get install python-support

dpkg -i diamond_3.1.0_all.deb





二. 安装 salt-master,因为calamari对salt的版本是有要求的,版本太高图形显示会有问题,所以需要安装以下版本的salt

sudo apt-get install software-properties-common

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

sudo apt-get update  -y

sudo apt-get -y install salt-master

sudo apt-get -y install salt-minion