Tecnologia da Informação - TI : Ceph : Configure Ceph Cluster

Total de visualizações de página

quinta-feira, 14 de abril de 2016

Ceph : Configure Ceph Cluster




2015/12/10
 
Install Distributed File System "Ceph" to Configure Storage Cluster.
For example on here, Configure Cluster with 1 admin Node and 3 Storage Node like follows.
                                         |
        +--------------------+           |           +-------------------+
        | [dlp.server.world] |10.0.0.30  |   10.0.0.x|   [   Client  ]   |
        |    Ceph-Deploy     +-----------+-----------+                   |
        |                    |           |           |                   |
        +--------------------+           |           +-------------------+
            +----------------------------+----------------------------+
            |                            |                            |
            |10.0.0.51                   |10.0.0.52                   |10.0.0.53 
+-----------+-----------+    +-----------+-----------+    +-----------+-----------+
| [node01.server.world] |    | [node02.server.world] |    | [node03.server.world] |
|     Object Storage    +----+     Object Storage    +----+     Object Storage    |
|     Monitor Daemon    |    |                       |    |                       |
|                       |    |                       |    |                       |
+-----------------------+    +-----------------------+    +-----------------------+

[1]
Add a user for Ceph admin on all Nodes.
It adds "cent" user on this exmaple.
[2]Grant root priviledge to Ceph admin user just added above with sudo settings.
[root@dlp ~]# 
echo -e 'Defaults:cent !requiretty\ncent ALL = (root) NOPASSWD:ALL' | tee /etc/sudoers.d/ceph 

[root@dlp ~]# 
chmod 440 /etc/sudoers.d/ceph 
[3]Login as a Ceph admin user and configure Ceph.
Set SSH key-pair from Ceph Admin Node (it's "dlp.server.world" on this example) to all storage Nodes.
[cent@dlp ~]$ 
ssh-keygen 

Generating public/private rsa key pair.
Enter file in which to save the key (/home/cent/.ssh/id_rsa):
Created directory '/home/cent/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/cent/.ssh/id_rsa.
Your public key has been saved in /home/cent/.ssh/id_rsa.pub.
The key fingerprint is:
54:c3:12:0e:d3:65:11:49:11:73:35:1b:e3:e8:63:5a cent@dlp.server.world
The key's randomart image is:

[cent@dlp ~]$ 
vi ~/.ssh/config
# create new ( define all nodes and users )

Host dlp
    Hostname dlp.server.world
    User cent
Host node01
    Hostname node01.server.world
    User cent
Host node02
    Hostname node02.server.world
    User cent
Host node03
    Hostname node03.server.world
    User cent

[cent@dlp ~]$ 
chmod 600 ~/.ssh/config
# transfer key file

[cent@dlp ~]$ 
ssh-copy-id node01 

cent@node01.server.world's password: 
Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'node01'"
and check to make sure that only the key(s) you wanted were added.

[cent@dlp ~]$ 
ssh-copy-id node02 

[cent@dlp ~]$ 
ssh-copy-id node03 
[4]Install Ceph to all Nodes from Admin Node.
[cent@dlp ~]$ 
sudo yum -y install epel-release yum-plugin-priorities \
http://download.ceph.com/rpm-infernalis/el7/noarch/ceph-release-1-1.el7.noarch.rpm
[cent@dlp ~]$ 
sudo sed -i -e "s/enabled=1/enabled=1\npriority=1/g" /etc/yum.repos.d/ceph.repo 

[cent@dlp ~]$ 
sudo yum -y install ceph-deploy
[cent@dlp ~]$ 
mkdir ceph 

[cent@dlp ~]$ 
cd ceph 
[cent@dlp ceph]$ 
ceph-deploy new node01 

[cent@dlp ceph]$ 
vi ./ceph.conf
# add to the end

osd pool default size = 2
[cent@dlp ceph]$ 
vi /usr/lib/python2.7/site-packages/ceph_deploy/install.py
# line 20: change

args.release = '
infernalis
'
# install Ceph on all Nodes

[cent@dlp ceph]$ 
ceph-deploy install dlp node01 node02 node03
# settings for monitoring and keys

[cent@dlp ceph]$ 
ceph-deploy mon create-initial 
[5]Configure Ceph Cluster from Admin Node.
Beforeit, Create a directory /storage01 on Node01, /storage02 on Node02, /storage03 on node03 and change owner to ceph:ceph on this example.
# prepare Object Storage Daemon

[cent@dlp ceph]$ 
ceph-deploy osd prepare node01:/storage01 node02:/storage02 node03:/storage03
# activate Object Storage Daemon

[cent@dlp ceph]$ 
ceph-deploy osd activate node01:/storage01 node02:/storage02 node03:/storage03
# transfer config files

[cent@dlp ceph]$ 
ceph-deploy admin dlp node01 node02 node03 

[cent@dlp ceph]$ 
sudo chmod 644 /etc/ceph/ceph.client.admin.keyring
# show status (display like follows if no ploblem)

[cent@dlp ceph]$ 
ceph health 

HEALTH_OK
[6]By the way, if you'd like to clean settings and re-configure again, do like follows.
# remove packages

[cent@dlp ceph]$ 
ceph-deploy purge dlp node01 node02 node03
# remove settings

[cent@dlp ceph]$ 
ceph-deploy purgedata dlp node01 node02 node03 

[cent@dlp ceph]$ 
ceph-deploy forgetkeys

Nenhum comentário:

Postar um comentário

O Caminho para a Infraestrutura Ágil: Modernizar ou Estagnar?

  Com certeza. Para um post mais denso e detalhado, o ideal é abordar a Transformação Digital e a Modernização da Infraestrutura . Esse tipo...