ceph客户端使用_Docker Swarm 使用ceph存储客户端配置脚本

该脚本需要在每个节点上执行,ceph版本对应了上一篇文章ceph的版本,如果有需要自行变更yum的版本配置。默认使用pool为docker1,需要自行创建。

/etc/ceph/ceph.client.admin.keyring及/etc/ceph/ceph.conf的内容需要从ceph集群的master节点上拷贝到该配置脚本里面,更新对应内容。

# create ceph config directory

mkdir -p /etc/ceph/

# touch ceph config

tee /etc/ceph/ceph.client.admin.keyring <

[client.admin]

key = AQCvmNRbYU1MNxAA6BZR/ORV+kK3e8O7p1dAuQ==

EOF

tee /etc/ceph/ceph.conf <

[global]

fsid = 81c49ab9-048a-4c95-b075-1259eb5a2c6d

mon_initial_members = ceph-1, ceph-2, ceph-3

mon_host = 10.255.255.141,10.255.255.142,10.255.255.143

auth_cluster_required = cephx

auth_service_required = cephx

auth_client_required = cephx

public_network=10.255.255.0/24

EOF

# install ceph-common

yum clean all

yum install wget -y

rm -rf /etc/yum.repos.d/*.repo

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

sed -i '/aliyuncs/d' /etc/yum.repos.d/CentOS-Base.repo

sed -i '/aliyuncs/d' /etc/yum.repos.d/epel.repo

#配置ceph非本地源

#在每个节点执行:vim /etc/yum.repos.d/ceph.repo,并将以下内容放入ceph.repo

cat <> /etc/yum.repos.d/ceph.repo

[ceph]

name=ceph

baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/x86_64/

gpgcheck=0

[ceph-noarch]

name=cephnoarch

baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/noarch/

gpgcheck=0

EOT

yum makecache

yum -y install ceph-common

# install rexray

curl -sSL https://rexray.io/install | sh

tee /etc/rexray/config.yml <

rexray:

logLevel: debug

libstorage:

logging:

level: debug

httpRequests: true

httpResponses: true

libstorage:

service: rbd

rbd:

defaultPool: rbd

EOF

systemctl start rexray

systemctl enable rexray

systemctl status rexray

# install rexray/rbd docker plugin

docker plugin install rexray/rbd RBD_DEFAULTPOOL=rbd LINUX_VOLUME_FILEMODE=0777

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值