当前位置: > CentOS > CentOS教程 >

Calamari 在Centos7.1上部署成功案例分享

时间:2016-12-08 13:04来源:linux.it.net.cn 作者:IT

第一部分:部署环境说明

主机名                  IP            角色                         服务器版本
calamari        192.168.240.200 Calamari Server                 CentOS 7.1.1503
bgw-os-node151  192.168.216.151 Ceph mon/osd/mds, salt-minion   Redhat 6.5
bgw-os-node152  192.168.216.152 Ceph mon/osd/mds, salt-minion   Redhat 6.5
bgw-os-node153  192.168.216.153 Ceph mon/osd/mds, salt-minion   Redhat 6.5

其中,Calamari Server的版本是从ceph社区百度网盘共享的镜像安装的。

网盘地址是: http://pan.baidu.com/s/1o6BT8sa#path=%252FCalamari%252FCentos%252FCentOS7.1%252BCalamari1.3

注意:本文在部署calamari之前已经将ceph环境部署好

 [root@bgw-os-node151 ~]# ceph -s
   cluster 00000000-0000-0000-0000-000000000002
   health HEALTH_OK
   monmap e1: 3 mons at {bgw-os-node151=192.168.216.151:6789/0,bgw-os-    node152=192.168.216.152:6789/0,bgw-os-node153=192.168.216.153:6789/0}, election epoch 380540, quorum 0,1,2 bgw-os-node151,bgw-os-node152,bgw-os-node153
 mdsmap e62: 1/1/1 up {0=bgw-os-node151=up:active}, 2 up:standby
 osdmap e213915: 12 osds: 12 up, 12 in
  pgmap v543085: 384 pgs, 6 pools, 123 MB data, 488 kobjects
        56185 MB used, 3295 GB / 3350 GB avail
             384 active+clean

第二部分:Calamari Server端安装配置

  • 系统安装(省略)

  • Calamari Server安装

    • 关闭selinux

      • vim /etc/selinux/config

         SELINUX=disabled
        
      • setenforce 0

    • 关闭iptables

      • systemctl stop firewalld
      • chkconfig firewalld off
    • 设置hosts

      • cat /etc/hosts (需要在上述四个服务器上都执行)

         192.168.240.200  calamari
         192.168.216.151  bgw-os-node151
         192.168.216.152  bgw-os-node152
         192.168.216.153  bgw-os-node153
        
    • 设置yum源

      • 上传镜像文件(省略)并创建下面的挂载点,挂载镜像文件
      • mkdir -p /iso/calamari
      • mkdir -p /iso/centos7
      • mount -o loop /opt/CentOS-7-x86_64-DVD-1503.iso /iso/centos7/
      • mount -o loop /opt/Calamari-1.3-CentOS-7.1-x86-64-20150430.iso /iso/calamari/
      • cat /etc/yum.repos.d/CentOS-Base.repo

         [base]
         name=CentOS-7
         baseurl=file:///iso/centos7
         gpgcheck=0
        
      • cat /etc/yum.repos.d/calamari.repo

         [calamari]
         name=calamari
         baseurl=file:///iso/calamari/
         gpgcheck=0
        
    • 安装基本包

      • yum update
      • yum -y install vim bash-completion net-tools pciutils sysstat wget
    • 安装Calamari和diamond包

      • yum -y install calamari-server diamond
    • 初始化

      • /usr/bin/calamari-ctl initialize
        • 输入用户名:root (保持默认,也可以更改)
        • 输入密码:123456(随意设置,用于登录,最好一次设置好,修改比较麻烦)
    • 配置calamari-client

      Calamari-client是用来配置calamari登录、管理所需要的相关页面

      • cd ~
      • cp /iso/calamari/packages/calamari-clients-20150430.tar.gz .
      • tar xf calamari-clients-20150430.tar.gz
      • cd calamari-clients/
      • cp -r login/dist /opt/calamari/webapp/content/login
      • cp -r manage/dist /opt/calamari/webapp/content/manage
      • cp -r dashboard/dist /opt/calamari/webapp/content/dashboard
      • cp -r admin/dist /opt/calamari/webapp/content/admin

      至此,按照社区里奇总分享的镜像和文档进行安装部署都很顺利就能完成,感谢奇总!

    • 登录

      登录时使用上面初始化的用户名和密码即可。登录后出现下面的界面

      login

第三部分:Ceph端安装配置

这一步是一个难点,通过各种搜索,终于搞定了,过程如下

  • 查阅资料 http://tracker.ceph.com/issues/7851

  • 安装epel源

    • rpm -Uvh dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  • 上传diamond-3.4.67-0.noarch.rpm (从上面源里可以找到)

  • 安装diamond和salt-minion和 ipvsadm

    • yum install diamond-3.4.67-0.noarch.rpm ipvsadm salt-minion
  • 配置cephdeploy.conf

    • cat ~/.cephdeploy.conf (新建)

      [ceph-deploy-global]
      [ceph-deploy-install]
      [calamari-minion]
         name=ceph repo noarch packages
         baseurl=http://ceph.com/rpm-emperor/fc19/x86_64
         enabled=1
         gpgcheck=1
         type=repo-md
         gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc
      
  • 修改salt-minion配置

    • cat /etc/salt/minion.d/calamari.conf

      master: 192.168.240.200
      

    如果完成上面的步骤后,直接启动salt-minion, 然后在calamari server上执行salt-key -L 和 salt-key -A, 不会报错,但是登录页面后看到的是下面的情况,这时候就需要采用下面的方式了(是参考上面资料的):

    error
  • 将ceph节点加入calamari (三个ceph节点都要执行)

    • 在执行下面的操作前,最好是先stop掉salt-minion进程,稍等几分钟后就可以了
    • ceph-deploy calamari --master 192.168.240.200 connect bgw-os-node151

      [ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf
      [ceph_deploy.cli][INFO  ] Invoked (1.5.9): /usr/bin/ceph-deploy calamari --master 192.168.240.200                       connect bgw-os-node151
      [bgw-os-node151][DEBUG ] connected to host: bgw-os-node151 
      [bgw-os-node151][DEBUG ] detect platform information from remote host
      [bgw-os-node151][DEBUG ] detect machine type
      [ceph_deploy.calamari][INFO  ] Distro info: Red Hat Enterprise Linux Server 6.5 Santiago
      [bgw-os-node151][INFO  ] installing calamari-minion package on bgw-os-node151
      [bgw-os-node151][INFO  ] adding custom repository file
      [bgw-os-node151][INFO  ] Running command: yum clean all
      [bgw-os-node151][DEBUG ] Loaded plugins: product-id, security, subscription-manager
      [bgw-os-node151][DEBUG ] Cleaning repos: base calamari-minion epel extras os-base os-ceph.repo os-epel
      [bgw-os-node151][DEBUG ]               : os-i.repo puppet puppet.repo update
      [bgw-os-node151][DEBUG ] Cleaning up Everything
      [bgw-os-node151][WARNIN] This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
      [bgw-os-node151][INFO  ] Running command: rpm --import https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc
      [bgw-os-node151][DEBUG ] set the contents of repo file to /etc/yum.repos.d/
      [bgw-os-node151][DEBUG ] creating config dir: /etc/salt/minion.d
      [bgw-os-node151][DEBUG ] creating the calamari salt config: /etc/salt/minion.d/calamari.conf
      [bgw-os-node151][INFO  ] Running command: yum -y install salt-minion
      [bgw-os-node151][DEBUG ] Loaded plugins: product-id, security, subscription-manager
      [bgw-os-node151][WARNIN] No data was received after 300 seconds, disconnecting...
      [bgw-os-node151][INFO  ] Running command: chkconfig salt-minion on
      [bgw-os-node151][INFO  ] Running command: service salt-minion start
      [bgw-os-node151][DEBUG ] Starting salt-minion daemon: [  OK  ]
      

上面启动成功后,就可以在web界面上看到ceph节点的信息啦(如下图)! 由于水平有限,欢迎拍砖~

result




(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容