阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Ceph 文件系统的安装

251次阅读
没有评论

共计 3939 个字符,预计需要花费 10 分钟才能阅读完成。

Ceph 文件系统的安装

yum install -y wget
wget https://pypi.Python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903e
tar zxvf pip-1.5.6.tar.gz
cd pip-1.5.6
python setup.py build
python setup.py install
ssh-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<<EOF
192.168.55.185 ceph-admin
192.168.55.186 ceph-node1
192.168.55.187 ceph-node2
192.168.55.188 ceph-node3
EOF

ssh-copy-id root@ceph-node1 && sh-copy-id root@ceph-node2 && ssh-copy-id root@ceph-node3

ssh root@ceph-node1 systemctl stop firewalld && setenforce 0
ssh root@ceph-node2 systemctl stop firewalld && setenforce 0
ssh root@ceph-node3 systemctl stop firewalld && setenforce 0

cat >/root/.ssh/config<<EOF
Host ceph-node1
  Hostname ceph-node1
  User root
Host ceph-node2
  Hostname ceph-node2
  User root
Host ceph-node3
  Hostname ceph-node3
  User root
EOF

 

mkdir ~/my-cluster
cd ~/my-cluster
pip install ceph-deploy

ceph-deploy new ceph-node1 ceph-node2 ceph-node3
ceph-deploy install ceph-node1 ceph-node2 ceph-node3
ceph-deploy mon create-initial
ceph-deploy mon create ceph-node1 ceph-node2 ceph-node3
ceph-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 root@ceph-node1 mkdir /opt/ceph
ssh root@ceph-node2 mkdir /opt/ceph
ssh root@ceph-node3 mkdir /opt/ceph
   
ceph-deploy osd prepare ceph-node1:/opt/ceph ceph-node2:/opt/ceph ceph-node3:/opt/ceph
ceph-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 health
ceph -s
ceph -w
ceph quorum_status –format json-pretty

# 客户端挂载
yum install -y ceph-fuse
mkdir /mnt/ceph

[root@ceph-admin ~]# ceph osd pool create metadata 256 256
[root@ceph-admin ~]# ceph osd pool create data 256 256
[root@ceph-admin ~]# ceph fs new filesystemNew metadata data

[root@ceph-admin ceph]# ceph fs ls
name: filesystemNew, metadata pool: metadata, data pools: [data]

[root@ceph-admin ceph]# ceph mds stat
e5: 1/1/1 up {0=ceph-node1=up:active}

ceph-fuse -m 192.168.55.186:6789 /mnt/ceph

####end####

# 添加 osd 节点
ssh ceph-node1
sudo mkdir /var/local/osd2
exit
[root@ceph-admin my-cluster]# ceph-deploy osd prepare ceph-node1:/var/local/osd2
[root@ceph-admin my-cluster]# ceph-deploy osd activate ceph-node1:/var/local/osd2
[root@ceph-admin my-cluster]# ceph -w
[root@ceph-admin 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
MB used, 35153 MB / 53754 MB avail
active+clean         

# 添加 monitors 节点
[root@ceph-admin my-cluster]# ceph-deploy new ceph-node2 ceph-node3
[root@ceph-admin my-cluster]# ceph-deploy mon create-initial
[root@ceph-admin my-cluster]# ceph-deploy –overwrite-conf mon create ceph-node2 ceph-node3

————————————– 分割线 ————————————– 

Ceph 环境配置文档 PDF http://www.linuxidc.com/Linux/2013-05/85212.htm 

CentOS 6.3 上部署 Ceph http://www.linuxidc.com/Linux/2013-05/85213.htm 

Ceph 的安装过程 http://www.linuxidc.com/Linux/2013-05/85210.htm 

HOWTO Install Ceph On FC12, FC 上安装 Ceph 分布式文件系统 http://www.linuxidc.com/Linux/2013-05/85209.htm 

Ceph 文件系统安装 http://www.linuxidc.com/Linux/2013-05/85208.htm 

CentOS 6.2 64 位上安装 Ceph 0.47.2 http://www.linuxidc.com/Linux/2013-05/85206.htm 

Ubuntu 12.04 Ceph 分布式文件系统 http://www.linuxidc.com/Linux/2013-04/82588.htm 

Fedora 14 上安装 Ceph 0.24 http://www.linuxidc.com/Linux/2011-01/31580.htm 

————————————– 分割线 ————————————–

Ceph 的详细介绍 :请点这里
Ceph 的下载地址 :请点这里

  本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-06/119366.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计3939字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中