Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Ceph in CentOS7

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to build Ceph in CentOS7, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Hardware environment preparation

3 CentOS7. The data disk is determined according to the need

Software environment preparation

Close SELINUX

# sed-I's etc/selinux/config# setenforce GN / etc/selinux/config# setenforce 0

Close iptables

# systemctl stop firewalld# systemctl disable firewalld

Each installation configuration source

# yum clean all# rm-rf / etc/yum.repos.d/*.repo# wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.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

Synchronization time

Installation

# yum-y ntp ntpdate

Open the edit configuration file in node1

# vim / etc/ntp.confdriftfile / var/lib/ntp/driftrestrict default nomodifyrestrict your ip address mask 255.255.255.0 nomodifyserver 127.127.1.0fudge 127.127.1.0 stratum 10includefile / etc/ntp/crypto/pwkeys / etc/ntp/keysdisable monitor

Start

# systemctl start ntpd

Execute in the other two.

# ntpdate node1

Add a scheduled task

# crontab-eBay root ntpdate node1 10 * root ntpdate node1

Modify hostname separately

# hostname node1# echo node1 > / etc/hostname

Modify / etc/hosts separately

# cat / etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.50.1 node1192.168.50.2 node2192.168.50.3 node3

Configure ssh password-free login separately

# ssh-keygen-t rsa-P''# ssh-copy-id node1# ssh-copy-id node2# ssh-copy-id node3Ceph deployment

Add ceph source (need to confirm before installation, re-source after purge)

# vim / etc/yum.repos.d/ceph.repo [ceph] name=cephbaseurl= http://mirrors.163.com/ceph/rpm-jewel/el7/x86_64/gpgcheck=0[ceph-noarch]name=cephnoarchbaseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/noarch/gpgcheck=0

(optional) this step is to ensure that 163 sources are used

CentOS:# export CEPH_DEPLOY_REPO_URL= http://mirrors.163.com/ceph/rpm-jewel/el7# export CEPH_DEPLOY_GPG_URL= http://mirrors.163.com/ceph/keys/release.asc

Node1 install deploy

# yum install ceph-deploy-y

Create a directory

# mkdir ~ / ceph-cluster# cd ceph-cluster/

Create

# ceph-deploy new node1 node2 node3

Install ceph

# ceph-deploy install node1 node2 node3

Initialize mon

# ceph-deploy mon create-initial

Create osd

# ceph-deploy-overwrite-conf osd create mode1:/dev/sdb node2:/dev/sdb node3:/dev/sdb

Create admin

# ceph-deploy-overwrite-conf admin node1 node2 node3

View

# ceph healthHEALTH_OK

! If something goes wrong, everything can start all over again.

# ceph-deploy purge node1 node2 node3# ceph-deploy purgedata node1 node2 node3# ceph-deploy forgetkeysCeph usage

Create mds

# ceph-deploy mds create node1

Create data pool and metadata pool

# ceph osd pool create cephfs_data 128 128# ceph osd pool create cephfs_metadata 128 128

Create cephfs

# cephfs new cephfs cephfs_metadata cephfs_data

View cephfs

# ceph fs ls

Create a mount directory

# cd / mnt & & mkdir cephfs_mnt

Get key

# ceph auth get-key client.admin-o / etc/ceph/adminkey

Mounting

# mount-t ceph node1:/ cephfs_mnt-o name=admin,secretfile=/etc/ceph/adminkey above is all the content of this article "how to build Ceph in CentOS7". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report