标签:project /etc centos rpm map 系统 image 相关 内容
systemctl disable firewalld
systemctl stop firewalld
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
将如下内容写入到 /etc/yum.repos.d/ceph.repo
中
[ceph-noarch]
name=Ceph noarch packages
baseurl=https://download.ceph.com/rpm/el7/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://download.ceph.com/keys/release.asc
然后执行 yum update && yum install ceph-deploy
yum install ntp ntpdate
每一个节点
为 ceph 创建用户, 并设置 sudo 权限, 虽然可以拥有不同的用户名,但是这里为了省事都叫 uceph
useradd -d /home/uceph -m uceph
passwd uceph
echo "uceph ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/uceph
chmod 0440 /etc/sudoers.d/uceph
ssh-keygen
ssh-copy-id uceph@{node1}
sudo yum install yum-plugin-priorities
mkdir ceph-cluster
cd ceph-cluster
ceph-deploy new node1[, node2...]
这样 ceph-cluster
目录下就有了一些配置文件:
ceph.conf
ceph.mon.keyring
*.log
修改 ceph.conf
配置里面的 public network 10.0.5.0/mask
ceph-deploy install node1 node2 node3
如果安装失败就
yum remove epel-release
然后再重新弄
ceph-deploy mon create-initial
# 失败了就多来几次
得到一些 keyring
文件
ceph-deploy admin node1 node2 node3
ceph-deploy mgr create node1
# parted -s /dev/sdb mklabel gpt 超大硬盘需要先改成 gpt
ceph-deploy osd create node1:sdb node2:sdb
## 以后想再添加硬盘时也是通过这个命令
[uceph@node1 ceph-cluster]$ sudo ceph health
HEALTH_WARN 64 pgs degraded; 64 pgs undersized
[uceph@node1 ceph-cluster]$ sudo ceph -s
cluster f8bb8f53-2331-48a7-9529-63389650e247
health HEALTH_WARN
64 pgs degraded
64 pgs undersized
monmap e1: 1 mons at {node1=10.100.86.51:6789/0}
election epoch 3, quorum 0 node1
osdmap e9: 2 osds: 2 up, 2 in
flags sortbitwise,require_jewel_osds
pgmap v18: 64 pgs, 1 pools, 0 bytes data, 0 objects
68392 kB used, 10151 MB / 10217 MB avail
64 active+undersized+degraded
rbd create foo --size 4 --image-format 2 --image-feature layering
rbd 创建文件异常可参考 http://blog.51cto.com/michaelkang/1786309
rbd map foo
sudo mkfs.ext4 -m0 /dev/rbd0
mkdir ~/foo
mount /dev/rbd0 ~/foo
标签:project /etc centos rpm map 系统 image 相关 内容
原文地址:http://www.cnblogs.com/kischn/p/7977987.html