你的位置:首页 > 操作系统

[操作系统]ceph 文件系统的安装

yum install -y wgetwget https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903etar zxvf pip-1.5.6.tar.gzcd pip-1.5.6python setup.py buildpython setup.py installssh-keygen##################################echo "ceph-admin" >/etc/hostname#echo "ceph-node1" >/etc/hostname#echo "ceph-node2" >/etc/hostname#echo "ceph-node3" >/etc/hostname#reboot#################################cat >/etc/hosts<<EOF192.168.55.185 ceph-admin192.168.55.186 ceph-node1192.168.55.187 ceph-node2192.168.55.188 ceph-node3EOFssh-copy-id [email protected] && sh-copy-id [email protected] && ssh-copy-id [email protected] [email protected] systemctl stop firewalld && setenforce 0ssh [email protected] systemctl stop firewalld && setenforce 0ssh [email protected] systemctl stop firewalld && setenforce 0cat >/root/.ssh/config<<EOFHost ceph-node1  Hostname ceph-node1  User rootHost ceph-node2  Hostname ceph-node2  User rootHost ceph-node3  Hostname ceph-node3  User rootEOFmkdir ~/my-clustercd ~/my-clusterpip install ceph-deployceph-deploy new ceph-node1 ceph-node2 ceph-node3ceph-deploy install ceph-node1 ceph-node2 ceph-node3ceph-deploy mon create-initialceph-deploy mon create ceph-node1 ceph-node2 ceph-node3ceph-deploy gatherkeys ceph-node1 ceph-node2 ceph-node3############################################################################## ceph-deploy --overwrite-conf mon create ceph-node1 ceph-node2 ceph-node3##############################################################################mkfs.xfs /dev/sdb#mount /dev/sdb /opt/ceph/ssh [email protected] mkdir /opt/cephssh [email protected] mkdir /opt/cephssh [email protected] mkdir /opt/ceph  ceph-deploy osd prepare ceph-node1:/opt/ceph ceph-node2:/opt/ceph ceph-node3:/opt/cephceph-deploy osd activate ceph-node1:/opt/ceph ceph-node2:/opt/ceph ceph-node3:/opt/ceph#添加metadata节点ceph-deploy mds create ceph-node1################################################################分发key文件#ceph-deploy admin ceph-admin ceph-node1 ceph-node2 ceph-node3################################################################集群检查ceph healthceph -sceph -wceph quorum_status --format json-pretty       #客户端挂载yum install -y ceph-fusemkdir /mnt/ceph[[email protected] ~]# ceph osd pool create metadata 256 256[[email protected] ~]# ceph osd pool create data 256 256[[email protected] ~]# ceph fs new filesystemNew metadata data[[email protected] ceph]# ceph fs lsname: filesystemNew, metadata pool: metadata, data pools: [data ][[email protected] ceph]# ceph mds state5: 1/1/1 up {0=ceph-node1=up:active}ceph-fuse -m 192.168.55.186:6789 /mnt/ceph####end#####添加osd节点ssh ceph-node1sudo mkdir /var/local/osd2exit[[email protected] my-cluster]# ceph-deploy osd prepare ceph-node1:/var/local/osd2[[email protected] my-cluster]# ceph-deploy osd activate ceph-node1:/var/local/osd2[[email protected] my-cluster]# ceph -w[[email protected] my-cluster]# ceph -s  cluster 8f7a79b6-ab8d-40c7-abfa-6e6e23d9a26d   health HEALTH_OK   monmap e1: 1 mons at {ceph-node1=192.168.55.186:6789/0}, election epoch 2, quorum 0 ceph-node1   osdmap e13: 3 osds: 3 up, 3 in   pgmap v38: 64 pgs, 1 pools, 0 bytes data, 0 objects      18600 MB used, 35153 MB / 53754 MB avail         64 active+clean         #添加monitors节点[[email protected] my-cluster]# ceph-deploy new ceph-node2 ceph-node3[[email protected] my-cluster]# ceph-deploy mon create-initial[[email protected] my-cluster]# ceph-deploy --overwrite-conf mon create ceph-node2 ceph-node3