Install and deploy CEpH calamari

Source: Internet
Author: User
Tags rpmbuild saltstack

According to http://ovirt-china.org/mediawiki/index.php/%E5% AE %89%E8%A3%85%E9%83%A8%E7%BD%B2Ceph_Calamari

The original article is as follows:

Calamari is a tool for managing and monitoring CEpH clusters and provides rest APIs.

The recommended deployment platform is ubuntu. This article uses centos 6.5.

Installation and deployment
  1. Obtain calamari code
    # git clone https://github.com/ceph/calamari.git# git clone https://github.com/ceph/calamari-clients.git# git clone https://github.com/ceph/Diamond
  2. Generate the calamari-Server Installation Package
    # yum install gcc gcc-c++ postgresql-libs python-virtualenv# cd calamari && ./build-rpm.sh
  3. Install calamari-Server
    # yum localinstall ../rpmbuild/RPMS/x86_64/calamari-server-<version>.rpm

    You can use Yum to automatically resolve dependencies. If you manually install dependencies, you can:

    # yum install postgresql-server salt-master salt-minion supervisor# rpm -ivh ../rpmbuild/RPMS/x86_64/calamari-server-<version>.rpm
  4. Generate the calamari-clients installation package
    # yum install npm ruby rubygems# npm install -g grunt grunt-cli bower grunt-contrib-compass# gem update --sytem && gem install compass# cd calamari-clients# make build-real# make dist

    Make Dist will generate the calamari-client compressed package in the parent directory;
    Manually decompress and create mkdir-P opt/calamari/webapp;
    Under the decompressed directory, manually update the directory structure and content:

    # 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

    Recreate the compressed package and manually execute rpmbuild Based on the RPM target in the makefile:

    # rpmbuild -bb --define "_topdir /xxx/calamari-clients/../rpmbuild" --define "version 1.2" --define "revision rc2_49_g3e3686d" --define "tarname /xxx/rpmbuild/SOURCES/calamari-clients_product_1.2.tar.gz" SPECS/clients.spec
  5. Install calamari-clients
    # yum localinstall RPMS/x86_64/calamari-clients-1.2-rc2_49_g3e3686d.el6.x86_64.rpm
  6. Initialize calamari
    # calamari-ctl initialize

    This step has not ended at the end of service restart (mainly Cthulhu). Based on the information found, it is said that the problem of supervisord will not be solved when the upgrade is over 3.0.

  7. Generate the diamond installation package
    # cd ../Diamond# git checkout origin/calamari# make rpm
  8. Copy diamond-<version>. noarch. RPM to all CEpH servers.
    Use Yum localinstall or yum install Python-configobj and then use rpm-IVH for installation.
  9. Install salt-minion on all CEpH servers and create/etc/salt/Minion. d/calamari. conf with the following content:
    master: {fqdn}

    {FQDN} corresponds to the domain name of the calamari server.
    Start the salt-Minion service:

    # service salt-minion restart
  10. Configure Firewall and saltstack authentication on the calamari Server
    Firewall (allows CEpH servers to access salt-master and carbon ):
    ### 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### 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 certification:
    After the salt-Minion service on the CEpH server is started, authentication is automatically requested from the salt-master.
    On the calamari server, run the following command to view the list of Salt-Minion keys:

    # salt-key -L

    The CEpH server that just started the salt-Minion service will appear after the unaccepted keys list. To enable calamari to manage the CEpH server through saltstack, You need to authenticate these keys:

    # salt-key -A
  11. After the deployment is complete, you can access calamari
Problems encountered later
  1. SELinux causes the 500 error:
    Due to SELinux restrictions, a 500 error occurs during page access because httpd_t has no write permission for anon_inodefs_t. You can generate the SELinux Module Based on audit logs:
    # ausearch -m avc -c httpd -se httpd_t -o anon_inodefs_t | audit2allow -R -M httpd_anon_inodefs# semodule -i httpd_anon_inodefs.pp

    The rules of the generated SELinux module are as follows:

    require {        type httpd_t;}#============= httpd_t ==============fs_rw_anon_inodefs_files(httpd_t)
  2. Open manage --> OSD page with no content
    An exception occurred when checking calamari. Log because httpd has no permission to access/etc/salt/master. The modification permission is temporarily resolved.
  3. Open manage --> logs page with no content
    View the log and find the access token:
    HTTP 503 SERVICE UNAVAILABLEVary: AcceptContent-Type: text/html; charset=utf-8Allow: GET, HEAD, OPTIONS{    "detail": "No mon servers are responding"}

    After research, we still have SELinux restrictions. We can solve the problem by using ausearch and audit2allow to generate corresponding modules.
    The rules of the generated SELinux module are as follows:

    require {        type var_run_t;        type httpd_t;        class sock_file { write getattr };}#============= httpd_t ==============allow httpd_t var_run_t:sock_file { write getattr };files_read_var_files(httpd_t)init_stream_connect_script(httpd_t)
  4. An HTTP 500 error occurs when you open the Graphite/dashboard/page.
    The log prompts that the graphite template cannot be found. Find the corresponding description in the calamari bug list -- issue 8669
    Solution:
    Find the egg file of calamari_web under/opt/calamari/venv/lib/python2.6/Site-packages, decompress the file, manually modify calamari_web/settings. py, and re-package the file.
    After restarting Apache, you can access Graphite/dashboard /.

When calamari was installed in centos6.5, some RPM problems occurred. Run

calamari-ctl initialize
Initialize and stop at restart. This article says that this step has not ended when the service is restarted (mainly Cthulhu). According to the information found, it is a problem with supervisord, if you upgrade to 3.0 or above, no problem will occur.

I tried to upgrade supervisord, but I needed python2.7 and so on. I had to leave it alone and try again later.

The homepage can be opened, but server error (500) appears after login ):


Install and deploy CEpH calamari

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.