ceph安装和常用命令
程序员文章站
2022-07-10 22:22:21
...
/etc/hosts
ssh-keygen
ssh-copy-id root@ceph-node1
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
mv /etc/yum.repos.d/CentOS-Base.repo{,.bak}
curl http://mirrors.163.com/.help/CentOS7-Base-163.repo -o /etc/yum.repos.d/CentOS-Base.repo
yum install epel-release -y && yum clean all && yum update -y
ntpdate pool.ntp.org
ln Shanghai
rpm -Uvh http://mirrors.163.com/ceph/rpm-jewel/el7/noarch/ceph-release-1-1.el7.noarch.rpm
yum update -y
yum install ceph-deploy -y
################
ceph-deploy new ceph-node1 ceph-node2 ceph-node3
ceph-deploy install ceph-node1 ceph-node2 ceph-node3
每个节点都起了ceph-mon
ceph-deploy mon create-initial
有osd错误忽略,
ceph-deploy disk zap ceph-node1:vdb ceph-node2:vdb ceph-node3:vdb
ceph-deploy osd create ceph-node1:vdb ceph-node2:vdb ceph-node3:vdb
ceph osd pool create k8s 128
ceph auth get-or-create client.k8s mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=k8s'
ceph auth get-or-create client.k8s |ssh root@ceph-node1 tee /etc/ceph/ceph.client.k8s.keyring
ceph auth get-or-create client.k8s |ssh root@ceph-node2 tee /etc/ceph/ceph.client.k8s.keyring
ceph auth get-or-create client.k8s |ssh root@ceph-node3 tee /etc/ceph/ceph.client.k8s.keyring
ceph -s --name client.k8s
ceph osd lspools --name client.k8s
rbd ls -p k8s --name client.k8s
rbd create rbd1 -p k8s --size 10240 --name client.k8s
这个步骤需要内核支持,如果内核不支持,map的时候会报错
rbd create rbd2 -p k8s --size 10240 --name client.k8s --image-feature layering
rbd ls -p k8s --name client.k8s
rbd info --image rbd1 -p k8s --name client.k8s
rbd map --image rbd1 -p k8s --name client.k8s
如果报错
dmesg |tail |grep rbd
ceph osd lspools
ceph mon dump
ceph df
ceph mon stat
ceph osd stat
ceph pg stat
ceph pg dump
ceph auth list
ceph osd tree
如果新加一个节点ceph-node4
在node1上
ssh-copy-id ceph-node4
ceph-deploy install ceph-node4
后面不会了
ssh-keygen
ssh-copy-id root@ceph-node1
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
mv /etc/yum.repos.d/CentOS-Base.repo{,.bak}
curl http://mirrors.163.com/.help/CentOS7-Base-163.repo -o /etc/yum.repos.d/CentOS-Base.repo
yum install epel-release -y && yum clean all && yum update -y
ntpdate pool.ntp.org
ln Shanghai
rpm -Uvh http://mirrors.163.com/ceph/rpm-jewel/el7/noarch/ceph-release-1-1.el7.noarch.rpm
yum update -y
yum install ceph-deploy -y
################
ceph-deploy new ceph-node1 ceph-node2 ceph-node3
ceph-deploy install ceph-node1 ceph-node2 ceph-node3
每个节点都起了ceph-mon
ceph-deploy mon create-initial
有osd错误忽略,
ceph-deploy disk zap ceph-node1:vdb ceph-node2:vdb ceph-node3:vdb
ceph-deploy osd create ceph-node1:vdb ceph-node2:vdb ceph-node3:vdb
ceph osd pool create k8s 128
ceph auth get-or-create client.k8s mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=k8s'
ceph auth get-or-create client.k8s |ssh root@ceph-node1 tee /etc/ceph/ceph.client.k8s.keyring
ceph auth get-or-create client.k8s |ssh root@ceph-node2 tee /etc/ceph/ceph.client.k8s.keyring
ceph auth get-or-create client.k8s |ssh root@ceph-node3 tee /etc/ceph/ceph.client.k8s.keyring
ceph -s --name client.k8s
ceph osd lspools --name client.k8s
rbd ls -p k8s --name client.k8s
rbd create rbd1 -p k8s --size 10240 --name client.k8s
这个步骤需要内核支持,如果内核不支持,map的时候会报错
rbd create rbd2 -p k8s --size 10240 --name client.k8s --image-feature layering
rbd ls -p k8s --name client.k8s
rbd info --image rbd1 -p k8s --name client.k8s
rbd map --image rbd1 -p k8s --name client.k8s
如果报错
dmesg |tail |grep rbd
ceph osd lspools
ceph mon dump
ceph df
ceph mon stat
ceph osd stat
ceph pg stat
ceph pg dump
ceph auth list
ceph osd tree
如果新加一个节点ceph-node4
在node1上
ssh-copy-id ceph-node4
ceph-deploy install ceph-node4
后面不会了
上一篇: 如何用javascript计算渐变颜色
下一篇: 火锅、报表与数据库的故事
推荐阅读
-
linux常用命令小结之yum、源码安装
-
详解webpack介绍&安装&常用命令
-
Vant的安装和配合引入Vue.js项目里的方法步骤
-
安装docker和docker-compose实例详解
-
Win7 32/64位系统下安装SQL2005和SP3补丁安装教程[图文]
-
同时安装vs2005团队开发版和sql 2005企业版的方法(downmoon原作)
-
无法在com+ 目录中安装和配置程序集 错误:-2146233087的解决方法[已测]
-
网站加速VPS篇 memcache和memcached安装方法
-
在centos7下安装和部署java8和mysql
-
前端笔记之Vue(一)初识SPA和Vue&webpack配置和vue安装&指令