2012-05-30 21:29:10 +00:00
|
|
|
=============================
|
|
|
|
Deploying with ``mkcephfs``
|
|
|
|
=============================
|
|
|
|
|
2012-08-28 20:24:29 +00:00
|
|
|
To deploy a test or development cluster, you can use the ``mkcephfs`` tool.
|
|
|
|
We do not recommend using this tool for production environments.
|
|
|
|
|
|
|
|
|
2012-06-06 00:09:59 +00:00
|
|
|
Enable Login to Cluster Hosts as ``root``
|
2012-08-28 20:24:29 +00:00
|
|
|
=========================================
|
|
|
|
|
2012-06-06 00:09:59 +00:00
|
|
|
To deploy with ``mkcephfs``, you will need to be able to login as ``root``
|
|
|
|
on each host without a password. For each host, perform the following::
|
|
|
|
|
|
|
|
sudo passwd root
|
|
|
|
|
|
|
|
Enter a password for the root user.
|
|
|
|
|
|
|
|
On the admin host, generate an ``ssh`` key without specifying a passphrase
|
2012-12-03 18:48:10 +00:00
|
|
|
and use the default locations. ::
|
2012-06-06 00:09:59 +00:00
|
|
|
|
2012-12-06 22:20:00 +00:00
|
|
|
sudo -i
|
2012-06-06 00:09:59 +00:00
|
|
|
ssh-keygen
|
|
|
|
Generating public/private key pair.
|
2012-12-03 18:48:10 +00:00
|
|
|
Enter file in which to save the key (/root/.ssh/id_rsa):
|
2012-06-06 00:09:59 +00:00
|
|
|
Enter passphrase (empty for no passphrase):
|
|
|
|
Enter same passphrase again:
|
2012-12-03 18:48:10 +00:00
|
|
|
Your identification has been saved in /root/.ssh/id_rsa.
|
|
|
|
Your public key has been saved in /root/.ssh/id_rsa.pub.
|
2012-06-06 00:09:59 +00:00
|
|
|
|
2012-12-06 22:20:00 +00:00
|
|
|
Modify your ``/root/.ssh/config`` file to login as ``root``, as follows::
|
2012-06-06 00:09:59 +00:00
|
|
|
|
|
|
|
Host myserver01
|
|
|
|
Hostname myserver01.fully-qualified-domain.com
|
|
|
|
User root
|
|
|
|
Host myserver02
|
|
|
|
Hostname myserver02.fully-qualified-domain.com
|
|
|
|
User root
|
|
|
|
|
2012-12-07 22:34:10 +00:00
|
|
|
You may use RSA or DSA keys. Once you generate your keys, copy them to each
|
|
|
|
OSD host. For example::
|
|
|
|
|
|
|
|
ssh-copy-id root@myserver01
|
|
|
|
ssh-copy-id root@myserver02
|
2012-08-28 20:24:29 +00:00
|
|
|
|
2012-05-30 21:29:10 +00:00
|
|
|
Copy Configuration File to All Hosts
|
2012-08-28 20:24:29 +00:00
|
|
|
====================================
|
|
|
|
|
2012-05-30 21:29:10 +00:00
|
|
|
Ceph's ``mkcephfs`` deployment script does not copy the configuration file you
|
|
|
|
created from the Administration host to the OSD Cluster hosts. Copy the
|
|
|
|
configuration file you created (*i.e.,* ``mycluster.conf`` in the example below)
|
|
|
|
from the Administration host to ``etc/ceph/ceph.conf`` on each OSD Cluster host
|
|
|
|
if you are using ``mkcephfs`` to deploy Ceph.
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2012-12-07 22:49:27 +00:00
|
|
|
sudo ssh myserver01 tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf
|
|
|
|
sudo ssh myserver02 tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf
|
|
|
|
sudo ssh myserver03 tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf
|
2012-08-28 20:24:29 +00:00
|
|
|
|
2012-05-30 21:29:10 +00:00
|
|
|
|
|
|
|
Create the Default Directories
|
2012-08-28 20:24:29 +00:00
|
|
|
==============================
|
|
|
|
|
2012-08-30 07:35:31 +00:00
|
|
|
The ``mkcephfs`` deployment script does not create the default server
|
|
|
|
directories. Create server directories for each instance of a Ceph daemon (if
|
|
|
|
you haven't done so already). The ``host`` variables in the ``ceph.conf`` file
|
|
|
|
determine which host runs each instance of a Ceph daemon. Using the exemplary
|
|
|
|
``ceph.conf`` file, you would perform the following:
|
2012-05-30 21:29:10 +00:00
|
|
|
|
|
|
|
On ``myserver01``::
|
|
|
|
|
2012-07-09 18:06:27 +00:00
|
|
|
sudo mkdir /var/lib/ceph/osd/ceph-0
|
|
|
|
sudo mkdir /var/lib/ceph/mon/ceph-a
|
2012-05-30 21:29:10 +00:00
|
|
|
|
|
|
|
On ``myserver02``::
|
|
|
|
|
2012-07-09 18:06:27 +00:00
|
|
|
sudo mkdir /var/lib/ceph/osd/ceph-1
|
|
|
|
sudo mkdir /var/lib/ceph/mon/ceph-b
|
2012-05-30 21:29:10 +00:00
|
|
|
|
|
|
|
On ``myserver03``::
|
|
|
|
|
2012-07-09 18:06:27 +00:00
|
|
|
sudo mkdir /var/lib/ceph/osd/ceph-2
|
|
|
|
sudo mkdir /var/lib/ceph/mon/ceph-c
|
|
|
|
sudo mkdir /var/lib/ceph/mds/ceph-a
|
2012-05-30 21:29:10 +00:00
|
|
|
|
2012-08-28 20:24:29 +00:00
|
|
|
|
2012-08-30 07:35:31 +00:00
|
|
|
Mount Disks to the Data Directories
|
|
|
|
===================================
|
|
|
|
|
|
|
|
If you are running multiple OSDs per host and one hard disk per OSD, you should
|
|
|
|
mount the disk under the OSD data directory (if you haven't done so already).
|
2013-01-02 19:15:16 +00:00
|
|
|
When mounting disks in this manner, there is no need for an entry in
|
|
|
|
``/etc/fstab``.
|
2012-08-30 07:35:31 +00:00
|
|
|
|
2012-12-22 00:09:09 +00:00
|
|
|
.. versionadded:: 0.56
|
|
|
|
|
2013-01-02 19:15:16 +00:00
|
|
|
For Bobtail (v 0.56) and beyond, you may specify the file system type, filesystem
|
2012-12-22 00:09:09 +00:00
|
|
|
options, and mount options. Add the following to the ``[global]`` section of your
|
|
|
|
Ceph configuration file, and replace the values in braces with appropriate values::
|
|
|
|
|
|
|
|
osd mkfs type = {fs-type}
|
|
|
|
osd mkfs options {fs-type} = {mkfs options} # default for xfs is "-f"
|
|
|
|
osd mount options {fs-type} = {mount options} # default mount option is "rw, noatime"
|
|
|
|
|
|
|
|
For example::
|
|
|
|
|
|
|
|
osd mkfs type = btrfs
|
|
|
|
osd mkfs options btrfs = -m raid0
|
|
|
|
osd mount options btrfs = rw, noatime
|
|
|
|
|
|
|
|
For each ``[osd.n]`` section of your configuration file, specify the storage device.
|
|
|
|
For example::
|
|
|
|
|
|
|
|
[osd.1]
|
|
|
|
devs = /dev/sda
|
|
|
|
[osd.2]
|
|
|
|
devs = /dev/sdb
|
|
|
|
|
2012-08-30 07:35:31 +00:00
|
|
|
|
2012-05-30 21:29:10 +00:00
|
|
|
Run ``mkcephfs``
|
2012-08-28 20:24:29 +00:00
|
|
|
================
|
|
|
|
|
2012-05-30 21:29:10 +00:00
|
|
|
Once you have copied your Ceph Configuration to the OSD Cluster hosts
|
|
|
|
and created the default directories, you may deploy Ceph with the
|
|
|
|
``mkcephfs`` script.
|
|
|
|
|
|
|
|
.. note:: ``mkcephfs`` is a quick bootstrapping tool. It does not handle more
|
2012-12-22 00:09:09 +00:00
|
|
|
complex operations, such as upgrades.
|
2012-05-30 21:29:10 +00:00
|
|
|
|
2013-01-02 19:15:16 +00:00
|
|
|
To run ``mkcephfs``, execute the following::
|
2012-05-30 21:29:10 +00:00
|
|
|
|
|
|
|
cd /etc/ceph
|
|
|
|
sudo mkcephfs -a -c /etc/ceph/ceph.conf -k ceph.keyring
|
|
|
|
|
2013-01-02 19:15:16 +00:00
|
|
|
.. note:: For ``mkcephfs`` to use the ``mkfs`` configuration options, you MUST
|
|
|
|
specify a ``devs`` entry for each OSD.
|
2012-05-30 21:29:10 +00:00
|
|
|
|
2012-12-22 00:09:09 +00:00
|
|
|
The script adds an admin key to the ``ceph.keyring``, which is analogous to a
|
|
|
|
root password. See `Authentication`_ when running with ``cephx`` enabled. To
|
|
|
|
start the cluster, execute the following::
|
2012-06-06 00:09:59 +00:00
|
|
|
|
2012-12-07 23:48:29 +00:00
|
|
|
sudo service ceph -a start
|
2012-06-06 00:09:59 +00:00
|
|
|
|
2012-08-28 20:24:29 +00:00
|
|
|
See `Operating a Cluster`_ for details.
|
2012-06-06 00:09:59 +00:00
|
|
|
|
|
|
|
.. _Authentication: ../authentication
|
2012-12-22 00:09:09 +00:00
|
|
|
.. _Operating a Cluster: ../../operations/
|