分布式存储Ceph的几种安装方法,源码,apt-get,deploy工具,Ubuntu CentOS
最近搞了下分布式PB级别的存储CEPH
尝试了几种不同的安装,使用
期间遇到很多问题,和大家一起分享。
一、源码安装
说明:源码安装可以了解到系统各个组件, 但是安装过程也是很费劲的,主要是依赖包太多。 当时尝试了centos 和 ubuntu 上安装,都是可以安装好的。
1下载ceph
http://ceph.com/download/
2 安装编译工具apt-get install automake autoconf automake libtool make
3 解压
4、
先安装依赖包
#apt-get install autotools-dev autoconf automake cdbs g++ gcc git libatomic-ops-dev libboost-dev \
libcrypto++-dev libcrypto++ libedit-dev libexpat1-dev libfcgi-dev libfuse-dev \
libgoogle-perftools-dev libgtkmm-2.4-dev libtool pkg-config uuid-dev libkeyutils-dev \
uuid-dev libkeyutils-dev btrfs-tools
4 可能遇到错误
4.1 fuse:
apt-get install fuse-devel
4.2 tcmalloc:
wget
https://gperftools.googlecode.com/files/gperftools-2.1.zip
安装google-perftools
4.3 libedit:
apt-get
install
libedit
-devel
4.4 no libatomic-ops found
apt-get
install libatomic_ops-devel
4.5 snappy:
4.6 libleveldb not found:
make
cp libleveldb.* /usr/lib
cp -r include/leveldb /usr/local/include
4.7 libaio
apt-get install libaio-dev
4.8 boost
apt-get install libboost-dev
apt-get install libboost-thread-dev
apt-get install
libboost-program-options-dev
4.9 g++
apt-get install g++
5 编译安装
#./configure –prefix=/opt/ceph/
#make
#make install
#make
#make install
二、使用ubuntn 12.04自带的ceph 版本可能是ceph version 0.41
1
、服务端安装
CEPH (MON
、
MDS
、
OSD)
apt-cache search ceph
apt-get install ceph
apt-get install ceph-common
4、配置文件
# vim /etc/ceph/ceph.conf
[global]
# For version 0.55 and beyond, you must explicitly enable
# or disable authentication with "auth" entries in [global].
auth cluster required = none
auth service required = none
auth client required = none
[osd]
osd journal size = 1000
#The following assumes ext4 filesystem.
filestore xattr use omap = true
# For Bobtail (v 0.56) and subsequent versions, you may
# add settings for mkcephfs so that it will create and mount
# the file system on a particular OSD for you. Remove the comment `#`
# character for the following settings and replace the values
# in braces with appropriate values, or leave the following settings
# commented out to accept the default values. You must specify the
# --mkfs option with mkcephfs in order for the deployment script to
# utilize the following settings, and you must define the 'devs'
# option for each osd instance; see below.
osd mkfs type = xfs
osd mkfs options xfs = -f # default for xfs is "-f"
osd mount options xfs = rw,noatime # default mount option is "rw,noatime"
# For example, for ext4, the mount option might look like this:
#osd mkfs options ext4 = user_xattr,rw,noatime
# Execute $ hostname to retrieve the name of your host,
# and replace {hostname} with the name of your host.
# For the monitor, replace {ip-address} with the IP
# address of your host.
[mon.a]
host = ceph1
mon addr = 192.168.1.1:6789
[osd.0]
host = ceph1
# For Bobtail (v 0.56) and subsequent versions, you may
# add settings for mkcephfs so that it will create and mount
# the file system on a particular OSD for you. Remove the comment `#`
# character for the following setting for each OSD and specify
# a path to the device if you use mkcephfs with the --mkfs option.
devs = /dev/sdb1
[mds.a]
host = ceph1
ceph-deploy forgetkeys
参考资料: