CentOS 7 x64 Installing Ceph

Source: Internet
Author: User

CentOS 7 x64 Installing Ceph



Second, the experimental environment


Node IP host Name System


MON 172.24.0.13 ceph-mon0 CentOS 7 X64

MDS 172.24.0.13 ceph-mds0 CentOS 7 X64

OSD0 172.24.0.14 ceph-osd0 CentOS 7 X64

OSD1 172.24.0.14 CEPH-OSD1 CentOS 7 X64



Client



Third, installation steps


1, first establish the Machine SSH trust relationship


Generate key

Ssh-keygen-t Rsa-p '

Ssh-keygen-t rsa-f. Ssh/id_rsa-p "


Copy to an authorized host


Ssh-copy-id-i. ssh/id_rsa.pub [email protected] Host


--------------------------------------------------------

Ssh-copy-id-i. ssh/id_rsa.pub [Email protected]

Ssh-copy-id-i. ssh/id_rsa.pub [Email protected]

--------------------------------------------------------



Configure all host time synchronization


Installing Ntpdate

Yum-y Install Ntpdate


Start Sync Time

Ntpdate time.windows.com



Modify the host name (hostname) for each machine (Mon,mds,osd,client must be set)

------------------------------------------------------------------------------------

echo 172.24.0.13 ceph-mon0 >>/etc/hosts

echo 172.24.0.13 ceph-mds0 >>/etc/hosts

echo 172.24.0.14 ceph-osd0 >>/etc/hosts

echo 172.24.0.14 CEPH-OSD1 >>/etc/hosts

------------------------------------------------------------------------------------



Yum update, installing dependent packages (for MON,MDS,OSD)

-------------------------------------------------------------------------------------

RPM--import ' Https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc '

RPM-UVH http://mirrors.yun-idc.com/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Yum Install snappy leveldb gdisk python-argparse gperftools-libs-y

RPM-UVH http://ceph.com/rpm-dumpling/el7/noarch/ceph-release-1-0.el7.centos.noarch.rpm

Yum Install Ceph-deploy-y

Yum Install Ceph-y


Yum Install Btrfs-progs (for all OSD)

-------------------------------------------------------------------------------------



Configuration/etc/ceph/ceph.conf, (for MON,MDS,OSD)


Vi/etc/ceph/ceph.conf


------------------------------------------------------------------------------------------------

[Global]

Public network = 172.24.0.0/24

PID file =/var/run/ceph/$name. pid

Auth Cluster required = None

Auth service required = None

Auth Client required = None

Keyring =/etc/ceph/keyring. $name

OSD Pool Default size = 1

OSD Pool default min size = 1

OSD Pool default Crush rule = 0

OSD Crush Chooseleaf type = 1

[Mon]

Mon data =/var/lib/ceph/mon/$name

Mon clock Drift allowed =. 15

Keyring =/etc/ceph/keyring. $name

[mon.0]

Host = Ceph-mon0

Mon addr = 172.24.0.13:6789

[MDS]

Keyring =/etc/ceph/keyring. $name

[mds.0]

Host = Ceph-mds0

[OSD]

OSD data =/mnt/osd$id

OSD Recovery Max active = 5

OSD MKFS type = XFS

OSD Journal =/mnt/osd$id/journal

OSD Journal size = 1000

Keyring =/etc/ceph/keyring. $name

[osd.0]

Host = Ceph-osd0

Devs =/dev/mapper/centos-osd0

[Osd.1]

Host = CEPH-OSD1

Devs =/DEV/MAPPER/CENTOS-OSD1

----------------------------------------------------------------------------------------------------


Create directory (OSD)


Mkdir/mnt/osd0

Mkdir/mnt/osd1




Start Ceph (executed on Mon)


Initialization

Mkcephfs-a-c/etc/ceph/ceph.conf

/etc/init.d/ceph-a start



(#遇到 Error enoent:osd.0 does not exist. Create it before updating the crush map) executes the following code:


Ceph OSD Create


And then in the execution/etc/init.d/ceph-a start can both be completed





Perform a health check

Ceph Health #也可以使用ceph-S command to view the status (if HEALTH_OK is returned, it is successful!) )



Mount Ceph (172.24.0.15 for client)


Mon recommended there are at least 3, if hung off one, the service can also be used normally


Client0 CentOS7 Default does not open CEPH_FS kernel, need to change the kernel, here directly with Yum Update (can be compiled manually)


Using the Elrepo provided, the already compiled kernel


RPM--import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

RPM-UVH http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Yum Install-y Yum-plugin-fastestmirror

Yum--enablerepo=elrepo-kernel Install kernel-ml kernel-ml-devel

Grub2-set-default 0

Reboot restarting the server


Mkdir/opt/ceph

1. Ceph-fuse-m 172.24.0.13:6789/opt/ceph


2. Mount-t Ceph 172.24.0.13:6789//opt/ceph


#这里的密钥, is the content in Mon/etc/ceph/keyring.client.admin.


Multiple Mon can be used, separate numbers such as: Ceph-fuse-m 172.24.0.13:6789,172.24.0.14:6789,172.24.0.15:6789/opt/ceph


CentOS 7 x64 Installing Ceph

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.