Install Ceph0.24 on Fedora14

Source: Internet
Author: User
It took a long time to install ceph, and there were too many detours in the middle. It is really necessary to write down the summary. During this period, I also referred to a lot of other people's materials. Finally, with the help of enthusiastic people on the ceph official website's mail-list, I successfully constructed the prototype. The Ceph system has a total of four roles: client, mon, mds, and osd. The documents mon and mds are installed together. I build a test on Vmware. I used to build three hosts. Later, I encountered some problems in the middle. in order to exclude the osd connection

It took a long time to install ceph, and there were too many detours in the middle. It is really necessary to write down the summary. During this period, I also referred to a lot of other people's materials. Finally, with the help of enthusiastic people on the ceph official website's mail-list, I successfully constructed the prototype.

The Ceph system has a total of four roles: client, mon, mds, and osd. The documents mon and mds are installed together. I build a test on Vmware. I had built three hosts. Later I encountered some problems in the middle. To eliminate the osd connection problem, mon, mds, and osd were directly mounted on one machine. This does not affect initial installation exploration.

Prerequisites: several hosts are required to be password-free and can be accessed according to the hostname. Specific implementation can refer to the http://www.linuxidc.com/Linux/2011-01/31579.htm

The procedure is as follows:

1. The first is the client, which requires support from the ceph. ko module. For earlier versions of the kernel, you may need to manually compile the kernel to load the module. If you want to know whether the running OS already contains this module, run cd to the directory/lib/modules/***/kernel/fs/to view the file types supported by the current kernel, if the ceph file exists, the module is included. Load modprobe ceph. $ Modprobe-l | grep ceph,

Kernel/fs/ceph. ko // if this information is returned, it indicates that the load is successful and the client is OK.

2. If step 1 is OK, skip this step. For systems such as RedHat, the selected kernel is relatively old and must be upgraded to at least 2.6.34. Because the new kernel version provides direct support for ceph. Either of the methods is directly from someone else's cpoy.

Method 1

$ Git clone git: // git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git

$ Cd ceph-client

$ Make menuconfig

// Search for ceph. You can find two options about ceph. Select this option. Compile the kernel method here. // you will not go into details and directly run the command.

$ Make & make modules & make modules_install & make install & reboot

// The above command for compiling the kernel is only valid on the redhat system. Other releases may be slightly different. google it yourself.

Method 2:

$ Download source code

$ Git clone git: // ceph.newdream.net/git/ceph-client-standalone.git

$ Git branch master-backport origin/master-backport

$ Git checkout master-backport

$ Compile

$ Make or make KERNELDIR =/usr/src /... $ The former indicates that the kernel is currently in use, and the latter indicates other paths.

$ After compilation is successful, ceph. ko is generated.

$ Make install

$ Modprobe ceph or inmod ceph. ko

Install OSD. These steps must be repeated on each OSD.

3.1, go to the official website to download the latest version of the source code http://ceph.newdream.net/

3.2. decompress and install.

$ Tar-xzvf ceph-0.24.tar.gz

$./Autogen. sh

$./Configure

$ Make

In configure, you will be prompted that some packages are missing. You can install Fedora 14 directly using yum.

3.3 prepare the OSD space and use tools such as fdisk to allocate an independent Partition

3.4. format the new partition in btrfs.

$ Yum install btrfs-progs.i686

$ Mkfs. btrfs/dev/sda3

3.5 mount a partition

$ Mkdir-p/mnt/btrfs/osd0

$ Mount-t btrfs/dev/cciss/c0d2p1/mnt/btrfs/osd0/

$ Df-h

/Dev/sda1 9.7 GB 4.6G 5.0G 48%/

/Dev/sda3 9.3G 4.4 M 9.3G 1%/mnt/btrfs/osd0

4. Install mon and mds

4.1, repeat 3.1 and 3.2

4.2. Configure the ceph. conf and fetch_config configuration files.

Ceph. conf:

; Global

[Global]

; Enable secure authentication

; Auth supported = cephx

 

; Monitors

; You need at least one. You need at least three if you want

; Tolerate any node failures. Always create an odd number.

[Mon]

Mon data =/data/mon $ id

 

; Logging, for debugging monitor crashes, in order

; Their likelihood of being helpful :)

; Debug MS = 1

; Debug mon = 20

; Debug paxos = 20

; Debug auth = 20

 

[Mon0]

Host = cephosd

Mon addr = 192.168.178.160: 6789

 

; Mds

; You need at least one. Define two to get a standby.

[Mds]

; Where the mds keeps it's secret encryption keys

; Keyring =/data/keyring. $ name

 

; Mds logging to debug issues.

; Debug MS = 1

; Debug mds = 20

 

[Mds. alpha]

Host = cephosd

 

; Osd

; You need at least one. Two if you want data to be replicated.

; Define as same as you like.

[Osd]

Sudo = true

; This is where the btrfs volume will be mounted.

Osd data =/mnt/btrfs/osd0 $ id

 

; Ideally, make this a separate disk or partition. A few

; Hundred MB shoshould be enough; more if you have fast or fail

; Disks. You can use a file under the osd data dir if need be

; (E.g./data/osd $ id/journal), but it will be slower than

; Separate disk or partition.

 

; This is an example of a file-based journal.

Osd journal =/mnt/btrfs/osd $ id/journal

Osd journal size = 1000; journal size, in megabytes

 

; Osd logging to debug osd issues, in order of likelihood of being

; Helpful

; Debug MS = 1

; Debug osd = 20

; Debug filestore = 20

; Debug journal = 20

 

[Osd0]

Host = cephosd

 

; If 'btrfs devs 'is not specified, you're responsible

; Setting up the 'oss data' dir. if it is not btrfs, things

; Will behave up until you try to recover from a crash (which

; Usually fine for basic testing ).

Btrfs devs =/dev/sda3

Osd data =/mnt/btrfs/osd0

 

 

; Access control

[Group everyone]

; You probably want to limit this to a small or a list

; Hosts. clients are fully trusted.

Addr = 0.0.0.0/0

[Mount/]

Allow = % everyone

 

Fetch_config:

 

#! /Bin/sh

Conf = "$1"

 

# Fetch ceph. conf from some remote location and save it to $ conf.

##

# Make sure this script is executable (chmod + x fetch_config)

 

##

# Examples:

##

 

# From a locally accessible file

# Cp/path/to/ceph. conf $ conf

 

# From a URL:

# Wget-q-O $ conf http://somewhere.com/some/ceph.conf

 

# Via scp

# Scp-I/path/to/id_dsa user @ host:/path/to/ceph. conf $ conf

Scp qw @ cephosd:/qw/ceph-0.24/src/ceph. conf.

 

Ceph. config is important. mon must use it to connect to various osdks. Therefore, you must configure the settings correctly and set many functions here. Because the installation is tested, the simplest configuration is selected. Fetch_config: in this file, we use the scp method. In addition, we can use nfs to share the ceph. conf file. In short, the purpose is to use the same ceph. conf file in the entire cluster. After the installation is complete, the ceph folder will be generated under/etc/local/etc/and the two configuration files will be placed here.

4.3/etc/init. d/ceph script

This script will generate an init-ceph file in src/when compiling ceph, which is generated by the init-ceph.in template.

If you need to start the ceph cluster automatically, copy the script to the/etc/init. d/directory and run the chkconfig command to add the service.

This service should only be installed on the monitor terminal.

4.4 create a file system and execute

$ Mkcephfs-c/etc/local/etc/ceph. conf -- allhosts -- mkbtrfs-k keyring. bin

Based on ceph. the configuration in conf is automatically configured on each node. here we will talk about keyring. binfile. It does not exist at first. It is not required by default. It can be run in the src directory. /vstart. sh-n-x is automatically generated.

4.5 start the ceph File System

Run on mon

$/Etc/init. d/ceph-a start

5. The client is mounted to the System

$ Mkdir/mnt/ceph

$ Mount-t ceph 192.168.178.160: // mnt/ceph

$ Df-h

Filesystem Size Used Avail Use % Mounted on

/Dev/mapper/vg_client-lv_root

18 GB 9.0G 8.3G 53%/

/Dev/sda1 485 M 51 M 409 M 12%/boot

192.168.178.160:/9.3G 5.0 M 9.3G 1%/mnt/ceph

Many problems may cause failure in mounting.

1) mount error 5 = Input/output error. This problem may be caused by the firewall of the host OS installed on the virtual machine.

2) can't read superblock. There are many reasons for this problem. It may be that the firewall of osd and mon is not closed, or it may be modified in the port configuration document. In addition, once the configuration document changes, it is recommended that mkcephfs be re-executed, because this command will generate some files that correspond to the original configuration file.

3) if the problem persists, go to the ceph mail-list and ask, as long as you have a clear description of the problem. The author is very enthusiastic.

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.