大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
参照官方文档中的快速安装,结合国内环境,将相关安装源修改为国内镜像源提高安装速度。
http://docs.ceph.org.cn/start/
创新互联专注于企业网络营销推广、网站重做改版、广汉网站定制设计、自适应品牌网站建设、H5开发、电子商务商城网站建设、集团公司官网建设、成都外贸网站建设公司、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为广汉等各大城市提供网站开发制作服务。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
yum update -y```
### 关闭防火墙、SELinux
systemctl stop firewalld && systemctl disable firewalld
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
### 添加hosts主机名解析(集群采用四台虚拟机)
四台机器均添加
echo "192.168.5.191 admin-node
192.168.5.192 node1
192.168.5.193 node2
192.168.5.194 node3" >> /etc/hosts```
yum install ntp ntpdate ntp-doc -y ```
### 免密钥登录
admin-node #到node1 node2 node3之间
ssh-keygen #生成密钥文件```
分别添加至三个node
hostname=(admin-node node1 node2 node3)
for i in ${hostname[*]};do echo yes|ssh-copy-id -i id_rsa.pub root@$i ;done
yum install -y yum-utils && yum-config-manager --add-repo http://mirrors.ustc.edu.cn/epel/7/x86_64/ && yum install --nogpgcheck -y epel-release && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 && rm -rf /etc/yum.repos.d/mirrors.ustc.edu.cn_epel*
cat >> /etc/yum.repos.d/ceph.repo << EOF
[Ceph]
name=Ceph packages for $basearch
baseurl=http://mirrors.163.com/ceph/rpm-nautilus/el7/x86_64/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://mirrors.163.com/ceph/keys/release.asc
priority=1
[Ceph-noarch]
name=Ceph noarch packages
baseurl=http://mirrors.163.com/ceph/rpm-nautilus/el7/noarch/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://mirrors.163.com/ceph/keys/release.asc
priority=1
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.163.com/ceph/rpm-nautilus/el7/SRPMS/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://mirrors.163.com/ceph/keys/release.asc
priority=1
EOF
yum -y update && yum -y install ceph-deploy```
### 使用ceph-deploy在所有节点安装软件包
#### 命令清除配置:
ceph-deploy purgedata {ceph-node} [{ceph-node}]
ceph-deploy forgetkeys
#### 连 Ceph 安装包一起清除
ceph-deploy purge {ceph-node} [{ceph-node}]
在管理节点(admin-node)
`mkdir my-cluster && cd my-cluster`
##### ceph-deploy new admin-node node1 node2 node3 创建集群。
sed -i '2a osd pool default size = 2' ceph.conf # 修改默认副本数从 3 改成 2
sed -i '3a public network = 10.0.5.0/24' ceph.conf
#### 修改ceph-deploy安装过程中的源
export CEPH_DEPLOY_REPO_URL=http://mirrors.163.com/ceph/rpm-nautilus/el7/
export CEPH_DEPLOY_GPG_URL=http://mirrors.163.com/ceph/keys/release.asc
ceph-deploy install admin-node node1 node2 node3
#### 生成密钥环
ceph-deploy mon create-initial```
ceph-deploy admin admin-node node1 node2 node3```
#### 检查集群健康状态
ceph health ```
ceph-deploy osd create node1 --data /dev/sdb
ceph-deploy osd create node1 --data /dev/sdb
ceph-deploy osd create node3 --data /dev/sdb