002.Ceph安装部署
2019-01-16 05:49:07来源:博客园 阅读 ()
一 前期准备
1.1 配置规格
1.2 前置准备
- 所有节点NTP安装及配置,具体操作略;
- 所有节点更新环境:
1 yum -y update
- deploy节点安装pip环境:
1 [root@deploy ~]# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2 [root@deploy ~]# python get-pip.py
- 配置国内yum源:
1 [root@node1 ~]# rm /etc/yum.repos.d/* -rf 2 [root@node1 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 3 [root@node1 ~]# yum -y install epel-release 4 [root@node1 ~]# mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup 5 [root@node1 ~]# mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup 6 [root@node1 ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
- 部署节点配置主机名:
1 [root@deploy ~]# vi /etc/hosts 2 172.24.8.71 deploy 3 172.24.8.72 node1 4 172.24.8.73 node2 5 172.24.8.74 node3
- 配置deploy节点到所有OSD node节点的免秘钥登录:
1 [root@deploy ~]# useradd manager 2 [root@deploy ~]# echo manager | passwd --stdin manager #创建非root的管理用户 3 [root@deploy ~]# for i in {1..3}; do echo "====node${i}====";ssh root@node${i} 'useradd -d /home/cephuser -m cephuser; echo "cephuser" | passwd --stdin cephuser'; done #所有OSD node节点创建cephuser用户 4 [root@deploy ~]# for i in {1..3}; do echo "====node${i}====";ssh root@node${i} 'echo "cephuser ALL = (root) NOPASSWD:ALL" > /etc/sudoers.d/cephuser'; done 5 [root@deploy ~]# for i in {1..3}; do echo "====node${i}====";ssh root@node${i} 'chmod 0440 /etc/sudoers.d/cephuser'; done 6 [root@deploy ~]# su - manager 7 [manager@deploy ~]$ ssh-keygen -f ~/.ssh/id_rsa -N '' 8 [manager@deploy ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub cephuser@172.24.8.72 9 [manager@deploy ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub cephuser@172.24.8.73 10 [manager@deploy ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub cephuser@172.24.8.74
1 [manager@deploy ~]$ vi ~/.ssh/config #修改ceph-deploy管理节点上~/.ssh/config文件 2 Host node1 3 Hostname node1 4 User cephuser 5 Host node2 6 Hostname node2 7 User cephuser 8 Host node3 9 Hostname node3 10 User cephuser 11 [manager@deploy ~]$ chmod 600 .ssh/config 12 [manager@deploy ~]$ ssh node1 #测试 13 [cephuser@node1 ~]$ exit
1.3 部署需求
二 正式部署
2.1 部署deploy节点
1 [root@deploy ~]# cat << EOM > /etc/yum.repos.d/ceph.repo 2 [ceph-noarch] 3 name=Ceph noarch packages 4 baseurl=https://download.ceph.com/rpm-mimic/el7/noarch 5 enabled=1 6 gpgcheck=1 7 type=rpm-md 8 gpgkey=https://download.ceph.com/keys/release.asc 9 EOM
1 [root@deploy ~]# vi /etc/yum.repos.d/ceph.repo 2 [ceph-noarch] 3 name=Ceph noarch packages 4 baseurl=https://mirrors.aliyun.com/ceph/rpm-mimic/el7/noarch 5 enabled=1 6 gpgcheck=1 7 type=rpm-md 8 gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc
1 [root@deploy ~]# yum install -y ceph-deploy
2.2 Ceph节点安装
1 [root@deploy ~]# su - manager 2 [manager@deploy ~]$ mkdir my-cluster 3 [manager@deploy ~]$ cd my-cluster/ 4 [manager@deploy my-cluster]$ ceph-deploy new node1 5 [manager@deploy my-cluster]$ ll
2.3 安装Ceph
1 [manager@deploy my-cluster]$ ceph-deploy install node1 node2 node3
1 ceph-deploy install node1 node2 node3 --repo-url=https://mirrors.aliyun.com/ceph/rpm-mimic/el7/ --gpg-url=https://mirrors.aliyun.com/ceph/keys/release.asc
2.4 初始化monitor
1 [manager@deploy my-cluster]$ ceph-deploy mon create-initial #初始monitor、并收集所有密钥 2 [manager@deploy my-cluster]$ ll
2.5 部署MGR
1 [manager@deploy my-cluster]$ ceph-deploy mgr create node1 node2 node3
2.6 复制key
1 [manager@deploy my-cluster]$ ceph-deploy admin node1 node2 node3
2.7 添加OSD
1 [manager@deploy my-cluster]$ ceph-deploy disk list node1 node2 node3 #列出磁盘 2 [manager@deploy my-cluster]$ ceph-deploy osd create --data /dev/sdb node1 3 [manager@deploy my-cluster]$ ceph-deploy osd create --data /dev/sdb node2 4 [manager@deploy my-cluster]$ ceph-deploy osd create --data /dev/sdb node3
2.8 检测健康状态
1 [manager@deploy my-cluster]$ ssh node1 sudo ceph health 2 [manager@deploy my-cluster]$ ssh node1 sudo ceph -s
2.9 开启dashboard
1 [root@node1 ~]# ceph mgr module enable dashboard #开启dashboard模块 2 [root@node1 ~]# ceph dashboard create-self-signed-cert
1 [root@node1 ~]# ceph dashboard set-login-credentials admin admin #创建管理员 2 [root@node1 ~]# ceph mgr services #确认验证
原文链接:https://www.cnblogs.com/itzgr/p/10275863.html
如有疑问请与原作者联系
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:centos安装Redis
- 安装Zabbix5.0 2020-06-10
- windows10安装配置WSL(Ubuntu) 2020-06-07
- 在已经编译安装好php7场景下 安装php openssl扩展 2020-06-06
- 在已经编译安装好php7场景下安装curl扩展 2020-06-06
- 在已经编译安装好php7场景下,install gd库 with free-type 2020-06-06
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash