|
一:CEPH简介
http://michaelkang.blog.运维网.com/1553154/1669844
二:ceph集群硬件的选择
http://michaelkang.blog.运维网.com/1553154/1669841
三:集群安装配置环境介绍
1:系统:
more /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
2:内核:
uname -a
Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
3:ceph版本:
ceph -v
ceph version 0.94.3
4:集群服务部署分配:
主机名 运 行 服 务
ceph-deploy ceph-deploy
node241 mon osd
node242 mds osd
node243 osd
5:IP对应主机名
192.168.2.40 ceph-deploy
192.168.2.41 node241
192.168.2.42 node242
192.168.2.43 node243
四:集群主机系统配置准备
所有 Ceph 集群节点采用 CentOS 7.1 版本(CentOS-7-x86_64-Minimal-1503-01.iso),所有文件系统采用 Ceph 官方推荐的 xfs,
所有节点的操作系统都装在 RAID1 上,其他的硬盘单独用,不做任何 RAID.
安装完 CentOS 后我们需要在每个节点上(包括 ceph-deploy)做以下配置:
1:规范系统主机名;
centos使用以下命令:
hostnamectl set-hostname 主机名
2:添加hosts文件实现集群主机名与主机名之间相互能够解析(host 文件添加主机名不要使用fqdn方式)
[root@ceph-deploy ceph]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.2.40 ceph-deploy
192.168.2.41 node241
192.168.2.42 node242
192.168.2.43 node243
3:每台 ssh-copy-id 完成这些服务器之间免ssh密码登录;
ssh-copy-id node###
4:关闭防火墙或者开放 6789/6800~6900端口、关闭SELINUX;
#关闭 SELINUX
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
#修改SELINUX模式
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
#打开 Ceph 需要的端口
firewall-cmd --zone=public --add-port=6789/tcp --permanent
firewall-cmd --zone=public --add-port=6800-7100/tcp --permanent
firewall-cmd --reload
systemctl stop firewalld.server
5:配置ntp服务,开启时间服务,保证集群服务器时间统一;
安装 ntp 同步时间
yum -y install ntp ntpdate ntp-doc
ntpdate 0.us.pool.ntp.org
hwclock --systohc
systemctl enable ntpd.service
systemctl start ntpd.service
或者添加crontab ,执行自动时间同步;
[root@admin yum.repos.d]# more /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
20 */1 * * * root ntpdate s1a.time.edu.cn && --systohc
6:系统优化类
#set max user processes
sed -i 's/4096/102400/' /etc/security/limits.d/20-nproc.conf
#set ulimit
cat /etc/rc.local | grep "ulimit -SHn 102400" || echo "ulimit -SHn 102400" >> /etc/rc.local
#修改最大打开文件句柄数
cat /etc/security/limits.conf | grep "^* - sigpending 256612" ||
cat >>/etc/security/limits.conf |
|
|