ip | 主机名 | 安装组件 |
---|---|---|
100.236.0.23 | BIM-PICTURE-MINIO01 | mon node3 osd2 mgr |
100.236.0.21 | BIM-CACHE-REDIS01 | mon node2 osd1 mgr |
100.238.0.13 | BIM-DATA-MONGODB01 | admin ceph-deploy mon node1 osd0 mgr rgw |
systemctl stop firewalld
systemctl disable firewalld
vi /etc/selinux/config
setenforce 0
每台机器都需要执行
hostnamectl set-hostname bim-data-mongodb01
vim /etc/hosts
100.236.0.23 bim-picture-minio01
100.236.0.21 bim-cache-redis01
100.238.0.13 bim-data-mongodb01
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
vi ceph.repo
[ceph-nautilus]
name=ceph-nautilus
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/x86_64/
enabled=1
gpgcheck=0
[ceph-nautilus-noarch]
name=ceph-nautilus-noarch
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/noarch/
enabled=1
gpgcheck=0
sed -i ‘/aliyuncs.com/d‘ /etc/yum.repos.d/CentOS-Base.repo
yum install -y ntp
服务节点 100.238.0.13
vim /etc/ntp.conf #有4行server的位置,把那4行server行注释掉,填写以下两行
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
chkconfig ntpd on
systemctl start ntpd
systemctl status ntpd
其他节点
server 100.238.0.13 iburst
fudge 127.127.1.0 stratum 11
ntpq -p
sudo useradd cephuser
sudo passwd cephuser
test123456
确保各 Ceph 节点上新创建的用户都有 sudo 权限--所有节点操作
[root@admin ~]# visudo ----在root ALL=(ALL) ALL下面添加:
cephuser ALL=(root) NOPASSWD:ALL
添加无密码ssh登录(在admin节点操作)
su cephuser
ssh-keygen
ssh-copy-id cephuser@bim-picture-minio01
ssh-copy-id cephuser@bim-cache-redis01
ssh-copy-id cephuser@bim-data-mongodb01
首先在这里需要先下载一个包并安装否则会报错,然后在创建集群
[cephuser@admin ~]$ wget https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
[cephuser@admin ~]$ unzip distribute-0.7.3.zip
[cephuser@admin ~]$ cd distribute-0.7.3
[cephuser@admin distribute-0.7.3]$ sudo python setup.py install
yum install ceph-deploy -y
ceph-deploy --version
mkdir bsp-ceph
cd bsp-ceph
在admin节点
ceph-deploy new bim-data-mongodb01 bim-cache-redis01 bim-picture-minio01
每个节点安装 ceph
sudo yum install ceph ceph-mon ceph-mgr ceph-radosgw -y
ceph-deploy mon create-initial
ceph-deploy mon add bim-picture-minio01 bim-cache-redis01
ceph-deploy mgr create bim-data-mongodb01
ceph-deploy mgr create bim-picture-minio01 bim-cache-redis01
ceph-deploy admin bim-picture-minio01 bim-cache-redis01 bim-data-mongodb01
ceph-deploy osd create bim-data-mongodb01 --data /dev/sdc
ceph-deploy osd create bim-cache-redis01 --data /dev/sdc
ceph-deploy osd create bim-picture-minio01 --data /dev/sdc
ceph-deploy rgw create bim-data-mongodb01
sudo yum install ceph-mgr-dashboard
ceph mgr module enable dashboard --force
sudo ceph config-key set mgr/dashboard/node1/server_addr 100.238.0.13
sudo ceph config-key put mgr/dashboard/server_port 8443
ceph dashboard create-self-signed-cert
sudo ceph dashboard set-login-credentials admin admin
ceph config set mgr mgr/dashboard/ssl false
ceph mgr services
https://100.238.0.13:8443/#/dashboard
radosgw-admin user create --uid test --display-name ‘test‘ --system
eph dashboard set-rgw-api-access-key YPA733BA04K26OZWTK13GS
ceph dashboard set-rgw-api-secret-key 8i5TsKfKeVX9C6Di5ZHg33BdD3UDhIZdA7cGkQa96S
原文:https://blog.51cto.com/u_15259566/2875928