目录
一、基于 ceph-deploy 部署 Ceph 集群
1、Ceph 生产环境推荐:
1、存储集群全采用万兆网络
2、集群网络(cluster-network,用于集群内部通讯)与公共网络(public-network,用于外部访问Ceph集群)分离
3、mon、mds 与 osd 分离部署在不同主机上(测试环境中可以让一台主机节点运行多个组件)
4、OSD 使用 SATA 亦可
5、根据容量规划集群
6、至强E5 2620 V3或以上 CPU,64GB或更高内存
7、集群主机分散部署,避免机柜的电源或者网络故障
字号4
2、Ceph 环境规划
主机名 | Public网络 | Cluster网络 | 角色 |
---|---|---|---|
admin | 192.168.102.10 | admin(管理节点负责集群整体部署)、client | |
node01 | 192.168.102.20 | 192.168.100.20 | mon、mgr、osd(/dev/sdb、/dev/sdc、/dev/sdd) |
node02 | 192.168.102.30 | 192.168.100.30 | mon、mgr、osd(/dev/sdb、/dev/sdc、/dev/sdd) |
node03 | 192.168.102.40 | 192.168.100.40 | mon、osd(/dev/sdb、/dev/sdc、/dev/sdd) |
client | 192.168.102.50 | client |
3、环境准备
可选步骤:创建 Ceph 的管理用户
useradd cephadm
passwd cephadm
visudo
cephadm ALL=(root) NOPASSWD:ALL
1、关闭 selinux 与防火墙
systemctl disable --now firewalld
setenforce 0
sed -i 's/enforcing/disabled/' /etc/selinux/config
2、根据规划设置主机名
给每台服务器设置主机名
hostnamectl set-hostname admin
hostnamectl set-hostname node01
hostnamectl set-hostname node02
hostnamectl set-hostname node03
hostnamectl set-hostname client
3、配置 hosts 解析
4、安装常用软件和依赖包
yum -y install epel-release
yum -y install yum-plugin-priorities yum-utils ntpdate python-setuptools python-pip gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel zip unzip ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssh openssl-devel nss_ldap openldap openldap-devel openldap-clients openldap-servers libxslt-devel libevent-devel ntp libtool-ltdl bison libtool vim-enhanced python wget lsof iptraf strace lrzsz kernel-devel kernel-headers pam-devel tcl tk cmake ncurses-devel bison setuptool popt-devel net-snmp screen perl-devel pcre-devel net-snmp screen tcpdump rsync sysstat man iptables sudo libconfig git bind-utils tmux elinks numactl iftop bwm-ng net-tools expect snappy leveldb gdisk python-argparse gperftools-libs conntrack ipset jq libseccomp socat chrony sshpass
5、在 admin 管理节点配置 ssh 免密登录所有节点
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
sshpass -p 'Dz030617' ssh-copy-id -o StrictHostKeyChecking=no root@admin
sshpass -p 'Dz030617' ssh-copy-id -o StrictHostKeyChecking=no root@node01
sshpass -p 'Dz030617' ssh-copy-id -o StrictHostKeyChecking=no root@node02
sshpass -p 'Dz030617' ssh-copy-id -o StrictHostKeyChecking=no root@node03
vim /etc/ssh/ssh_config